FYI, on many fired appliances, they have logic to attempt to ignite the burner at least a couple of times in succession, and after appropriate purge cycles to vent any unburned fuel, try again a specific number of times. After failing that many times (depends on the design, could be 1, could be three, or some other number which should be described in the manual), they then will lock-out any attempt to restart the burner until manual intervention (often, pressing the reset). Failure to detect a flame could be because it actually didn't ignite, or the sensor that determines if it did is not working, or the circuit that it feeds isn't working. Could be a simple loose connection, a bad part, a misaligned part, or, it could be a hiccup in the fuel supply, the valve that turns it on, or (depending on the type of fuel), a pump, a nozzle, a jet, or a fuel line. Since you said it was gas, it could be that the gas line is undersized, or your gas meter has a problem. It might only happen when the unit tries to turn on, and there are other users, and the meter and regulator can't provide enough fuel. So, the unit itself might be working fine. There are tools that can measure that. If the size and length of the gas line are not per spec, there may not be enough gas to properly light the system. Since you also indicated that you'd had a couple of gas leaks, their workmanship is also suspect and there could be a pipe that has crud in it, and blocking the flow. The pressure in a gas pipe is normally quite low, and it may not move an obstruction.