PS4 stuck restarting

My console will start up and when i go to finish updating my games it will say error and then restart and will continue this cycle. ive tried rebuilding the data base and reseting the whole system and none of that helped. What could it be and how would it get repaired?