unwanted all-nighter
When you are legitimately trying to get a full night of sleep but you are unable to fall asleep, so you end up staying up all night. May be by choice after waiting too long to get to sleep, or by trying all night to get to sleep and not succeeding. Usually catastrophic when you have an important event or task the following day.
"Dude, I am so tired; I pulled an unwanted All-Nighter last night."