If you are getting a flame for a few seconds then the ignition system appears to be ok. It almost sounds like your gas solenoid valve is acting up. I had a similar problem and I had to replace it. I went online and got the manual and parts list. I followed the suggested troubleshooting guide, which in my opinionis very poor and it didn't really guide me to the gas SV. I decidedthat theorifice on theSV might be plugged so Itook it off, inspected it, and found it to beclean. Then I performed avery risky manouver.Usinganother12volt source, I energised the SV with the orifice still removed. When the valve operated, I expected to smell propane,but I no gas was comingout. I bought a newsoleniod valve (a 100+ bucks), installed and repeated my previous test and the gas was flowing. I put everything back together and the WH has worked ever since.
So after all that I said, it might be a good idea to have look at the gas SV by first checking to orifice and then the SV. By the way, when you energise the SV, it will make a clicking sound which is normal, but it doesn't necessarily mean that SV is open to pass the gas to the orifice.
Helen & George VE3INB and Max (Bichon Frise)
2006 Silverado 2500HD D/A,
2006 Cruiser CF30SK