[SYSTEMD BUG?] Can't suspend after suspending one time after fresh boot


#1

I m using KDE , when I try to suspend first time after it works normally but after waking up when I try to suspend again nothing happens. After waking up shutdown fails too .
inxi -Fxz :

System:    Host: Capsparrow Kernel: 4.20.10-1-MANJARO x86_64 bits: 64 compiler: gcc v: 8.2.1 
           Desktop: KDE Plasma 5.15.0 Distro: Manjaro Linux 
Machine:   Type: Laptop System: HP product: HP 245 G4 Notebook PC v: Type1ProductConfigId 
           serial: <filter> 
           Mobo: HP model: 80C7 v: KBC Version 98.0E serial: <filter> UEFI: Insyde v: F.1C 
           date: 10/29/2015 
Battery:   ID-1: BAT0 charge: 38.8 Wh condition: 39.7/39.7 Wh (100%) model: Hewlett-Packard Primary 
           status: Charging 
CPU:       Topology: Quad Core model: AMD A8-7410 APU with AMD Radeon R5 Graphics bits: 64 type: MCP 
           arch: Puma rev: 1 L2 cache: 2048 KiB 
           flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 17572 
           Speed: 998 MHz min/max: 1000/2200 MHz Core speeds (MHz): 1: 1006 2: 1087 3: 1177 4: 1288 
Graphics:  Device-1: AMD Mullins [Radeon R4/R5 Graphics] vendor: Hewlett-Packard driver: radeon 
           v: kernel bus ID: 00:01.0 
           Display: x11 server: X.Org 1.20.3 driver: ati,radeon unloaded: modesetting 
           resolution: 1366x768~60Hz 
           OpenGL: renderer: AMD MULLINS (DRM 2.50.0 4.20.10-1-MANJARO LLVM 7.0.1) 
           v: 4.5 Mesa 18.3.3 direct render: Yes 
Audio:     Device-1: AMD Kabini HDMI/DP Audio vendor: Hewlett-Packard driver: snd_hda_intel 
           v: kernel bus ID: 00:01.1 
           Device-2: AMD FCH Azalia vendor: Hewlett-Packard driver: snd_hda_intel v: kernel 
           bus ID: 00:14.2 
           Sound Server: ALSA v: k4.20.10-1-MANJARO 
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Hewlett-Packard 
           driver: r8168 v: 8.045.08-NAPI port: 2000 bus ID: 01:00.0 
           IF: eno1 state: down mac: <filter> 
           Device-2: Broadcom and subsidiaries BCM43142 802.11b/g/n vendor: Hewlett-Packard 
           driver: wl v: kernel port: 2000 bus ID: 05:00.0 
           IF: wlp5s0 state: up mac: <filter> 
Drives:    Local Storage: total: 465.76 GiB used: 68.75 GiB (14.8%) 
           ID-1: /dev/sda vendor: Toshiba model: MQ01ABF050 size: 465.76 GiB 
Partition: ID-1: / size: 147.39 GiB used: 14.49 GiB (9.8%) fs: ext4 dev: /dev/sda1 
           ID-2: /home size: 294.29 GiB used: 54.26 GiB (18.4%) fs: ext4 dev: /dev/sda2 
           ID-3: swap-1 size: 4.00 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sda3 
Sensors:   System Temperatures: cpu: 52.9 C mobo: 0.0 C gpu: radeon temp: 54 C 
           Fan Speeds (RPM): N/A 
Info:      Processes: 176 Uptime: 1h 07m Memory: 3.32 GiB used: 1.74 GiB (52.3%) Init: systemd 
           Compilers: gcc: 8.2.1 Shell: zsh v: 5.7.1 inxi: 3.0.30 

Output of journalctl -xe -p3 -b :

