You need to buy fuel to use a generator. No fuel-> No electricity. The sun though rises everyday.
(tangentially, China's solar PV manufacturing capacity is double current global demand, so capacity to produce is not the issue, but getting the clean tech into the hands of those who need it)
Newer panels are offering 40 year warranty.
40-year warranty covers the panel and its performance. And in the unlikely case you’ll ever need it, we make the return process simple and easy. With a historical return rate of only 1 in 20,000 panels under warranty: https://www.maxeon.com/maxeon-solar-panels