0

I'm currently facing a problem and have been for the past few weeks where my Ubuntu 20.04.5 dedicated server keeps going into either sleep or hibernation making SSH and FTP unresponsive. My server is currently hosted at Hetzner and they have run a full system test which resulted in everything running as expected (Hardware etc).

It's not every x amount of time or at a specific time every day it's just sporadically and the only way to regain access to SSH or FTP is to go to Hetzners panel and reboot the full system.

I have done the following:

Ensure sleep, hibernation and suspend are disabled using the following action

systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

Resulting in the following response:

● sleep.target - Sleep
     Loaded: loaded (/lib/systemd/system/sleep.target; static; vendor preset: enabled)
     Active: inactive (dead)
       Docs: man:systemd.special(7)

● suspend.target - Suspend
     Loaded: loaded (/lib/systemd/system/suspend.target; static; vendor preset: enabled)
     Active: inactive (dead)
       Docs: man:systemd.special(7)

● hibernate.target - Hibernate
     Loaded: loaded (/lib/systemd/system/hibernate.target; static; vendor preset: enabled)
     Active: inactive (dead)
       Docs: man:systemd.special(7)

● hybrid-sleep.target - Hybrid Suspend+Hibernate
     Loaded: loaded (/lib/systemd/system/hybrid-sleep.target; static; vendor preset: enabled)
     Active: inactive (dead)
       Docs: man:systemd.special(7)

I have also ensured that any GUI packages have been removed as I'm aware these might contain desktop style hibernation commands.

I have seen online to check shutdown logs and reboot logs, however upon checking the only reboot logs come from the Hetzner panel same goes for any shutdown and boot logs, they all either come from Hetzner or myself.

I have ensured all packages are updated.

The only thing I haven't done is upgrade to 22.04.2 as I'm worried it'll break some packages and to my knowledge new OS versions are not necessary.

Any help on this would be perfect thanks, it's currently my plex server and having to reboot it randomly half way through a movie is not ideal.

EDIT:

Additional information, I have run the following command.

journalctl  -b -1 -e

Which resulted in:

Mar 08 23:16:53 Ubuntu-2004-focal-64-minimal kernel: kvm: Nested Virtualization enabled
Mar 08 23:16:53 Ubuntu-2004-focal-64-minimal kernel: kvm: Nested Paging enabled
Mar 08 23:16:53 Ubuntu-2004-focal-64-minimal kernel: SVM: Virtual VMLOAD VMSAVE supported
Mar 08 23:16:53 Ubuntu-2004-focal-64-minimal kernel: snd_hda_intel 0000:09:00.1: Disabling MSI
Mar 08 23:16:53 Ubuntu-2004-focal-64-minimal kernel: snd_hda_intel 0000:09:00.1: Handle vga_switcheroo audio client
Mar 08 23:16:53 Ubuntu-2004-focal-64-minimal kernel: MCE: In-kernel MCE decoding enabled.
Mar 08 23:16:53 Ubuntu-2004-focal-64-minimal kernel: EDAC amd64: Node 0: DRAM ECC enabled.
Mar 08 23:16:53 Ubuntu-2004-focal-64-minimal kernel: EDAC amd64: F17h_M70h detected (node 0).
Mar 08 23:16:53 Ubuntu-2004-focal-64-minimal kernel: EDAC MC: UMC0 chip selects:
Mar 08 23:16:53 Ubuntu-2004-focal-64-minimal kernel: EDAC amd64: MC: 0:     0MB 1:     0MB
Mar 08 23:16:53 Ubuntu-2004-focal-64-minimal kernel: EDAC amd64: MC: 2: 16384MB 3: 16384MB
Mar 08 23:16:53 Ubuntu-2004-focal-64-minimal kernel: EDAC MC: UMC1 chip selects:
Mar 08 23:16:53 Ubuntu-2004-focal-64-minimal kernel: EDAC amd64: MC: 0:     0MB 1:     0MB
Mar 08 23:16:53 Ubuntu-2004-focal-64-minimal kernel: EDAC amd64: MC: 2: 16384MB 3: 16384MB
Mar 08 23:16:53 Ubuntu-2004-focal-64-minimal kernel: EDAC amd64: using x16 syndromes.
Mar 08 23:16:53 Ubuntu-2004-focal-64-minimal kernel: EDAC amd64: MCT channel count: 2
Mar 08 23:16:53 Ubuntu-2004-focal-64-minimal kernel: EDAC MC0: Giving out device to module amd64_edac controller F17h_M70h: DEV 0000:00:18.3 (INTERRUPT)
Mar 08 23:16:53 Ubuntu-2004-focal-64-minimal kernel: EDAC PCI0: Giving out device to module amd64_edac controller EDAC PCI controller: DEV 0000:00:18.0 (POLLED)
Mar 08 23:16:53 Ubuntu-2004-focal-64-minimal kernel: AMD64 EDAC driver v3.5.0
Mar 08 23:16:53 Ubuntu-2004-focal-64-minimal systemd[1]: Found device /dev/disk/by-uuid/927341e0-d572-4001-8c39-6d03382e681e.
Mar 08 23:16:53 Ubuntu-2004-focal-64-minimal systemd[1]: Found device /dev/disk/by-uuid/4c2da277-0b96-4d99-90b9-716f01eb43c0.
Mar 08 23:16:53 Ubuntu-2004-focal-64-minimal systemd[1]: Found device /dev/disk/by-uuid/af5d28ee-4c10-49e0-a3f1-fbf36fe8fa4d.
Mar 08 23:16:53 Ubuntu-2004-focal-64-minimal systemd[1]: Activating swap /dev/disk/by-uuid/4c2da277-0b96-4d99-90b9-716f01eb43c0...
Mar 08 23:16:53 Ubuntu-2004-focal-64-minimal systemd[1]: Mounting /boot...
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal kernel: EXT4-fs (md1): mounting ext3 file system using the ext4 subsystem
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal systemd[1]: Mounting /home...
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal systemd[1]: Started MD array monitor.
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal systemd[1]: Starting Load Kernel Module chromeos_pstore...
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal systemd[1]: Condition check resulted in Load Kernel Module efi_pstore being skipped.
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal systemd[1]: Starting Load Kernel Module pstore_blk...
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal systemd[1]: Starting Load Kernel Module pstore_zone...
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal systemd[1]: Condition check resulted in Load Kernel Module ramoops being skipped.
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal systemd[1]: Condition check resulted in Set Up Additional Binary Formats being skipped.
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal systemd[1]: Condition check resulted in Rebuild Hardware Database being skipped.
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal systemd[1]: modprobe@pstore_blk.service: Succeeded.
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal systemd[1]: Finished Load Kernel Module pstore_blk.
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal systemd[1]: modprobe@pstore_zone.service: Succeeded.
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal systemd[1]: Finished Load Kernel Module pstore_zone.
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal systemd[1]: Found device /dev/disk/by-uuid/5ded13df-c205-4fca-a4da-5d4499eec78e.
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal systemd[1]: var.mount: Directory /var to mount over is not empty, mounting anyway.
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal systemd[1]: Mounting /var...
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal kernel: Adding 33519612k swap on /dev/md0.  Priority:-2 extents:1 across:33519612k FS
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal systemd[1]: Activated swap /dev/disk/by-uuid/4c2da277-0b96-4d99-90b9-716f01eb43c0.
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal systemd[1]: modprobe@chromeos_pstore.service: Succeeded.
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal systemd[1]: Finished Load Kernel Module chromeos_pstore.
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal systemd[1]: Reached target Swap.
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal kernel: EXT4-fs (md1): recovery complete
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal kernel: EXT4-fs (md1): mounted filesystem with ordered data mode. Opts: (null)
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal systemd[1]: Mounted /boot.
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal kernel: EXT4-fs (md3): recovery complete
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal systemd[1]: Mounted /home.
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal kernel: EXT4-fs (md3): mounted filesystem with ordered data mode. Opts: (null)
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal systemd[1]: Reached target Sound Card.
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal kernel: input: HDA NVidia HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:03.1/0000:09:00.1/sound/card0/input2
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal kernel: input: HDA NVidia HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:03.1/0000:09:00.1/sound/card0/input3
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal kernel: input: HDA NVidia HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:03.1/0000:09:00.1/sound/card0/input4
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal kernel: input: HDA NVidia HDMI/DP,pcm=9 as /devices/pci0000:00/0000:00:03.1/0000:09:00.1/sound/card0/input5
Mar 08 23:16:54 Ubuntu-2004-focal-64-minimal kernel: input: HDA NVidia HDMI/DP,pcm=10 as /devices/pci0000:00/0000:00:03.1/0000:09:00.1/sound/card0/input6
Mar 08 23:16:56 Ubuntu-2004-focal-64-minimal kernel: EXT4-fs (md4): recovery complete
Mar 08 23:16:56 Ubuntu-2004-focal-64-minimal systemd[1]: Mounted /var.
Mar 08 23:16:56 Ubuntu-2004-focal-64-minimal systemd[1]: Listening on Load/Save RF Kill Switch Status /dev/rfkill Watch.
Mar 08 23:16:56 Ubuntu-2004-focal-64-minimal systemd[1]: Mounting Mount unit for bare, revision 5...
Mar 08 23:16:56 Ubuntu-2004-focal-64-minimal kernel: EXT4-fs (md4): mounted filesystem with ordered data mode. Opts: (null)
Mar 08 23:16:56 Ubuntu-2004-focal-64-minimal systemd[1]: Mounting Mount unit for core18, revision 2679...
Mar 08 23:16:56 Ubuntu-2004-focal-64-minimal systemd[1]: Mounting Mount unit for core18, revision 2697...
Mar 08 23:16:56 Ubuntu-2004-focal-64-minimal systemd[1]: Mounting Mount unit for core20, revision 1822...
Mar 08 23:16:56 Ubuntu-2004-focal-64-minimal systemd[1]: Mounting Mount unit for core20, revision 1828...
Mar 08 23:16:56 Ubuntu-2004-focal-64-minimal systemd[1]: Mounting Mount unit for gnome-3-38-2004, revision 115...
Mar 08 23:16:56 Ubuntu-2004-focal-64-minimal systemd[1]: Mounting Mount unit for gnome-3-38-2004, revision 119...
Mar 08 23:16:56 Ubuntu-2004-focal-64-minimal systemd[1]: Mounting Mount unit for gtk-common-themes, revision 1535...
Mar 08 23:16:56 Ubuntu-2004-focal-64-minimal systemd[1]: Mounting Mount unit for snapd, revision 17950...
Mar 08 23:16:56 Ubuntu-2004-focal-64-minimal systemd[1]: Mounting Mount unit for snapd, revision 18357...
Mar 08 23:16:56 Ubuntu-2004-focal-64-minimal systemd[1]: Starting Flush Journal to Persistent Storage...
Mar 08 23:16:56 Ubuntu-2004-focal-64-minimal systemd[1]: Condition check resulted in Platform Persistent Storage Archival being skipped.
Mar 08 23:16:56 Ubuntu-2004-focal-64-minimal systemd[1]: Starting Load/Save Random Seed...
Mar 08 23:16:56 Ubuntu-2004-focal-64-minimal systemd-journald[463]: Time spent on flushing to /var/log/journal/84281756b5ee4a3ba12d56f7152e2846 is 4.631ms for 1160 entries.