Subject: A start job for unit NetworkManager-dispatcher.service has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- A start job for unit NetworkManager-dispatcher.service has finished with a failure.
-- 
-- The job identifier is 2323 and the job result is failed.
Feb 22 13:56:25 Capsparrow systemd[1]: sleep.target: Failed to set invocation ID for unit: File exists
Feb 22 13:56:25 Capsparrow systemd[1]: Failed to start Sleep.
-- Subject: A start job for unit sleep.target has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- A start job for unit sleep.target has finished with a failure.
-- 
-- The job identifier is 2412 and the job result is failed.
Feb 22 13:56:26 Capsparrow systemd[1]: NetworkManager-dispatcher.service: Failed to set invocation ID f>
Feb 22 13:56:26 Capsparrow systemd[1]: Failed to start Network Manager Script Dispatcher Service.
-- Subject: A start job for unit NetworkManager-dispatcher.service has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- A start job for unit NetworkManager-dispatcher.service has finished with a failure.
-- 
-- The job identifier is 2415 and the job result is failed.

Sorry for my broken English , The problem started after a update.


[Unstable Update] 2019-02-22 - Systemd, Cryptsetup, Go, Python - might break encrypted systems with luks
#2

As you are using a broadcom Wi-Fi adapter I’d put my bet on your Wi-Fi causing this. I have posted many examples on the forum of how to diagnose and remedy this on the forum if your Wi-Fi is responsible.

Search the forum for Wi-Fi related threads with the terms “systemd service”.

It could also simply be a kernel regression. Install and test older and newer kernels through Manjaro settings manager.


#3

Yes its a Broadcom Wi-Fi adapter . :smile: I tried different Kernels its didn’t work . I searched the forum I will try once again thank you soo much.
Sorry I can’t find a fix can you post the link it would be a great help


#4

