No Ethernet Network Connection after Resume; very recent problem

Yeah yeah sure, i know that... & i hope that you also easily see when i am teasing you back ... hence my appended emoji selection above.

1 Like

Next Line: "I am the very model of a modern major general."

I see you are having problems again on the new kernels.

If you'd like I'll offer some assistance.

Switch back to kernel 4.18.

Put your computer to sleep, then resume from sleep.

Try this command:

nmcli r all off; sleep 5; nmcli r all on

Test if your connection is back.

If not, try this command:

sudo systemctl stop NetworkManager.service; modprobe -r r8169; sleep 5; modprobe r8169; systemctl start NetworkManager.service

Let me know how that goes and I think I can fix your issue fairly easily.

Sadly yeah, per my [Stable Update] 2018-08-31 - Kernels, Mesa, Qemu, Nvidia, Firefox, Python, Haskell my Tower remains fine re post-Resume network for kernels =<4.18.3, but NFG for 4.18.4, 4.18.5 & 4.19.0rc1.

Graciously offered & gratefully received :smiley:

I'm cooking dinner & am soon to gob it, but later tonight hopefully i'll get a chance to tryout your suggestions. Will post an update then. Til then, i thank you.

1 Like

Am just about ready to try your suggestions, but first i re-read this thread. Do you know that re your first suggestion, you already advised me that...
No Ethernet Network Connection after Resume; very recent problem :
nmcli r all off; sleep 5; nmcli r all on

...to which i replied...

No Ethernet Network Connection after Resume; very recent problem :

Sadly, it did not work.

I shall repeat that test now coz this is a different kernel to before... but given that earlier attempt, i'm not optimistic...

Back soon.

I have other alternative commands to fix this. That command is the simplest method because it does not require root.

Are you still using the r8169 driver, and is your adapter ID still enp2s0

Yes & Yes.

Results:

  1. Post-Resume, kernel 4.18.5, network boggered-off again, so i did...
[kdemeoz@GA-Z97-HD3-Tower ~]$ nmcli r all off; sleep 5; nmcli r all on
[kdemeoz@GA-Z97-HD3-Tower ~]$

ie, same as last time... no error msg, but no network return either.

  1. So then i immediately tried...
[kdemeoz@GA-Z97-HD3-Tower ~]$ sudo systemctl stop NetworkManager.service; modprobe -r r8169; sleep 5; modprobe r8169; systemctl start NetworkManager.service
[sudo] password for kdemeoz: 
modprobe: ERROR: could not remove 'r8169': Operation not permitted
[kdemeoz@GA-Z97-HD3-Tower ~]$

...& of course then still no network.

Remembering that kernel 4.18.3 was still behaving well before today's Stable Update, i chose to Downgrade .5 back to .3, rebooted into it, Suspended, Resumed... network instantly available again. Golly, it's totally day vs night for .3 vs .5, re networking post-Resume.

I know that you only need to sleep every 79 days, but i'm just about finished for the night here, heehee, so for now i shall bid you good night. :sleeping:

Try:

sudo systemctl stop NetworkManager.service; ip link set enp2s0 down; modprobe -r r8169; sleep 5; modprobe r8169; ip link set enp2s0 up; systemctl start NetworkManager.service

If that command does not work, then this second method should hopefully do it:

Just before going into suspend issue these commands individually

sudo systemctl stop NetworkManager.service
sudo ip link set enp2s0 down
sudo modprobe -r r8169

Continue with the process regardless of any errors encountered.

Please post all inputs and outputs of those commands.

Give it 30 seconds (or a minute), and then resume.

After coming out of suspend, wait 15 seconds, then issue these commands:

sudo modprobe r8169
sudo ip link set enp2s0 up
sudo systemctl start NetworkManager.service

Please post all inputs and outputs of those commands.

After issuing those commands I should hopefully have a better idea of how to fix this.

(edited)

Hey Oz.

This may look complicated, but I made it as simple as I could. I wrote two systemd service files for you.

This suspend unit file stops the network components prior to suspending.

Create Systemd Suspend Unit File:

In a terminal type the following:

sudo nano /etc/systemd/system/network-suspend.service 

Paste the script contents below with a right click. Exit with CTRL + X and press Y to save.

Systemd suspend unit service file contents:

#/etc/systemd/system/network-suspend.service
#sudo systemctl enable network-suspend.service 
[Unit]
Description=Stop network components prior to suspending
Before=sleep.target

[Service]
Type=oneshot
ExecStart=/bin/systemctl stop NetworkManager.service; ip link set enp2s0 down; modprobe -r r8169

[Install]
WantedBy=sleep.target