I have also checked the syslog and found the system shutdown/sleep around 23:12 and then I manually rebooted it at 23:18 as 23:11 was my last minutely cronjob run. It continued to run at 23:19 when it had finally booted back up.

Syslog file:

Mar  8 23:10:10 Ubuntu-2004-focal-64-minimal CRON[1289553]: (root) CMD (find /var/www/html/Shows/* -type f ! -name "*.*" ! -name "*-*" ! -name "*download-*" -exec realpath {} \; -exec /usr/bin/ffmpeg -i {} -acodec aac -ac 6 -vcodec copy -sn -start_number 0 -hls_time 10 -hls_list_size 0 -f hls -hls_segment_filename '{}-P%03d' {}.m3u8 \; -exec rm -f {} \;)
Mar  8 23:10:11 Ubuntu-2004-focal-64-minimal postfix/pickup[1287355]: 6B7A1B60068: uid=0 from=<root>
Mar  8 23:10:24 Ubuntu-2004-focal-64-minimal postfix/cleanup[1288640]: 6B7A1B60068: message-id=<20230308221007.6B7A1B60068@REDACTED>
Mar  8 23:10:53 Ubuntu-2004-focal-64-minimal postfix/pickup[1287355]: CD3E2B60065: uid=0 from=<root>
Mar  8 23:11:01 Ubuntu-2004-focal-64-minimal postfix/cleanup[1288640]: CD3E2B60065: message-id=<20230308221007.CD3E2B60065@REDACTED>
Mar  8 23:12:01 Ubuntu-2004-focal-64-minimal kernel: [77425.656486] [ 864486]     0 864486      652        0    45056       2Mar  8 23:18:16 Ubuntu-2004-focal-64-minimal systemd-sysctl[488]: Not setting net/ipv4/conf/all/promote_secondaries (explicit setting exists).
Mar  8 23:18:16 Ubuntu-2004-focal-64-minimal systemd-sysctl[488]: Not setting net/ipv4/conf/default/promote_secondaries (explicit setting exists).
Mar  8 23:18:16 Ubuntu-2004-focal-64-minimal systemd[1]: Finished Create System Users.
Mar  8 23:18:16 Ubuntu-2004-focal-64-minimal systemd[1]: Starting Create Static Device Nodes in /dev...
Mar  8 23:18:16 Ubuntu-2004-focal-64-minimal systemd[1]: modprobe@chromeos_pstore.service: Succeeded.
Mar  8 23:18:16 Ubuntu-2004-focal-64-minimal systemd[1]: Finished Load Kernel Module chromeos_pstore.
Mar  8 23:18:16 Ubuntu-2004-focal-64-minimal systemd[1]: Finished Set the console keyboard layout.
Mar  8 23:18:16 Ubuntu-2004-focal-64-minimal systemd[1]: [email protected]: Succeeded.
Mar  8 23:18:16 Ubuntu-2004-focal-64-minimal systemd[1]: Finished Load Kernel Module drm.
Mar  8 23:18:16 Ubuntu-2004-focal-64-minimal systemd[1]: [email protected]: Succeeded.
Mar  8 23:18:16 Ubuntu-2004-focal-64-minimal systemd[1]: Finished Load Kernel Module ramoops.
Mar  8 23:18:16 Ubuntu-2004-focal-64-minimal systemd[1]: Finished Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress polling.
Mar  8 23:18:16 Ubuntu-2004-focal-64-minimal systemd[1]: Finished Create Static Device Nodes in /dev.
Mar  8 23:18:16 Ubuntu-2004-focal-64-minimal systemd[1]: Reached target Local File Systems (Pre).
Mar  8 23:18:16 Ubuntu-2004-focal-64-minimal systemd[1]: Starting udev Kernel Device Manager...
Mar  8 23:18:16 Ubuntu-2004-focal-64-minimal systemd[1]: Started udev Kernel Device Manager.

This looks like a standard boot to me, but there is not mention of sleep, hibernation or shutdown in any logs on the server.

4
  • How do you know the machine goes into hibernation, rather than just lose network connectivity? What do the logs show? What does its console show when it's unreachable?
    – zwets
    Mar 8, 2023 at 1:34
  • After you've rebooted, sudo journalctl -b -1 -e will show you the end of the previous boot's log. This should show which process did the deed. Read man journalctl.
    – waltinator
    Mar 8, 2023 at 1:39
  • Terminal just disconnects and times out reconnecting. I have checked the journal logs and it doesn't show any shutdowns besides the ones I have to do via the Hetzner panel. Mar 8, 2023 at 12:42
  • I have updated my question with additional information Mar 8, 2023 at 22:38

0

You must log in to answer this question.

Browse other questions tagged .