Network Manager does not recover thernet connection on resume from hibernate

My TW KDE system uses Network Manager in preference to wicked for various reasons. This is a new install last week on a new HDD and now I find that on boot up although Network Manager works fine when I hibernate and then resume the wired lan connection which was in use prior to hibernate does not recover, trying to switch to wicked does not get the local connection up and a re-boot is needed.

Here is an extract from the journal which shows Network Manager from boot through to resume failing (newest entry first)


Feb 05 08:32:14 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517819534.1114] manager: NetworkManager state is now DISCONNECTED
Feb 05 08:32:13 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517819533.9690] device (enp5s0): state change: unmanaged -> unavailable (reason 'managed', internal state 'managed')
Feb 05 08:32:13 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517819533.9689] manager: waking up...
Feb 05 08:32:13 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517819533.9689] manager: wake requested (sleeping: yes  enabled: yes)
Feb 05 08:31:13 Tumbleweed.Crowhill nm-dispatcher[3064]: /etc/NetworkManager/dispatcher.d/nfs: line 49: reaches$1]: bad array subscript
Feb 05 08:31:13 Tumbleweed.Crowhill nm-dispatcher[3064]: /etc/NetworkManager/dispatcher.d/nfs: line 42: reaches: bad array subscript
Feb 05 08:31:13 Tumbleweed.Crowhill nm-dispatcher[3064]: /etc/NetworkManager/dispatcher.d/nfs: line 40: reaches: bad array subscript
Feb 05 08:31:13 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517819473.5630] device (enp5s0): state change: disconnected -> unmanaged (reason 'sleeping', internal state 'managed')
Feb 05 08:31:13 Tumbleweed.Crowhill NetworkManager[1076]: nisdomainname: you must be root to change the domain name
Feb 05 08:31:13 Tumbleweed.Crowhill NetworkManager[1076]: nisdomainname: you must be root to change the domain name
Feb 05 08:31:12 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517819472.9949] device (enp5s0): state change: deactivating -> disconnected (reason 'sleeping', internal state 'managed')
Feb 05 08:31:12 Tumbleweed.Crowhill dbus-daemon[1043]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' requested by ':1.6' (uid=0 pid=1076 comm="/usr/sbin/NetworkManager --no-daemon ")
Feb 05 08:31:12 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517819472.9387] device (enp5s0): state change: activated -> deactivating (reason 'sleeping', internal state 'managed')
Feb 05 08:31:12 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517819472.9384] manager: NetworkManager state is now ASLEEP
Feb 05 08:31:12 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517819472.9383] manager: sleeping...
Feb 05 08:31:12 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517819472.9383] manager: sleep requested (sleeping: no  enabled: yes)


