Gas oven lights but turns off after 2-3 seconds
It might be the thermocouple connected to the gas valve.  This is a safety feature that is used to shut off the gas if the flame blows out.  Thermocouple failure is a common occurrence with gas hot water heaters, furnaces and boilers that turn on/off more than stoves/ovens.