Next, make the service file executable and owned by root.

sudo chown root:root /etc/systemd/system/network-suspend.service
sudo chmod +x /etc/systemd/system/network-suspend.service

Then, enable the service:

sudo systemctl enable network-suspend.service

This resume unit file restarts the network components after resuming from suspend.

Create Systemd Resume Unit File:

In a terminal type the following:

sudo nano /etc/systemd/system/network-resume.service 

Paste the script contents below with a right click. Exit with CTRL + X and press Y to save.

Systemd resume unit service file contents:

#/etc/systemd/system/network-resume.service
#sudo systemctl enable network-resume.service
[[Unit]
Description=Start network components after resuming
After=suspend.target

[Service]
Type=oneshot
ExecStartPre=/bin/sleep 15s
ExecStart=/bin/modprobe r8169; ip link set enp2s0 up; systemctl start NetworkManager.service

[Install]
WantedBy=suspend.target

Next, make the service file executable and owned by root.

sudo chown root:root /etc/systemd/system/network-resume.service
sudo chmod +x /etc/systemd/system/network-resume.service

Then, enable the service:

sudo systemctl enable network-resume.service

Then reboot.

(edit)

Recently people have reported these services as not working correctly. Upon investigation it became apparent the reason why was because they had missed the blacklisting step earlier in the thread. This is a very long thread, but you must apply all the important steps for it to be successful.

These services were written for the r18169 driver. If you are using the r8168 driver you must either switch to the 8169 driver, or alter the service units to load/unload the r8168 module instead.

4 Likes

This looks --sensational-- & i am keen to try it out, which will be in the next hour or two i think. Whether it solves the problem or not, i wanna sincerely thank you... i'm gobsmacked at this superb level of ongoing generosity! Will let you know how it goes, a bit later...

Btw, i was thinking about the following, last night, with a sense of perplexity. My Lappy is many years older than my Tower, with [IMO] inferior HW specs. Despite this, Lappy is having no problems with kernels > 4.18.3, whereas Tower is clearly having a bad time with the same kernels [re post-Resume networking, i mean; other than that, 4.18.5 seems great for Tower too].

My computer I've been running Manjaro KDE on since the beginning of the year on is almost 10 years old. It has been flawless since I installed, so who really knows where the issue lies. It's probably related to some dark curse. :wink:

You are very welcome. I used to hate dealing with systemd, but now I'm actually starting to enjoy working with it. I learn a bit more every time I write a unit file, so it's a good learning experience.

Well, i have no good news at all i'm afraid. The summary is that this interesting idea sadly did not resolve the problem. Here's all the dirty details.

After creating & Enabling those services, then UNdowngrading kernel to 4.18.3, letting Octopi re-upgrade it to 4.18.5, rebooting in 4.18.5 [network good], Suspending, Resuming... NO Network once more:

Summary
[kdemeoz@GA-Z97-HD3-Tower ~]$ sudo systemctl status network-resume.service
[sudo] password for kdemeoz: 
● network-resume.service
   Loaded: loaded (/etc/systemd/system/network-resume.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sun 2018-09-02 11:14:24 AEST; 46s ago
  Process: 3363 ExecStart=/bin/modprobe r8169; ip link set enp2s0 up; systemctl start NetworkManager.servi>
  Process: 2806 ExecStartPre=/bin/sleep 15s (code=exited, status=0/SUCCESS)
 Main PID: 3363 (code=exited, status=1/FAILURE)

Sep 02 11:14:24 GA-Z97-HD3-Tower systemd[1]: Failed to start network-resume.service.
[kdemeoz@GA-Z97-HD3-Tower ~]$ sudo systemctl status network-suspend.service
● network-suspend.service - Stop network components prior to suspending
   Loaded: loaded (/etc/systemd/system/network-suspend.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sun 2018-09-02 11:09:05 AEST; 7min ago
  Process: 2807 ExecStart=/bin/systemctl stop NetworkManager.service; ip link set enp2s0 down; modprobe -r>
 Main PID: 2807 (code=exited, status=5)

Sep 02 11:09:05 GA-Z97-HD3-Tower systemd[1]: Failed to start Stop network components prior to suspending.

Wondering if those failures above might be caused by not having Started those two Enabled services prior to Suspend, i tried Starting them now [but aware i already now have no network, so maybe this will fail now]:

Summary
[kdemeoz@GA-Z97-HD3-Tower ~]$ sudo systemctl start network-suspend.service
Job for network-suspend.service failed because the control process exited with error code.
See "systemctl status network-suspend.service" and "journalctl -xe" for details.

[kdemeoz@GA-Z97-HD3-Tower ~]$ sudo systemctl enable network-resume.service
[kdemeoz@GA-Z97-HD3-Tower ~]$ sudo systemctl enable network-suspend.service
[kdemeoz@GA-Z97-HD3-Tower ~]$

[kdemeoz@GA-Z97-HD3-Tower ~]$ sudo systemctl start network-suspend.service
Job for network-suspend.service failed because the control process exited with error code.
See "systemctl status network-suspend.service" and "journalctl -xe" for details.

[kdemeoz@GA-Z97-HD3-Tower ~]$ sudo systemctl start network-resume.service
Job for network-resume.service failed because the control process exited with error code.
See "systemctl status network-resume.service" and "journalctl -xe" for details.
[kdemeoz@GA-Z97-HD3-Tower ~]$ 

[kdemeoz@GA-Z97-HD3-Tower ~]$ journalctl -xe
-- Subject: Unit network-resume.service has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit network-resume.service has failed.
-- 
-- The result is RESULT.
Sep 02 11:16:53 GA-Z97-HD3-Tower kate[5730]: "ForegroundLink" - conversion from "73,202,1610" to QColor fa>
Sep 02 11:16:53 GA-Z97-HD3-Tower kate[5730]: "ForegroundLink" - conversion from "73,202,1610" to QColor fa>
Sep 02 11:16:53 GA-Z97-HD3-Tower kate[5730]: "ForegroundLink" - conversion from "73,202,1610" to QColor fa>
Sep 02 11:16:53 GA-Z97-HD3-Tower kate[5730]: "ForegroundLink" - conversion from "73,202,1610" to QColor fa>
Sep 02 11:16:53 GA-Z97-HD3-Tower kate[5730]: "ForegroundLink" - conversion from "73,202,1610" to QColor fa>
Sep 02 11:16:53 GA-Z97-HD3-Tower kate[5730]: "ForegroundLink" - conversion from "73,202,1610" to QColor fa>
Sep 02 11:16:53 GA-Z97-HD3-Tower kate[5730]: "ForegroundLink" - conversion from "73,202,1610" to QColor fa>
Sep 02 11:16:53 GA-Z97-HD3-Tower kate[5730]: "ForegroundLink" - conversion from "73,202,1610" to QColor fa>
Sep 02 11:17:42 GA-Z97-HD3-Tower systemd[1]: Failed to start Stop network components prior to suspending.
-- Subject: Unit network-suspend.service has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit network-suspend.service has failed.
-- 
-- The result is RESULT.
Sep 02 11:18:26 GA-Z97-HD3-Tower systemd[1]: Failed to start Stop network components prior to suspending.
-- Subject: Unit network-suspend.service has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit network-suspend.service has failed.
-- 
-- The result is RESULT.
Sep 02 11:19:54 GA-Z97-HD3-Tower systemd[1]: Failed to start network-resume.service.
-- Subject: Unit network-resume.service has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit network-resume.service has failed.
-- 
-- The result is RESULT.
lines 3051-3089/3089 (END)

Wondering if those failures above might be caused by not having Started those two Enabled services prior to Suspend [with network still available], i rebooted yet again [4.18.5], & did:

Summary
[kdemeoz@GA-Z97-HD3-Tower ~]$ sudo systemctl start network-resume.service
[sudo] password for kdemeoz: 
Job for network-resume.service failed because the control process exited with error code.
See "systemctl status network-resume.service" and "journalctl -xe" for details.
[kdemeoz@GA-Z97-HD3-Tower ~]$ sudo systemctl enable network-suspend.service
[kdemeoz@GA-Z97-HD3-Tower ~]$ sudo systemctl start network-suspend.service
Job for network-suspend.service failed because the control process exited with error code.
See "systemctl status network-suspend.service" and "journalctl -xe" for details.
[kdemeoz@GA-Z97-HD3-Tower ~]$ sudo systemctl enable network-resume.service
[kdemeoz@GA-Z97-HD3-Tower ~]$ sudo systemctl start network-resume.service
Job for network-resume.service failed because the control process exited with error code.
See "systemctl status network-resume.service" and "journalctl -xe" for details.
[kdemeoz@GA-Z97-HD3-Tower ~]$ 
[kdemeoz@GA-Z97-HD3-Tower ~]$ sudo systemctl status network-suspend.service
● network-suspend.service - Stop network components prior to suspending
   Loaded: loaded (/etc/systemd/system/network-suspend.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sun 2018-09-02 11:28:08 AEST; 1min 24s ago
 Main PID: 3359 (code=exited, status=5)

Sep 02 11:28:08 GA-Z97-HD3-Tower systemd[1]: Failed to start Stop network components prior to suspending.
[kdemeoz@GA-Z97-HD3-Tower ~]$ 
[kdemeoz@GA-Z97-HD3-Tower ~]$ sudo systemctl status network-resume.service
● network-resume.service
   Loaded: loaded (/etc/systemd/system/network-resume.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sun 2018-09-02 11:29:15 AEST; 1min 10s ago
  Process: 4306 ExecStart=/bin/modprobe r8169; ip link set enp2s0 up; systemctl start NetworkManager.service (code=exited, status=1/FAILURE)
  Process: 4109 ExecStartPre=/bin/sleep 15s (code=exited, status=0/SUCCESS)
 Main PID: 4306 (code=exited, status=1/FAILURE)

Sep 02 11:29:15 GA-Z97-HD3-Tower systemd[1]: Failed to start network-resume.service.
[kdemeoz@GA-Z97-HD3-Tower ~]$ 
[kdemeoz@GA-Z97-HD3-Tower ~]$ 


[kdemeoz@GA-Z97-HD3-Tower ~]$ journalctl -xe
-- /etc/systemd/journald.conf. See journald.conf(5) for details.
Sep 02 11:26:12 GA-Z97-HD3-Tower systemd-cryptsetup[410]: Failed to activate with key file '/crypto_keyfile.bin': Invalid argument
Sep 02 11:26:12 GA-Z97-HD3-Tower systemd-vconsole-setup[428]: /usr/bin/loadkeys failed with exit status 1.
Sep 02 11:26:14 GA-Z97-HD3-Tower systemd-vconsole-setup[604]: /usr/bin/loadkeys failed with exit status 1.
Sep 02 11:26:34 GA-Z97-HD3-Tower kgpg[1056]: Error loading text-to-speech plug-in "flite"
Sep 02 11:26:35 GA-Z97-HD3-Tower kmix[1043]: org.kde.kmix: Cannot load profile  "PulseAudio.Playback_Devices.1.default"  . It was removed by the user, or the KM>
Sep 02 11:26:35 GA-Z97-HD3-Tower kmix[1043]: org.kde.kmix: Cannot load profile  "PulseAudio.Capture_Devices.1.default"  . It was removed by the user, or the KMi>
Sep 02 11:26:35 GA-Z97-HD3-Tower kmix[1043]: org.kde.kmix: Cannot load profile  "PulseAudio.Playback_Streams.1.default"  . It was removed by the user, or the KM>
Sep 02 11:26:35 GA-Z97-HD3-Tower kmix[1043]: org.kde.kmix: Cannot load profile  "PulseAudio.Capture_Streams.1.default"  . It was removed by the user, or the KMi>
Sep 02 11:26:35 GA-Z97-HD3-Tower kmix[1043]: org.kde.kmix: Cannot load profile  "PulseAudio.Playback_Devices.1.default"  . It was removed by the user, or the KM>
Sep 02 11:26:35 GA-Z97-HD3-Tower kmix[1043]: org.kde.kmix: Cannot load profile  "PulseAudio.Capture_Devices.1.default"  . It was removed by the user, or the KMi>
Sep 02 11:26:35 GA-Z97-HD3-Tower kmix[1043]: org.kde.kmix: Cannot load profile  "PulseAudio.Playback_Streams.1.default"  . It was removed by the user, or the KM>
Sep 02 11:26:35 GA-Z97-HD3-Tower kmix[1043]: org.kde.kmix: Cannot load profile  "PulseAudio.Capture_Streams.1.default"  . It was removed by the user, or the KMi>
Sep 02 11:26:36 GA-Z97-HD3-Tower kate[1420]: "ForegroundLink" - conversion from "73,202,1610" to QColor failed  (bounds error: blue component > 255)
Sep 02 11:26:36 GA-Z97-HD3-Tower kate[1420]: "ForegroundLink" - conversion from "73,202,1610" to QColor failed  (bounds error: blue component > 255)
Sep 02 11:26:36 GA-Z97-HD3-Tower kate[1420]: "ForegroundLink" - conversion from "73,202,1610" to QColor failed  (bounds error: blue component > 255)
Sep 02 11:26:36 GA-Z97-HD3-Tower kate[1420]: "ForegroundLink" - conversion from "73,202,1610" to QColor failed  (bounds error: blue component > 255)
Sep 02 11:26:36 GA-Z97-HD3-Tower kate[1420]: "ForegroundLink" - conversion from "73,202,1610" to QColor failed  (bounds error: blue component > 255)
Sep 02 11:26:36 GA-Z97-HD3-Tower kate[1420]: "ForegroundLink" - conversion from "73,202,1610" to QColor failed  (bounds error: blue component > 255)
Sep 02 11:26:36 GA-Z97-HD3-Tower kate[1420]: "ForegroundLink" - conversion from "73,202,1610" to QColor failed  (bounds error: blue component > 255)
Sep 02 11:26:36 GA-Z97-HD3-Tower kate[1420]: "ForegroundLink" - conversion from "73,202,1610" to QColor failed  (bounds error: blue component > 255)
Sep 02 11:27:22 GA-Z97-HD3-Tower systemd[1]: Failed to start network-resume.service.
-- Subject: Unit network-resume.service has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit network-resume.service has failed.
-- 
-- The result is RESULT.
Sep 02 11:28:08 GA-Z97-HD3-Tower systemd[1]: Failed to start Stop network components prior to suspending.
-- Subject: Unit network-suspend.service has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit network-suspend.service has failed.
-- 
-- The result is RESULT.
Sep 02 11:29:15 GA-Z97-HD3-Tower systemd[1]: Failed to start network-resume.service.
-- Subject: Unit network-resume.service has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit network-resume.service has failed.
-- 
-- The result is RESULT.
lines 3073-3117/3117 (END)

Hence clearly there's no point continuing with another Suspend-Resume test atm. I feel strongly inclined to just re-downgrade to 4.18.3 & be done with it, but will leave it alone for the remainder of [my] day, in case you have other ideas to try. Thanks.

I'm sorry to hear that. I had high hopes that would fix things. Hopefully we can still get it working.

If you feel like trouble shooting this, perform those commands and let me know what the outputs are. If you'd rather not pursue this I understand it may be more trouble than it's worth to you..

Hello again. I'm just about to go beddybyes, so i ran those commands one by one before Suspending Tower. There were no error messages, indeed no Konsole responses at all. However clearly they did work at some level, coz they did stop the networking [even removing the icon from the SystemTray]. I then Suspended, as mentioned... but curiosity got the better of me so i Resumed after a few minutes rather than waiting til tomorrow morn. Post-Resume, there was no network, again. I had to reboot once more before getting the network back so i could post this reply.

I wonder what has gone wrong inside the code for 4.18.4 & .5, compared to .3. Per earlier post, .3 Resumes perfectly, yet those two incremental updates somehow are just lousy.

Tomorrow, unless you, @philm, or someone else has had a breakthrough on the problem overnight [my time], i shall re-downgrade to 4.18.3... i definitely would like to properly solve this, but otoh the testing is burning up time i kinda need to spend on other tasks. No pressure, teehee.

You need to run the second half of the commands after resuming (above). That is good news you had no errors. That means I just need to tweak the unit file. Try the second set of commands to see if your network returns after resuming.

Run both sets of pre and post suspend commands again. If they work correctly the service files I wrote should work to remedy your issues (once we correct one omission I made).

My apologies, I had not had much sleep yesterday, and I forgot one fundamental detail.

I was focused on writing the unit file, and totally forgot to assign the correct file permissions.

We must make both service files executable and owned by root.

sudo chown root:root /etc/systemd/system/network-suspend.service
sudo chmod +x /etc/systemd/system/network-suspend.service

Then enable the service (once more just to be sure):

sudo systemctl enable network-suspend.service
sudo chown root:root /etc/systemd/system/network-resume.service
sudo chmod +x /etc/systemd/system/network-resume.service

Then enable the service (once more just to be sure):

sudo systemctl enable network-resume.service

I will modify my earlier post and add the omitted details.

Hopefully that gets you fixed up.

Whoa! I had to go sit down & catch my breath when i read this. It came as a shock to me, coz never before had the concept of You & Sleep in a single sentence occurred to me; til now i assumed the two entities were mutually exclusive :stuck_out_tongue_winking_eye:

Sorry for my delay getting back to you; been off fighting other fires, but am now about to do the 2018-09-02 Stable Update on Tower, hence timing is good to also try again on your suggestions.

Dumb question / statement... i am struggling to understand when i should read consecutive posts of yours as being complementary to each other [ie, i should do what BOTH posts say], versus when the later post SUPERSEDES the preceding one. Case in point... your 2 posts directly prior to this reply of mine.

The posts regarding running the individual commands pre/post suspend will give you a better idea if the whole process will work. They really should have been run before I ever wrote the systemd units, but you were offline for a bit so I got ahead of myself and just did them up anyways.

As I said I have been getting more into writing systemd files, so I just went ahead and did them ahead of time. I've been researching their usage so I was glad for an opportunity to practice at it further. I was sort of putting the cart before the horse so to speak.

1 Like

Forum kindly sponsored by