Nixpkgs: power management is not loaded in plasma 5

Created on 2 Apr 2017  Â·  36Comments  Â·  Source: NixOS/nixpkgs

Issue description

Going into Power Management under system settings in plasma 5 shows an error message:

Power Management configuration module could not be loaded.
The Power Management Service appears not to be running.
This can be solved by starting or scheduling it inside "Startup and Shutdown"

Checking under "Startup and Shutdown" there is no Power Management service.
I tried to enable powerManagement and upower.

ps aux | grep upower
root      1125  0.0  0.0 283452  6536 ?        Ssl  12:55   0:00 upowerd

/nix/store/dj9gwhvb0nnbi8zyhbl2r84i5d7m66la-powerdevil-5.8.6/lib/libexec/org_kde_powerdevil

Seems to be running too.

Technical details

I'm running 17.09.git.88da9ab (Hummingbird)

bug stale

Most helpful comment

Thanks!

One way to mitigate this temporarily would be to disable session saving. In System Settings > Startup and Shutdown > Desktop Session choose Start with an empty session under On Login.

It seems that most of the saved programs have paths in /run/current-system/sw/ which is good. The only offenders seem to be powerdevil and kdeconnect. I wonder if this is due to their being started by D-Bus. Their service files may need to be changed; I will investigate that.

All 36 comments

I'm also seeing this. It was working in 2839b101, and is broken in 08c87eed. Notably, in the working 2839b101, there is no "Power Management Service" listed in "Startup and Shutdown".

Another symptom appears to be that suspend doesn't work: the Ctrl-Alt-Del "leave" screen does not list "suspend" as an option, and pressing the power button initiates a shutdown rather than a suspend.

@yochai I don't see commit 88da9ab anywhere in this repo ... maybe you have local commits? Do you know what upstream commit you're based on? (Will cut down the git bisect work ...)

Here's what I've bisected so far:

```$ git bisect log
git bisect start

good: [40cb02e11c186cdb61989a6c425fc6bc2dfa9b5c] Merge remote-tracking branch 'jerith666/ha-current10' into current8

git bisect good 40cb02e11c186cdb61989a6c425fc6bc2dfa9b5c

bad: [96e7f5597b98de49a52b54f21d38cdf756e58fff] Merge remote-tracking branch 'jerith666/ha-current10' into current8

git bisect bad 96e7f5597b98de49a52b54f21d38cdf756e58fff

skip: [a8e259777271e0fe7e7d8b47dccfe4c266dc4860] Merge pull request #23161 from AndersonTorres/freecell-solver

git bisect skip a8e259777271e0fe7e7d8b47dccfe4c266dc4860

skip: [9a976c09ba9b810a8ef0cd0ce9a6e60b26eaad87] Merge pull request #23963 from dtzWill/feature/irkerd

git bisect skip 9a976c09ba9b810a8ef0cd0ce9a6e60b26eaad87

bad: [77b5d22df3af5a231f6abafcb35839eebe8dc315] gmtp: init at 1.3.10 (#24178)

git bisect bad 77b5d22df3af5a231f6abafcb35839eebe8dc315

good: [6505c6e3df519bbf800f302e9ba14923b9dabee5] keepass-keeagent: init at 0.8.1

git bisect good 6505c6e3df519bbf800f302e9ba14923b9dabee5

skip: [3b762fb201629bcb72cdc74481f93c275ab71e45] Merge pull request #24049 from ndowens/rapcad

git bisect skip 3b762fb201629bcb72cdc74481f93c275ab71e45

skip: [bcbaa8b8dd2c6c7019da608407b392e36046169f] Merge pull request #24040 from barrucadu/vsftpd-no_anon_password

git bisect skip bcbaa8b8dd2c6c7019da608407b392e36046169f

bad: [88341c4d2b289eefdaa94c6390975a14f15b4fb7] Revert "doc: remove double space"

git bisect bad 88341c4d2b289eefdaa94c6390975a14f15b4fb7

skip: [cc9bdcc2173dc5491c1b33f4ae497dec3609b6e8] Merge pull request #23802 from ndowens/libp11

git bisect skip cc9bdcc2173dc5491c1b33f4ae497dec3609b6e8

bad: [20e62c3b76732d664c591b5927acc8a79e7cfc91] Merge pull request #24030 from ndowens/fontmatrix

git bisect bad 20e62c3b76732d664c591b5927acc8a79e7cfc91

skip: [309f10b00c358779fc754d11fbcf72ff08593f36] Merge pull request #23134 from ljli/earlyoom-init

git bisect skip 309f10b00c358779fc754d11fbcf72ff08593f36

skip: [953616907493c5b81ba3ec9dd86f1422f4d1fcd3] nixos/treewide: remove boolean examples for options

git bisect skip 953616907493c5b81ba3ec9dd86f1422f4d1fcd3

skip: [559abb2604fe85ee558fea45f507d735d950fd7d] perlPackages.TestRunPluginAlternateInterpreters: init at 0.0124

git bisect skip 559abb2604fe85ee558fea45f507d735d950fd7d

skip: [7dccfd49aa6f78b3c550564a0614605c5b35fcb3] iosevka: 1.4.2 -> 1.11.4

git bisect skip 7dccfd49aa6f78b3c550564a0614605c5b35fcb3

skip: [a53f1c0f74ee868aa7e7d317a72410e99af1fe04] perlPackages.TaskTestRunAllPlugins: init at 0.0105

git bisect skip a53f1c0f74ee868aa7e7d317a72410e99af1fe04
```

