My gas fireplace lights and runs fine but will shut down totally including pilot light two minutes after the fan blower turns on..what could be wrong..is it electrical.
A gas fireplace has several temperature sensor settings.
One is to turn on the fan. When the firebox gets hot, the fan turns on to spread the heat through the room.
There's also an overheat safety setting. When the firebox gets dangerously hot, the heater shuts down.
It sounds to me like these two settings are too close together. I'd call in a gas tech for a cleaning and servicing. It doesn't cost much, and should be done from time to time.
It's likely not electrical, as the overheat protection will work even if the power goes out.