Feb 05 08:18:17 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818697.5744] dhcp6 (enp5s0): state changed timeout -> done
Feb 05 08:18:17 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818697.5743] dhcp6 (enp5s0): canceled DHCP transaction, DHCP client pid 1596
Feb 05 08:18:17 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818697.5731] dhcp6 (enp5s0): state changed unknown -> timeout
Feb 05 08:18:17 Tumbleweed.Crowhill NetworkManager[1076]: <warn>  [1517818697.5729] dhcp6 (enp5s0): request timed out
Feb 05 08:17:42 Tumbleweed.Crowhill dbus-daemon[1043]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' requested by ':1.6' (uid=0 pid=1076 comm="/usr/sbin/NetworkManager --no-daemon ")
Feb 05 08:17:42 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818662.1375] manager: NetworkManager state is now CONNECTED_GLOBAL
Feb 05 08:17:32 Tumbleweed.Crowhill NetworkManager[1076]: nisdomainname: you must be root to change the domain name
Feb 05 08:17:32 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818652.5438] policy: set 'Wired connection 1' (enp5s0) as default for IPv6 routing and DNS
Feb 05 08:17:32 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818652.5419] dhcp6 (enp5s0): dhclient started with pid 1596
Feb 05 08:17:32 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818652.3278] dhcp6 (enp5s0): activation: beginning transaction (timeout in 45 seconds)
Feb 05 08:17:30 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818650.6430] manager: startup complete
Feb 05 08:17:30 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818650.6423] device (enp5s0): link connected
Feb 05 08:17:30 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818650.0661] device (enp5s0): Activation: successful, device activated.
Feb 05 08:17:30 Tumbleweed.Crowhill NetworkManager[1076]: nisdomainname: you must be root to change the domain name
Feb 05 08:17:27 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818647.7241] policy: set 'Wired connection 1' (enp5s0) as default for IPv4 routing and DNS
Feb 05 08:17:27 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818647.7238] manager: NetworkManager state is now CONNECTED_SITE
Feb 05 08:17:27 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818647.3755] manager: NetworkManager state is now CONNECTED_LOCAL
Feb 05 08:17:27 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818647.3753] device (enp5s0): state change: secondaries -> activated (reason 'none', internal state 'managed')
Feb 05 08:17:27 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818647.3749] device (enp5s0): state change: ip-check -> secondaries (reason 'none', internal state 'managed')
Feb 05 08:17:27 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818647.3734] device (enp5s0): state change: ip-config -> ip-check (reason 'none', internal state 'managed')
Feb 05 08:17:27 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818647.3287] device (enp5s0): state change: config -> ip-config (reason 'none', internal state 'managed')
Feb 05 08:17:27 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818647.3280] device (enp5s0): state change: prepare -> config (reason 'none', internal state 'managed')
Feb 05 08:17:27 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818647.3257] manager: NetworkManager state is now CONNECTING
Feb 05 08:17:27 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818647.3255] device (enp5s0): state change: disconnected -> prepare (reason 'none', internal state 'managed')
Feb 05 08:17:27 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818647.3252] device (enp5s0): Activation: starting connection 'Wired connection 1' (f0066e17-cd2f-3357-ab57-799aaaefa22c)
Feb 05 08:17:27 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818647.3236] policy: auto-activating connection 'Wired connection 1'
Feb 05 08:17:27 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818647.3228] device (enp5s0): state change: unavailable -> disconnected (reason 'carrier-changed', internal state 'managed')
Feb 05 08:17:27 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818647.3215] device (enp5s0): link connected
Feb 05 08:17:25 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818645.0887] ModemManager available in the bus
Feb 05 08:17:25 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818645.0625] ModemManager disappeared from bus
Feb 05 08:17:24 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818644.3146] device (enp5s0): state change: unmanaged -> unavailable (reason 'managed', internal state 'external')
Feb 05 08:17:24 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818644.3128] manager: (enp5s0): new Ethernet device (/org/freedesktop/NetworkManager/Devices/2)
Feb 05 08:17:24 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818644.3107] manager: (lo): new Generic device (/org/freedesktop/NetworkManager/Devices/1)
Feb 05 08:17:24 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818644.3095] device (lo): link connected
Feb 05 08:17:24 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818644.3076] Loaded device plugin: NMTeamFactory (/usr/lib64/NetworkManager/libnm-device-plugin-team.so)
Feb 05 08:17:24 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818644.2785] Loaded device plugin: NMWifiFactory (/usr/lib64/NetworkManager/libnm-device-plugin-wifi.so)
Feb 05 08:17:24 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818644.2690] Loaded device plugin: NMBluezManager (/usr/lib64/NetworkManager/libnm-device-plugin-bluetooth.so)
Feb 05 08:17:24 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818644.2325] Loaded device plugin: NMAtmManager (/usr/lib64/NetworkManager/libnm-device-plugin-adsl.so)
Feb 05 08:17:24 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818644.2170] Loaded device plugin: NMWwanFactory (/usr/lib64/NetworkManager/libnm-device-plugin-wwan.so)
Feb 05 08:17:24 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818644.1775] Loaded device plugin: NMVxlanDeviceFactory (internal)
Feb 05 08:17:24 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818644.1775] Loaded device plugin: NMVlanDeviceFactory (internal)
Feb 05 08:17:24 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818644.1774] Loaded device plugin: NMVethDeviceFactory (internal)
Feb 05 08:17:24 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818644.1774] Loaded device plugin: NMTunDeviceFactory (internal)
Feb 05 08:17:24 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818644.1774] Loaded device plugin: NMMacvlanDeviceFactory (internal)
Feb 05 08:17:24 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818644.1773] Loaded device plugin: NMMacsecDeviceFactory (internal)
Feb 05 08:17:24 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818644.1773] Loaded device plugin: NMIPTunnelDeviceFactory (internal)
Feb 05 08:17:24 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818644.1772] Loaded device plugin: NMInfinibandDeviceFactory (internal)
Feb 05 08:17:24 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818644.1772] Loaded device plugin: NMEthernetDeviceFactory (internal)
Feb 05 08:17:24 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818644.1771] Loaded device plugin: NMDummyDeviceFactory (internal)
Feb 05 08:17:24 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517818644.1771] Loaded device plugin: NMBridgeDeviceFactory (internal)
Feb 05 08:17:24 Tumbleweed NetworkManager[1076]: <info>  [1517818644.1770] Loaded device plugin: NMBondDeviceFactory (internal)
Feb 05 08:17:24 Tumbleweed NetworkManager[1076]: <info>  [1517818644.1769] manager: Networking is enabled by state file
Feb 05 08:17:24 Tumbleweed NetworkManager[1076]: <info>  [1517818644.1768] manager: rfkill: WWAN enabled by radio killswitch; enabled by state file
Feb 05 08:17:24 Tumbleweed NetworkManager[1076]: <info>  [1517818644.1767] manager: rfkill: WiFi enabled by radio killswitch; enabled by state file
Feb 05 08:17:24 Tumbleweed NetworkManager[1076]: <info>  [1517818644.1767] dhcp-init: Using DHCP client 'dhclient'
Feb 05 08:17:24 Tumbleweed NetworkManager[1076]: <info>  [1517818644.1763] policy: set-hostname: set hostname to 'Tumbleweed.Crowhill' (from system configuration)
Feb 05 08:17:24 Tumbleweed NetworkManager[1076]: <info>  [1517818644.1759] settings: hostname changed from (none) to "Tumbleweed.Crowhill"
Feb 05 08:17:24 Tumbleweed NetworkManager[1076]: <info>  [1517818644.1758] settings: hostname: using hostnamed
Feb 05 08:17:24 Tumbleweed dbus-daemon[1043]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.6' (uid=0 pid=1076 comm="/usr/sbin/NetworkManager --no-daemon ")
Feb 05 08:17:23 Tumbleweed NetworkManager[1076]: <info>  [1517818643.9957] keyfile: new connection /etc/NetworkManager/system-connections/Wired connection 1 (f0066e17-cd2f-3357-ab57-799aaaefa22c,"Wired connection 1")
Feb 05 08:17:23 Tumbleweed NetworkManager[1076]: <info>  [1517818643.9532] settings: loaded plugin keyfile: (c) 2007 - 2016 Red Hat, Inc.  To report bugs please use the NetworkManager mailing list.
Feb 05 08:17:23 Tumbleweed dbus-daemon[1043]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' requested by ':1.6' (uid=0 pid=1076 comm="/usr/sbin/NetworkManager --no-daemon ")
Feb 05 08:17:23 Tumbleweed NetworkManager[1076]: <info>  [1517818643.6973] dns-mgr[0x55efd278e940]: init: dns=default, rc-manager=netconfig
Feb 05 08:17:23 Tumbleweed NetworkManager[1076]: <info>  [1517818643.6969] policy: hostname management mode: default
Feb 05 08:17:23 Tumbleweed NetworkManager[1076]: <info>  [1517818643.6957] manager[0x55efd2784100]: monitoring kernel firmware directory '/lib/firmware'.
Feb 05 08:17:23 Tumbleweed NetworkManager[1076]: <info>  [1517818643.6466] Read config: /etc/NetworkManager/NetworkManager.conf
Feb 05 08:17:23 Tumbleweed NetworkManager[1076]: <info>  [1517818643.6464] NetworkManager (version 1.8.6) is starting... (for the first time)