@jerith666 you are right, I've given the wrong commit id, sorry about it.
I will continue the bisect using your indexes, I had no good index, but it takes time as I need to build locally.

@yochai no problem. I'm continuing to bisect as well; I'll update my comment above as I progress.

@jerith666 I think I finished:

# good: [a368a80c90f1a0ccffb59017e1900e87b9c66824] libxkbcommon: add ttuegel to maintainers
git bisect good a368a80c90f1a0ccffb59017e1900e87b9c66824
# skip: [8ec7f51167b2c23b951509a6ab6b077a9c2778cf] phonon: 4.9.0 -> 4.9.1
git bisect skip 8ec7f51167b2c23b951509a6ab6b077a9c2778cf
# bad: [c93c57b8acb59b0904bee2a4208c25e245f50972] plasma5: 5.8.6 -> 5.9.3
git bisect bad c93c57b8acb59b0904bee2a4208c25e245f50972
# skip: [cd7d8a60b44a80bab95b1cfceb58b27443bce502] qt58: init at 5.8.0
git bisect skip cd7d8a60b44a80bab95b1cfceb58b27443bce502
# only skipped commits left to test
# possible first bad commit: [c93c57b8acb59b0904bee2a4208c25e245f50972] plasma5: 5.8.6 -> 5.9.3                                      
# possible first bad commit: [8ec7f51167b2c23b951509a6ab6b077a9c2778cf] phonon: 4.9.0 -> 4.9.1                                       
# possible first bad commit: [cd7d8a60b44a80bab95b1cfceb58b27443bce502] qt58: init at 5.8.0

Can you duplicate my results ?

great, I'm building 46ba7cf94a21f7e78ddfd72bdca61f567219ccec (direct child of newest suspect c93c57b8acb59b0904bee2a4208c25e245f50972) overnight tonight.

CC @ttuegel, author of all three suspect commits. I'll also do some poking to see if this has been reported upstream.

I don't see anything obvious on bugs.kde.org. :-/

Found this in the logs (journalctl --user -r):

xsession[3257]: powerdevil: KDE Power Management System init failed!
xsession[3257]: powerdevil: "The plugin '/nix/store/sy061mgy5bdr1938r6bylcxcyrrh1ysx-powerdevil-5.9.4/lib/qt5/plugins/kf5/powerdevil/powerdevilupowerbackend.so' uses incompatible Qt library. (5.8.0) [release]"

Tried to temporarily move .config then login and have it generate a new one for me, and it worked. It seems one of the configuration files is causing it, restored the folder.

cat ~/.config/ksmserverrc
[General]
screenCount=1

[LegacySession: saved at previous logout]
count=0

