{"id":1451,"date":"2022-07-02T21:56:21","date_gmt":"2022-07-02T19:56:21","guid":{"rendered":"http:\/\/blog.schmoigl-online.de\/?p=1451"},"modified":"2022-07-02T21:56:21","modified_gmt":"2022-07-02T19:56:21","slug":"ubuntu-20-04-22-04-suddenly-disables-network-cards-due-to-falling-asleep","status":"publish","type":"post","link":"http:\/\/blog.schmoigl-online.de\/?p=1451","title":{"rendered":"Ubuntu 20.04\/22.04 suddenly disables network cards (due to falling asleep)"},"content":{"rendered":"\n<p>Another nice experience that you never want to make yourself, because you won&#8217;t most likely won&#8217;t find the reason for it:<\/p>\n\n\n\n<p>I have set up an Ubuntu Server, but out of the sudden it disconnects all network card, saying something like &#8220;carrier lost&#8221; in <code>\/var\/log\/syslog<\/code>. If you read very carefully your logs, you might find the following:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>Jul  2 15:00:52 comm NetworkManager[1087]: &lt;info>  [1656774052.0149] manager: sleep: sleep requested (sleeping: no  enabled: yes)<\/strong>\nJul  2 15:00:52 comm NetworkManager[1087]: &lt;info>  [1656774052.0151] manager: NetworkManager state is now ASLEEP\nJul  2 15:00:52 comm ModemManager[1271]: &lt;info>  [sleep-monitor] system is about to suspend\nJul  2 15:00:52 comm systemd[1]: Reached target Sleep.\nJul  2 15:00:52 comm systemd[1]: Starting Record successful boot for GRUB...\nJul  2 15:00:52 comm systemd[1]: Starting System Suspend...\nJul  2 15:00:52 comm systemd[1]: grub-common.service: Deactivated successfully.\nJul  2 15:00:52 comm systemd[1]: Finished Record successful boot for GRUB.\nJul  2 15:00:52 comm systemd[1]: Starting GRUB failed boot detection...\nJul  2 15:00:52 comm systemd[1]: Stopping Atop advanced performance monitor...\nJul  2 15:00:52 comm systemd[1]: grub-initrd-fallback.service: Deactivated successfully.\nJul  2 15:00:52 comm systemd[1]: Finished GRUB failed boot detection.\nJul  2 15:00:52 comm systemd[1]: atop.service: Deactivated successfully.\nJul  2 15:00:52 comm systemd[1]: Stopped Atop advanced performance monitor.\nJul  2 15:00:52 comm systemd-sleep[4340]: Entering sleep state 'suspend'...\nJul  2 15:00:52 comm kernel: [ 2037.277746] PM: suspend entry (deep)\nJul  2 15:00:52 comm kernel: [ 2037.306799] Filesystems sync: 0.029 seconds\nJul  2 15:06:12 comm kernel: [ 2037.308344] Freezing user space processes ... (elapsed 0.002 seconds) done.\n[...]\n<strong>Jul  2 15:06:12 comm kernel: [ 2037.348751] r8169 0000:05:00.0 enp5s0: Link is Down<\/strong>\n<strong>Jul  2 15:06:12 comm kernel: [ 2037.348830] e1000e: EEE TX LPI TIMER: 00000000\nJul  2 15:06:12 comm kernel: [ 2037.349454] e1000e: EEE TX LPI TIMER: 00000011\n<\/strong>Jul  2 15:06:12 comm kernel: [ 2037.452307] sd 4:0:0:0: [sda] Synchronizing SCSI cache\nJul  2 15:06:12 comm kernel: [ 2037.452504] sd 4:0:0:0: [sda] Stopping disk\nJul  2 15:06:12 comm kernel: [ 2037.875898] ACPI: PM: Preparing to enter system sleep state S3\nJul  2 15:06:12 comm kernel: [ 2038.084364] ACPI: PM: Saving platform NVS memory\nJul  2 15:06:12 comm kernel: [ 2038.084390] Disabling non-boot CPUs ...\nJul  2 15:06:12 comm kernel: [ 2038.086669] smpboot: CPU 1 is now offline\n[... other CPUs ...]\nJul  2 15:06:12 comm kernel: [ 2038.119491] ACPI: PM: Low-level resume complete\nJul  2 15:06:12 comm kernel: [ 2038.119573] ACPI: PM: Restoring platform NVS memory\nJul  2 15:06:12 comm kernel: [ 2038.120867] Enabling non-boot CPUs ...\nJul  2 15:06:12 comm kernel: [ 2038.120902] x86: Booting SMP configuration:\nJul  2 15:06:12 comm kernel: [ 2038.120902] smpboot: Booting Node 0 Processor 1 APIC 0x1\n[... other CPUs ...]\n<strong>Jul  2 15:06:12 comm kernel: [ 2038.134188] ACPI: PM: Waking up from system sleep state S3<\/strong><\/pre>\n\n\n\n<p>In a nutshell, what&#8217;s happening is the operating system trying to go into the sleep mode (S3 level) &#8211; however, get&#8217;s pull up immediately, but is unable to restore contact and carrier for your network cards. As the &#8220;suspend&#8221; phase is taking less than a second, you even won&#8217;t notice that something like this happened. The only thing that you&#8217;ll notice is the fact that  the network cards are disconnected &#8211; and you can&#8217;t even revive them even with unplugging the cable. You have to restart the machine instead.<\/p>\n\n\n\n<p>The &#8220;cure of this disease&#8221; is described in this stackoverflow\/askubuntu question: <a href=\"https:\/\/askubuntu.com\/a\/1398887\">https:\/\/askubuntu.com\/a\/1398887<\/a>: Disable the suspend mode by masking the corresponding targets:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target<\/pre>\n\n\n\n<p>This will ensure that the suspend commands are never reached and the system does not fall asleep &#8212; something that I would consider to be self-evident for a server operating system. Apparently, this does not hold true for Ubuntu, though&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ubuntu servers are not configured out-of-the box to prevent going to sleep mode. NetworkManager might announce this with &#8220;sleep requested&#8221;. After a millisecond-long nap, the network cards may not be coming up properly<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-1451","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"http:\/\/blog.schmoigl-online.de\/index.php?rest_route=\/wp\/v2\/posts\/1451","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.schmoigl-online.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.schmoigl-online.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.schmoigl-online.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.schmoigl-online.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1451"}],"version-history":[{"count":1,"href":"http:\/\/blog.schmoigl-online.de\/index.php?rest_route=\/wp\/v2\/posts\/1451\/revisions"}],"predecessor-version":[{"id":1452,"href":"http:\/\/blog.schmoigl-online.de\/index.php?rest_route=\/wp\/v2\/posts\/1451\/revisions\/1452"}],"wp:attachment":[{"href":"http:\/\/blog.schmoigl-online.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1451"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.schmoigl-online.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1451"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.schmoigl-online.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1451"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}