Sudo hangs, internet disappears, and computer cannot be shut down after computer has been asleep for a long time

Sorry in advance for the lack of detailed technical info here - I'm doing my best but I'm relatively new to linux troubleshooting.

I'm using Ubuntu 21.10 (specifically the Ubuntu Budgie DE, in case that's relevant) and only that -- I'm not dual-booting. My machine is a desktop I built myself (Ryzen 5 3600 CPU, GeForce RTX 3070 GPU, 16 Gigs of RAM).

Normal everyday use is totally fine if I shut my machine down at the end of the day. However, I start getting a weird collection of issues when I wake my computer up after it has been asleep* for a long time. These symptoms only occur when it's been a significant amount of time since the machine has gone to sleep - if I let the computer go to sleep and come back in an hour or so (I haven't tested exactly where the threshold is), it's fine. Most of my experience with this issue comes when I wake it up after it's been in sleep mode overnight.

*re: "asleep" -- I generally am not actively putting my machine into either "suspend" or "hibernate" mode myself, so I am not sure which state the machine is in. This is whatever happens automatically when my computer is idle for some time, and it requires me to input my password on a login screen upon "awakening". The physical machine has its lights on and looks and sounds as it does while running something that isn't taxing the system much. Here is a picture of the relevant portion of my power settings:

Screenshot of power settings in Ubuntu Budgie.

The most common symptom pattern is this:

  • when I wake my machine up and log in, none of the running programs can access the internet, even though I am connected to both ethernet and wi-fi and the network manager reflects that.
  • If I open the terminal and attempt to run sudo (or any command prefixed by sudo), it hangs without prompting me for my password. I've tried leaving it like this for a while in case it was just taking a long time as I've seen advised on other similar issues online, but it seems to hang more-or-less indefinitely. I haven't waited hours or anything, but I've definitely waited double-digit minutes and nothing will have changed.
  • If I attempt to shut down or restart the computer, it does not successfully do so. This manifests either as the screen freezing upon clicking the "shut down" or "restart" prompt in the dialogue box, or sometimes the screen goes black entirely (but does not turn off - it's "glowing black" if that makes sense). Either way I can see and hear the machine is still running.

When this set of issues occurs, the only solution I've found so far is to hold down the power button and hard reset that way. After doing so, when I boot up the machine again everything's working fine (until the next time I leave it to sleep for a while). This makes the problem manageable for now, but it can't be the ideal way to handle things, and I'd like to fix whatever the underlying issue is.

Sometimes the symptoms differ from this and the computer will be completely frozen on the login screen after waking up from sleep (including the system clock being frozen at an incorrect time). This happens more rarely and generally only if I've left the computer asleep for an even longer amount of time (like, two days rather than overnight). The only solution I've found so far is the same - hard reboot via the power button.

Things I've tried already:

  • updating graphics drivers. Using the nouveau drivers, I'd get a lot of issues in a similar vein to this. However, this particular issue occurred while I was using the proprietary nvidia-driver-470, and nothing noticeably changed when I updated to nvidia-driver-510.
  • booting up in recovery mode via grub and repairing broken packages. I haven't left the computer running in recovery mode to see if that effects things, but doing this at least doesn't prevent the problem from occurring on subsequent non-recovery-mode sessions.
  • I've tried running "sudo reboot" and variants of the above command to fix the inability to shut down via the GUI. This is how I discovered the issue with sudo hanging indefinitely

The closest issue I've been able to find to this on AskUbuntu is this one. I found an even closer match on reddit as well. Neither has an actual solution to the problem though, unfortunately.

I've struggled troubleshooting this because once I've hard rebooted my computer, the problem goes away until I let it sleep for a long time again. And since while the problem is occurring, I can't use the internet or any command that requires sudo, my options are limited. I've tried reading the syslog in the past to solve issues, but I'm not experienced enough with linux yet to really understand which messages are routine and which I should pay attention to, so I'm not sure how to use it to diagnose a problem.

Hopefully the information I've provided here is enough to give someone out there an idea of what might be going wrong. Ask me for more info and I'll be happy to provide!

3 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like