Make sure that just the top 3/8 of the t-couple is in the flame and not the middle. If thats ok, then check to see if the vent terminates at least 3' above the roof line( any shorter and high wind could cause the outage), if thats ok, light the pilot and immediately turn the knob to off. The 100% saftey shut off should take at least90 seconds before it closes. You will here a clicking noise come from the gas valve when it closes. If it clicks shut within 30 sec. Then the pilot coil is junk and you neeed to replace the gas valve.how old is the water heater/ most of them come with a 5 or 6 year warranty on parts and labor. The t-couple could be weak even out of a new package. Do a millivolt test to check its output.