[Session: saved at previous logout]
clientId1=10d9d4dd64000149003121000000013800006
clientId2=10d9d4dd64000149163288500000027620001
clientId3=10d9d4dd64000149003121000000013800008
count=3
discardCommand1[$e]=rm,$HOME/.config/session/kwin_10d9d4dd64000149003121000000013800006_1491632900_73266
program1=kwin_x11
program2=/nix/store/d0mcw5i4gi68v5hbf59yxs67ygyd28hz-kdeconnect-1.0.3/lib/libexec/kdeconnectd
program3=/nix/store/dj9gwhvb0nnbi8zyhbl2r84i5d7m66la-powerdevil-5.8.6/lib/libexec/org_kde_powerdevil
restartCommand1=kwin_x11,-session,10d9d4dd64000149003121000000013800006_1491632900_73266
restartCommand2=/nix/store/d0mcw5i4gi68v5hbf59yxs67ygyd28hz-kdeconnect-1.0.3/lib/libexec/kdeconnectd,-session,10d9d4dd64000149163288500000027620001_1491632900_57327
restartCommand3=/nix/store/dj9gwhvb0nnbi8zyhbl2r84i5d7m66la-powerdevil-5.8.6/lib/libexec/org_kde_powerdevil,-session,10d9d4dd64000149003121000000013800008_1491632900_57375
restartStyleHint1=0
restartStyleHint2=0
restartStyleHint3=0
userId1=yochai
userId2=yochai
userId3=yochai
wasWm1=true
wasWm2=false
wasWm3=false

