Power supply issues are the main cause of this problem. If your computer or printer is not directly connected to the main power source, say they are connected through a UPS, the UPS might be faulty.
Printers have a knack for breaking at the worst possible time. Luckily, many of the most common problems are things you can actually sort out yourself.