I turn the switch on the wall on to light my gas fireplace. It turns on for a short while then turns it self off. What is the problem? Thanks!
For others that might be looking...not quite enough info in OP, but this might help. A lot of gas FPs have 2 sensors; a thermocouple and a thermopile. If both the main flame and the pilot go out, the problem is likely on the side of the thermocouple (could be thermocouple itself, or the solenoid in the main valve). If the pilot stays on, but the main flame goes out, the most likely (but not only possible) issue is the thermopile (you should be able to test this easily with a multimeter - lots of videos online regarding testing a thermopile). It may just need a good cleaning (again, lots of videos on how to do this online) or possible replacement (not a fun job, but can be done by a diy'er). Hope that helps.
This might be automatic shut-off because a safety thermocouple is not holding the valve open.
To prevent explosive buildup of fuel in the air, most gas appliances have a thermocouple that provides electricity to hold a magnetic valve open. In a water heater, for example, the pilot light heats the thermocouple, and should it blow out, the gas is shut.
Perhaps there is a thermocouple that needs a minute or so to get warm, and you're not holding the valve open long enough to heat it. Read the instructions for your fireplace.