Try turning off your wifi ( any number of ways … like nmcli networking off before suspending (and then ‘on’ after ) or systemctl disable NetworkManager --now (and then enable) etc. You will find some of the systemd workaround hinge on this … some going to extremes to unload the driver, then disable the service, and so on - then the reverse on resume. I cannot say for certain where yours might fall, or if it is a similar issue at all.


#5

Okay give me a minute.
Sorry the problem persists.


#6

Sad days. Please see some of the additional information above about unloading the module and so forth. But again, just a thought. Good luck.


#7

Also when I try to shutdown after suspending once it throws error saying
Failed to start unmount Allfilesystems
Failed to start Shutdown


#8

From your errors I’m fairly sure this issue is net working related. You can try this service to see if it fixes things.

Create the suspend unit:

etc/systemd/system/network-suspend.service

With the following contents:

#/etc/systemd/system/network-suspend.service
#sudo systemctl enable network-suspend.service
#sudo systemctl start network-suspend.service
#sudo systemctl status network-suspend.service
#sudo systemctl daemon-reload
[Unit]
Description=Network suspend service 
Before=sleep.target
StopWhenUnneeded=yes

[Service]
User=root
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/sudo -u $USER /bin/bash -lc 'nmcli networking off'
ExecStart=/usr/bin/sleep 1
ExecStart=/usr/bin/systemctl stop NetworkManager
ExecStart=/usr/bin/sleep 1
ExecStart=/usr/bin/ip link set wlp5s0 down  
ExecStart=/usr/bin/sleep 1
ExecStartPost=/usr/bin/modprobe -r wl

[Install]
WantedBy=sleep.target

Create the resume unit:

etc/systemd/system/network-resume.service

With these contents:

#/etc/systemd/system/network-resume.service
#sudo systemctl enable network-resume.service
#sudo systemctl start network-resume.service
#sudo systemctl status network-resume.service
#sudo systemctl daemon-reload
[Unit]
Description=Network resume service
After=suspend.target
StopWhenUnneeded=yes

[Service]
User=root
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/usr/bin/sleep 10
ExecStart=/usr/bin/modprobe wl
ExecStart=/usr/bin/sleep 2
ExecStart=/usr/bin/ip link set wlp5s0 up
ExecStart=/usr/bin/sleep 2
ExecStart=/usr/bin/systemctl start NetworkManager
ExecStart=/usr/bin/sleep 2
ExecStart=/usr/bin/sudo -u $USER /bin/bash -lc 'nmcli networking on'
ExecStart=/usr/bin/sleep 2
ExecStart=/usr/bin/sudo -u $USER /bin/bash -lc 'nmcli r wifi off'
ExecStart=/usr/bin/sleep 2
ExecStart=/usr/bin/sudo -u $USER /bin/bash -lc 'nmcli r wifi on'

[Install]
WantedBy=suspend.target

Then restart.

If your adapter ID is different than “wlp5s0” you will need to substitute your own adapter’s ID into the service files. If you are using a different driver module you will also need to substitute it in place of “wl”.

You can find your adapters driver/module and device identification with the following command:

inxi -n

You can reduce the sleep times to make the services execute more quickly, but that may reduce the services effectiveness.

I hope those two services fix things for you.

Further info:


#9

Fails :sweat:
Journalctl ;

Feb 22 19:06:55 Capsparrow systemd[1]: network-suspend.service: Failed to set invocation ID for unit: File exists

#10

Restart then run the status commands that are listed in the units. Post the status outputs.


#11

There was an extra space before “down” on the suspend unit. I edited the file. I’m only on my cell phone. It is very hard to notice syntax errors on such a small screen.


#13

Status results :

➜  ~ sudo systemctl status network-resume.service
[sudo] password for beatrix: 
● network-resume.service - Network resume service
   Loaded: loaded (/etc/systemd/system/network-res>
   Active: inactive (dead)

Status result:

➜  ~ sudo systemctl status network-suspend.service
● network-suspend.service - Network suspend service
   Loaded: loaded (/etc/systemd/system/network-sus>
   Active: inactive (dead)

Didn’t helped :sob:


#14


If this helps

journalctl after suspend :

➜  ~ journalctl -xe -p3 -b

-- Subject: A start job for unit network-suspend.service has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- A start job for unit network-suspend.service has finished with a failure.
-- 
-- The job identifier is 1544 and the job result is failed.
Feb 22 20:06:49 Capsparrow systemd[1]: sleep.target: Failed to set invocation ID for unit: File exists
Feb 22 20:06:49 Capsparrow systemd[1]: Failed to start Sleep.
-- Subject: A start job for unit sleep.target has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- A start job for unit sleep.target has finished with a failure.
-- 
-- The job identifier is 1543 and the job result is failed.
Feb 22 20:06:49 Capsparrow systemd[1]: network-resume.service: Failed to set invocation ID for unit: Fi>
Feb 22 20:06:49 Capsparrow systemd[1]: Failed to start Network resume service.
-- Subject: A start job for unit network-resume.service has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- A start job for unit network-resume.service has finished with a failure.
-- 
-- The job identifier is 1628 and the job result is failed.

#15

Those services have been 100% solid in the past, so I figured it was’t the services fault and went searching. Apparently this is another systemd regression.

I found this on the Arch forum from yesterday.

https://bbs.archlinux.org/viewtopic.php?id=244399

Downgrading systemd resolves this issue.

“systemd version 239.370-1
Problem was not present”

Please do not ask me how to perform a downgrade. I will not recommend that, because partial upgrades bring the potential for far worse issues than you are experiencing.

I hate to bother @philm by pinging him, but he should be made aware of this issue with systemd.


#16

Yeah the problem wasn’t there before systemd 239 so I before turned to stable branch and downgraded all the packages but now the systemd241 is now in stable branch so it got updated . So I thought forums would help . I can live without suspend but it causes errors in Shutdown . :sob::sob::sob: I need help.

Thank you so much to give time for a complete noob like me.:sweat_smile:


#17

I modified your title so that it will hopefully catch the attention of the devs. I hope you don’t mind.


#18

Sure , take my system too if you want :laughing:


#19

Updated to the systemd pushed with latest testing update with other packages too. No affect whatsoever :persevere:


[Testing Update] 2019-03-02 - Kernels, Plasma5, Systemd, Mesa, Xorg-Server, Deepin
#20

@Hridam: please open an issue upstream to get a fix. As soon as some is posted the developers will investigate. If some fix got provided I’ll include it. Also note that v239 seems to be fine and the regression got added with v240 series. Also it would be good to do a git-bisect on the sourcecode if possible, to find the issue, however that might be a longer way to go, when you have no developer knowledge.


#21

Done thank you everyone for help. :grinning: