It’s a bad electrode. The spark ignitor has a built-in flame sensor that doesn’t seem to be sensing the flame. That’s why it lights then shuts off. Easy fix just Google the model of the water heater and electrode. It’s held on by a single screw and plugs into the control board mounted on the side of the water heater.
Check fuel line, check thermal cut off switch
Mine gets a buildup of creosote maybe just clean the area where it sparks off.
RV repair tech (amongst many other things). This is a gas supply issue. I can hear the igniter striking. That it is doing it three times means all systems are go on the water heater itself.
Most likely a blockage in the burner tube (spider web, etc) or the LP regulator is no bueno.
I recently had a situation where one of my propane regulators somehow had the pressure backed off, and the flame was underwhelming to the point it it was insufficient for the flame sensor. More likely a dirty/defective flame sensor, though.
I took a can of air and sprayed the gunk out of the line. It fired right up afterwards.
Source: RV Water Heater sat for a season and now not working. Lights up 3 times then quits.