Stuart

Continuing the previous post as originally it was too long.

This is the status of the NM service following the resume


systemctl status NetworkManager.service
● NetworkManager.service - Network Manager
   Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2018-02-05 08:17:23 GMT; 18min ago
     Docs: man:NetworkManager(8)
 Main PID: 1076 (NetworkManager)
    Tasks: 3 (limit: 4915)
   CGroup: /system.slice/NetworkManager.service
           └─1076 /usr/sbin/NetworkManager --no-daemon

Feb 05 08:31:12 Tumbleweed.Crowhill NetworkManager[1076]: <info>   [1517819472.9384] manager: NetworkManager state is now ASLEEP
Feb 05 08:31:12 Tumbleweed.Crowhill NetworkManager[1076]: <info>   [1517819472.9387] device (enp5s0): state change: activated ->  deactivating (reason 'sleeping', internal state 'managed')
Feb 05 08:31:12 Tumbleweed.Crowhill NetworkManager[1076]: <info>   [1517819472.9949] device (enp5s0): state change: deactivating ->  disconnected (reason 'sleeping', internal state 'managed')
Feb 05 08:31:13 Tumbleweed.Crowhill NetworkManager[1076]: nisdomainname: you must be root to change the domain name
Feb 05 08:31:13 Tumbleweed.Crowhill NetworkManager[1076]: nisdomainname: you must be root to change the domain name
Feb 05 08:31:13 Tumbleweed.Crowhill NetworkManager[1076]: <info>   [1517819473.5630] device (enp5s0): state change: disconnected ->  unmanaged (reason 'sleeping', internal state 'managed')
Feb 05 08:32:13 Tumbleweed.Crowhill NetworkManager[1076]: <info>   [1517819533.9689] manager: wake requested (sleeping: yes  enabled: yes)
Feb 05 08:32:13 Tumbleweed.Crowhill NetworkManager[1076]: <info>  [1517819533.9689] manager: waking up...
Feb 05 08:32:13 Tumbleweed.Crowhill NetworkManager[1076]: <info>   [1517819533.9690] device (enp5s0): state change: unmanaged ->  unavailable (reason 'managed', internal state 'managed')
Feb 05 08:32:14 Tumbleweed.Crowhill NetworkManager[1076]: <info>   [1517819534.1114] manager: NetworkManager state is now DISCONNECTED