There are nix store paths in this file! running
grep /nix/store ~/.config/*
it's not the only one.

I've removed ~/.config/ksmserverrc and power management seems to be working again. But the nix-store paths that are saved in the configuration files will cause problems again.

From System Settings, could you go to Help > About System Settings > Libraries and tell me which Frameworks and Qt versions are used? I do not understand why it says Qt 5.8 is an incompatible version, because you should be using Qt 5.8. 😕

Regarding the paths saved in configuration files: this has been a problem before, and it will continue to be a problem until either upstream stops doing bad things like that or we patch out every place in the source that does that. 🙄

I also have nix store paths in ~/.config/ksmserverrc. Haven't confirmed that removing them works around the problem yet, but seems very likely.

Would an approach like I took in #20806 help here?

The libraries tab:

KDE Frameworks 5.32.0
Qt 5.8.0 (built against 5.8.0)
The xcb windowing system

It seems to be working on 5.9.4 after moved the file.

ps aux | grep powerdevil
yochai    4155  0.0  0.1 663732 16908 ?        Sl   09:43   0:02 /nix/store/sy061mgy5bdr1938r6bylcxcyrrh1ysx-powerdevil-5.9.4/lib/libexec/org_kde_powerdevil
ls -l /run/current-system/sw/bin/systemsettings5
lrwxrwxrwx 1 root root 84 Jan  1  1970 /run/current-system/sw/bin/systemsettings5 -> /nix/store/0w3v1s6inyx1kb40aw0w2b1gsnk7xn1n-systemsettings-5.9.4/bin/systemsettings5

I also have nix store paths in ~/.config/ksmserverrc. Haven't confirmed that removing them works around the problem yet, but seems very likely.

Would an approach like I took in #20806 help here?

You mean pointing Plasma to a symlink? I doubt it would help because we already have to patch Plasma to resolve symlinks. I fear the resolved path would still be saved in your configuration files.

Okay. Well, mv -iv ~/.config/ksmserverrc ~/.config/ksmserverrc.old-nix-store-paths (while logged in to a console (non-kde) session) fixed the problem for me too. Thanks!

Im getting the same error message atm.

Running:
KDE Plasma 5.10.3
KDE Framework 5.34.0
Qt 5.9.0
Kernel 4.9.35

$ journalctl --user --since today | grep powerdevil
Jul 08 00:02:06 nixos xsession[804]: ksmserver: startKilling: client  "/nix/store/q9bp0za2aa67j5vji9g5wva3m1mi1l56-powerdevil-5.9.5/lib/libexec/org_kde_powerdevil" ( 10e169786f000149738273300000145910008 )
Jul 08 00:02:06 nixos xsession[804]: powerdevil: Core unloading
Jul 08 00:02:06 nixos xsession[804]: 7f84a093b000-7f84a094d000 r-xp 00000000 fe:00 1713408                    /nix/store/nj58y1hxb9smqwz9vfh38msxqhncmacy-plasma-workspace-5.10.3-bin/lib/qt-5.9/plugins/krunner_powerdevil.so
Jul 08 00:02:06 nixos xsession[804]: 4a094d000-7f84a0b4d000 ---p 00012000 fe:00 1713408                    /nix/store/nj58y1hxb9smqwz9vfh38msxqhncmacy-plasma-workspace-5.10.3-bin/lib/qt-5.9/plugins/krunner_powerdevil.so
Jul 08 00:02:06 nixos xsession[804]: 7f84a0b4d000-7f84a0b4e000 r--p 00012000 fe:00 1713408                    /nix/store/nj58y1hxb9smqwz9vfh38msxqhncmacy-plasma-workspace-5.10.3-bin/lib/qt-5.9/plugins/krunner_powerdevil.so
Jul 08 00:02:06 nixos xsession[804]: 7f84a0b4e000-7f84a0b4f000 rw-p 00013000 fe:00 1713408                    /nix/store/nj58y1hxb9smqwz9vfh38msxqhncmacy-plasma-workspace-5.10.3-bin/lib/qt-5.9/plugins/krunner_powerdevil.so
Jul 08 08:45:19 nixos xsession[774]: kscreen.kded: PowerDevil SuspendSession action not available!
Jul 08 08:45:20 nixos xsession[774]: ksmserver: Starting autostart service  "/run/current-system/sw/etc/xdg/autostart/powerdevil.desktop"
Jul 08 08:45:20 nixos xsession[774]: powerdevil: "The shared library was not found."
Jul 08 08:45:20 nixos xsession[774]: powerdevil: KDE Power Management System init failed!
Jul 08 08:45:20 nixos xsession[774]: ksmserver: autostart service ("/nix/store/d8nm0vlsvgdzw06ipp8hc47wpx3l8bmr-powerdevil-5.10.3/lib/libexec/org_kde_powerdevil") finished with exit code  0

It's happening again for me as well. I'm getting the same error as @thall. Removing kmsserverrc does not solve the problem for me.

KDE Plasma 5.10.3
KDE Framework 5.34.0
Qt 5.9.0

Hm, it happened for me as well recently, when updating from roughly 0d4431cf to 05aa2a58 (tracking channels/nixos-unstable), and mv -iv ~/.config/ksmserverrc ~/.config/ksmserverrc.old-nix-store-paths was enough to fix it.

Removing kmsserverrc does not solve the problem for me.

If the file is not too large, could you paste here what is in that file?

Here's the regen'ed ksmserverrc:

[General]
screenCount=1

[LegacySession: saved at previous logout]
count=0

[Session: saved at previous logout]
clientId1=1016616713d139000149201963200000019770007
clientId2=1016616713d139000149989849800000011240001
clientId3=1016616713d139000149669786100000011540066
clientId4=1016616713d139000149688842600000011670062
clientId5=1016616713d139000149747324100000011310007
clientId6=1016616713d139000149990300700000043820008
clientId7=1016616713d139000149990346500000043820010
clientId8=1016616713d139000149992053900000043820019
count=8
discardCommand1[$e]=rm,$HOME/.config/session/kwin_1016616713d139000149201963200000019770007_1499921072_204041
discardCommand6[$e]=rm,$HOME/.config/session/systemsettings_1016616713d139000149990300700000043820008_1499921071_967431
discardCommand7[$e]=rm,$HOME/.config/session/dolphin_1016616713d139000149990346500000043820010_1499921071_968821
discardCommand8[$e]=rm,$HOME/.config/session/dolphin_1016616713d139000149992053900000043820019_1499921072_24785
program1=kwin_x11
program2=/nix/store/lb5ivz2pq9jfqxji09066k3x34k18c0d-kdeconnect-1.0.3/lib/libexec/kdeconnectd
program3=/run/current-system/sw/bin/keepassxc
program4=/run/current-system/sw/bin/yakuake
program5=/nix/store/3smaq4afn5hvir4bqiw9s26db09mlynz-powerdevil-5.9.5/lib/libexec/org_kde_powerdevil
program6=/run/current-system/sw/bin/systemsettings5
program7=/run/current-system/sw/bin/dolphin
program8=/run/current-system/sw/bin/dolphin
restartCommand1=kwin_x11,-session,1016616713d139000149201963200000019770007_1499921072_204041
restartCommand2=/nix/store/lb5ivz2pq9jfqxji09066k3x34k18c0d-kdeconnect-1.0.3/lib/libexec/kdeconnectd,-session,1016616713d139000149989849800000011240001_1499921071_968090
restartCommand3=/run/current-system/sw/bin/keepassxc,-session,1016616713d139000149669786100000011540066_1499921071_968681
restartCommand4=/run/current-system/sw/bin/yakuake,-session,1016616713d139000149688842600000011670062_1499921071_967253,-name,yakuake
restartCommand5=/nix/store/3smaq4afn5hvir4bqiw9s26db09mlynz-powerdevil-5.9.5/lib/libexec/org_kde_powerdevil,-session,1016616713d139000149747324100000011310007_1499921071_967487
restartCommand6=/run/current-system/sw/bin/systemsettings5,-session,1016616713d139000149990300700000043820008_1499921071_967431
restartCommand7=/run/current-system/sw/bin/dolphin,-session,1016616713d139000149990346500000043820010_1499921071_968821
restartCommand8=/run/current-system/sw/bin/dolphin,-session,1016616713d139000149992053900000043820019_1499921072_24785
restartStyleHint1=0
restartStyleHint2=0
restartStyleHint3=0
restartStyleHint4=0
restartStyleHint5=0
restartStyleHint6=0
restartStyleHint7=0
restartStyleHint8=0
userId1=bill
userId2=bill
userId3=bill
userId4=bill
userId5=bill
userId6=bill
userId7=bill
userId8=bill
wasWm1=true
wasWm2=false
wasWm3=false
wasWm4=false
wasWm5=false
wasWm6=false
wasWm7=false
wasWm8=false

Thanks!

One way to mitigate this temporarily would be to disable session saving. In System Settings > Startup and Shutdown > Desktop Session choose Start with an empty session under On Login.

It seems that most of the saved programs have paths in /run/current-system/sw/ which is good. The only offenders seem to be powerdevil and kdeconnect. I wonder if this is due to their being started by D-Bus. Their service files may need to be changed; I will investigate that.

Thanks for your tip Thomas, my laptop is back in business!

And thanks for looking into this!

On Thu, Jul 13, 2017 at 4:55 AM Thomas Tuegel notifications@github.com
wrote:

Thanks!

One way to mitigate this temporarily would be to disable session saving.
In System Settings > Startup and Shutdown > Desktop Session choose Start
with an empty session under On Login.

It seems that most of the saved programs have paths in
/run/current-system/sw/ which is good. The only offenders seem to be
powerdevil and kdeconnect. I wonder if this is due to their being started
by D-Bus. Their service files may need to be changed; I will investigate
that.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/NixOS/nixpkgs/issues/24563#issuecomment-315056605,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AO8LK7zYKBfywNXaQAxt6pUTabScrC67ks5sNgXBgaJpZM4Mw0Ir
.

@jerith666 Can you tell me how to log in to such a console session? (Sorry if this is a stupid question)

Press Ctrl+Alt+F1 to switch to a text console, then when you're done press Ctrl F7 to get back to the GUI login prompt. See https://en.m.wikipedia.org/wiki/Virtual_console for more.

I just upgraded from 17.09 stable to 18.03 stable and ran aground this bug as well.

Seems to work now again on nixos-18.03.132217.c56ebaba1b0

@ttuegel, further to your comment:

I wonder if this is due to their being started by D-Bus.

I have KDE running here with most of the services being systemd user services and some of those spawned by dbus (instead of having dbus run the binaries directly):

Unit kde.slice (/user.slice/user-1000.slice/[email protected]/kde.slice):
├─xembedsniproxy.service
│ └─1716 /nix/store/w8ll8zid6x6rdfk9s59l7l79nz0q25ik-plasma-workspace-5.12.4-bin/bin/xembedsniproxy
├─dbus-org.kde.kdeconnect.service
│ └─2724 /nix/store/q9w1wxmxwhdmcha86s1zadj2anz8r7zr-kdeconnect-1.3.0/lib/libexec/kdeconnectd
├─baloo.service
│ └─6808 /nix/store/cn2j812lfzx6caihjwlpj6bda2g7r2g6-baloo-5.45.0-bin/bin/baloo_file
├─kgpg.service
│ └─2592 /nix/store/kvyaw19zi7y8myj1fkl39hraa0vi911s-kgpg-18.04.0/bin/kgpg
├─kwin.service
│ └─2562 /nix/store/lmc5hniprbncvf4p48z26krvcpnakr73-kwin-5.12.4-bin/bin/kwin_x11 --replace
├─plasmashell.service
│ └─6963 /nix/store/w8ll8zid6x6rdfk9s59l7l79nz0q25ik-plasma-workspace-5.12.4-bin/bin/plasmashell
└─powerdevil.service
  └─2573 /nix/store/psg1gm7lr1vsihx013k3bym1wk5in2r5-powerdevil-5.12.4/lib/libexec/org_kde_powerdevil

This isn't how upstream does it though so would you be willing to accept PRs going in that direction? That would make this issue moot.

This isn't how upstream does it though so would you be willing to accept PRs going in that direction? That would make this issue moot.

Yes, I think we could go in that direction. IIUC, upstream wants to be headed that way anyway.

I had a look for the place where the 'Session' field from $HOME/.config/ksmserverrc is saved. This is done by code from plasma-desktop.

https://lxr.kde.org/search?_string=ksmserverrc

From there I do not understand how the [Session: saved at previous logout] entry is written.

GitHub search results: ksmserverrc and SESSION_PREVIOUS_LOGOUT ("saved at previous logout").

EDIT: And here's where the entries are written and what computes the program path.

EDIT2: removing ksmserverrc and disabling session restore worked for me :tada:

After upgrading to 18.09, I once again had to remove powerdevil entries from $HOME/.config/ksmserverrc. After that, power management worked fine.

After upgrading to 18.09, I once again had to remove powerdevil entries from $HOME/.config/ksmserverrc. After that, power management worked fine.

@vandenoever, could you be more specific here to help also those of us that are not so far technically advanced to work around this issue (at least until it gets fixed)? Much thanks in advance :)

@silverhook The file $HOME/.config/ksmserverrc can contain path to the /nix/store/. For example:

restartCommand1=/nix/store/wvym95h2mhg6gl8vppnnrh9vrb31yp41-powerdevil-5.13.4/lib/libexec/org_kde_powerdevil,-session,1078323730000153736744200000010510008_1539681578_14591

When you upgrade powerdevil, that file is not automatically updated. You can fix the problem by removing those lines from that file.
You might have to be logged out of Plasma when you do so because that file is written when you log out.

This is rearing its ugly head again.

  • system: "x86_64-linux"
  • host os: Linux 4.20.2, NixOS, 19.03pre166366.22b7449aacb (Koi)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.2
  • channels(root): "nixos-19.03pre166366.22b7449aacb"
  • channels(bill): "home-manager"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

I find the easiest workaround to be the one @ttuegel posted. After disabling session restore and restarting a KDE session, you can then re-enable session restore, and everything will behave just like before.

Hello, I'm a bot and I thank you in the name of the community for opening this issue.

To help our human contributors focus on the most-relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.

The community would appreciate your effort in checking if the issue is still valid. If it isn't, please close it.

If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me". If you'd like it to get more attention, you can ask for help by searching for maintainers and people that previously touched related code and @ mention them in a comment. You can use Git blame or GitHub's web interface on the relevant files to find them.

Lastly, you can always ask for help at our Discourse Forum or at #nixos' IRC channel.

Power Management is working fine here on both desktops and laptops. Also there are no /nix/store references in ~/.config/ksmserverrc.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

domenkozar picture domenkozar  Â·  3Comments

ghost picture ghost  Â·  3Comments

ob7 picture ob7  Â·  3Comments

retrry picture retrry  Â·  3Comments

yawnt picture yawnt  Â·  3Comments