and again following a restart to attempt to get a connection


systemctl status NetworkManager.service
● NetworkManager.service - Network Manager
   Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2018-02-05 08:36:05 GMT; 3s ago
     Docs: man:NetworkManager(8)
 Main PID: 4060 (NetworkManager)
    Tasks: 4 (limit: 4915)
   CGroup: /system.slice/NetworkManager.service
           └─4060 /usr/sbin/NetworkManager --no-daemon

Feb 05 08:36:05 Tumbleweed.Crowhill NetworkManager[4060]: <info>   [1517819765.8977] Loaded device plugin: NMWwanFactory  (/usr/lib64/NetworkManager/libnm-device-plugin-wwan.so)
Feb 05 08:36:05 Tumbleweed.Crowhill NetworkManager[4060]: <info>   [1517819765.9035] Loaded device plugin: NMAtmManager  (/usr/lib64/NetworkManager/libnm-device-plugin-adsl.so)
Feb 05 08:36:05 Tumbleweed.Crowhill NetworkManager[4060]: <info>   [1517819765.9047] Loaded device plugin: NMBluezManager  (/usr/lib64/NetworkManager/libnm-device-plugin-bluetooth.so)
Feb 05 08:36:05 Tumbleweed.Crowhill NetworkManager[4060]: <info>   [1517819765.9054] Loaded device plugin: NMWifiFactory  (/usr/lib64/NetworkManager/libnm-device-plugin-wifi.so)
Feb 05 08:36:05 Tumbleweed.Crowhill NetworkManager[4060]: <info>   [1517819765.9277] Loaded device plugin: NMTeamFactory  (/usr/lib64/NetworkManager/libnm-device-plugin-team.so)
Feb 05 08:36:05 Tumbleweed.Crowhill NetworkManager[4060]: <info>  [1517819765.9304] device (lo): link connected
Feb 05 08:36:05 Tumbleweed.Crowhill NetworkManager[4060]: <info>   [1517819765.9316] manager: (lo): new Generic device  (/org/freedesktop/NetworkManager/Devices/1)
Feb 05 08:36:05 Tumbleweed.Crowhill NetworkManager[4060]: <info>   [1517819765.9338] manager: (enp5s0): new Ethernet device  (/org/freedesktop/NetworkManager/Devices/2)
Feb 05 08:36:05 Tumbleweed.Crowhill NetworkManager[4060]: <info>   [1517819765.9356] device (enp5s0): state change: unmanaged ->  unavailable (reason 'managed', internal state 'external')
Feb 05 08:36:06 Tumbleweed.Crowhill NetworkManager[4060]: <info>  [1517819766.0269] ModemManager available in the bus

I have found that wicked will resume OK and regain the wired connection following a resume however I do not want to use wicked as a permanent solution as configuring it and disconnecting and reconnecting the lan is not available via the GUI which is required here.

Stuart

I found bug 1058872 which although refers to a wifi connection sounds very similar so I have added my comments to this bug.

Stuart

Just tested to see if disabling network in YAST prior to hibernate and re-enable following resume works and the answer is yes, the network comes back up OK. At least I have a workaround allowing me to keep Network Manager.

Stuart

Ethernet hardware and driver details?

/usr/sbin/hwinfo --netcard

Is unloading and reloading the driver sufficient with helping NM regain management of the interface?

Just to clarify how do I remove and reinstall r8169 which is the driver for my Realtek card? Do I use modprobe in some way?

Stuart

Yes, with modprobe…

modprobe -r r8169
modprobe r8169

If that works, it can be automated to occur for a suspend/resume cycle.

A custom script in the /usr/lib/systemd/system-sleep/ directory. For example


#!/bin/bash
 "$1" = "post" ] && exec modprobe r8169
 "$1" = "pre" ] && exec rmmod r8169
exit 0

For more info

man systemd-suspend.service

A similar approach with a custom service file…
https://forums.opensuse.org/showthread.php/510210-Ethernet-down-after-resume-Tumbleweed?p=2732293#post2732293

Manually issuing these modprobe commands works and the network comes up OK. One very minor issue is that my Network Monitor widget does not show the activity although the correct connection is shown.

OK so now I can add the workaround but hopefully this will get fixed properly.

Stuart

Bug #1058872 still shows as new and nothing is happening so I think I will open a new bug to report this issue.

One other question, does anyone have any idea as to how to get the network monitor widget working again after a hibernate/resume? When I look at the Monitor settings it does not show any interface to be selected after the resume, also removing and adding the widget still has no effect.

Stuart

I have just created bug #1080483 for this problem.

Stuart

I had network issues when creating this bug and apparently unbeknown to me I created 3 reports in all #1080481 and #1080482 as well as #1080483 which is now the only one. Thanks to Andreas for sorting this out.

Stuart