Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DBus-Error UnknownInterface on Manjaro Linux #4

Closed
StT191 opened this issue Oct 23, 2022 · 4 comments · Fixed by #5
Closed

DBus-Error UnknownInterface on Manjaro Linux #4

StT191 opened this issue Oct 23, 2022 · 4 comments · Fixed by #5

Comments

@StT191
Copy link

StT191 commented Oct 23, 2022

Running cargo test fails on my machine:

OS: Manjaro Linux 22.0.0 x86_64
Kernel: 6.0.2-2-MANJARO
Desktop: KDE Plasma 5.25.5

I get the following output:

---- tests::test_block_platform_agnostic stdout ----
thread 'tests::test_block_platform_agnostic' panicked at 'called `Result::unwrap()` on an `Err` value: 
DBus { 
    source: D-Bus error: No such interface 'org.freedesktop.PowerManagment.Inhibit' at object path 
        '/org/freedesktop/PowerManagement/Inhibit' (org.freedesktop.DBus.Error.UnknownInterface), 
    backtrace: Backtrace(()) 
}', src/lib.rs:41:24
@pevers
Copy link
Owner

pevers commented Nov 13, 2022

Hi @StT191 , thanks for your report!

Is the library working for you on KDE? It is hard for me to test this on Linux KDE as I'm using a M1 MacBook to compile and run everything. I used the Chromium source code as inspiration. But it seems there are some issues with Chromium screen locks and KDE as well.

Can you check if the D-Bus interface is actually there for your desktop?

I found some issues that might be related:

@StT191
Copy link
Author

StT191 commented Nov 19, 2022

Hi @pevers,
the D-Bus interface is definitively there. The reported error actually occurs at nosleep.stop(). I was also able to use your crate successfully for its intended purpose. I just ignore the errors on stop.

All the tests from the nosleep-nix sub-crate pass, except tests::test_start which fails with the same error.

I also recorded the dbus-monitor log during the test-run. It might help with debugging:

method call time=1668875736.161333 sender=:1.90 -> destination=org.freedesktop.DBus serial=1 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello
method return time=1668875736.161344 sender=org.freedesktop.DBus -> destination=:1.90 serial=1 reply_serial=1
   string ":1.90"
signal time=1668875736.161364 sender=org.freedesktop.DBus -> destination=(null destination) serial=129 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.90"
   string ""
   string ":1.90"
signal time=1668875736.161393 sender=org.freedesktop.DBus -> destination=:1.90 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.90"
method call time=1668875736.161768 sender=:1.90 -> destination=org.gnome.SessionManager serial=2 path=/org/gnome/SessionManager; interface=org.gnome.SessionManager; member=Inhibit
   string "org.powersaveblocker.app"
   uint32 0
   string "Power Save Blocker"
   uint32 12
error time=1668875736.161786 sender=org.freedesktop.DBus -> destination=:1.90 error_name=org.freedesktop.DBus.Error.ServiceUnknown reply_serial=2
   string "The name org.gnome.SessionManager was not provided by any .service files"
method call time=1668875736.161816 sender=:1.90 -> destination=org.freedesktop.ScreenSaver serial=3 path=/org/freedesktop/ScreenSaver; interface=org.freedesktop.ScreenSaver; member=Inhibit
   string "org.powersaveblocker.app"
   string "Power Save Blocker"
method call time=1668875736.162109 sender=:1.10 -> destination=org.kde.Solid.PowerManagement.PolicyAgent serial=149 path=/org/kde/Solid/PowerManagement/PolicyAgent; interface=org.kde.Solid.PowerManagement.PolicyAgent; member=AddInhibition
   uint32 4
   string "org.powersaveblocker.app"
   string "Power Save Blocker"
method call time=1668875736.162319 sender=:1.21 -> destination=org.freedesktop.DBus serial=228 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0=':1.10',arg2=''"
method return time=1668875736.162359 sender=:1.21 -> destination=:1.10 serial=229 reply_serial=149
   uint32 21
method call time=1668875736.162478 sender=:1.10 -> destination=org.freedesktop.DBus serial=150 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0=':1.90',arg2=''"
method return time=1668875736.162513 sender=:1.10 -> destination=:1.90 serial=151 reply_serial=3
   uint32 3558
method call time=1668875736.162625 sender=:1.90 -> destination=org.freedesktop.PowerManagement serial=4 path=/org/freedesktop/PowerManagement/Inhibit; interface=org.freedesktop.PowerManagement.Inhibit; member=Inhibit
   string "org.powersaveblocker.app"
   string "Power Save Blocker"
method call time=1668875736.162773 sender=:1.21 -> destination=org.freedesktop.DBus serial=230 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0=':1.90',arg2=''"
method return time=1668875736.162792 sender=:1.21 -> destination=:1.90 serial=231 reply_serial=4
   uint32 22
method call time=1668875736.463340 sender=:1.90 -> destination=org.freedesktop.ScreenSaver serial=5 path=/org/freedesktop/ScreenSaver; interface=org.freedesktop.ScreenSaver; member=UnInhibit
   uint32 3558
method call time=1668875736.464292 sender=:1.10 -> destination=org.kde.Solid.PowerManagement.PolicyAgent serial=152 path=/org/kde/Solid/PowerManagement/PolicyAgent; interface=org.kde.Solid.PowerManagement.PolicyAgent; member=ReleaseInhibition
   uint32 21
method return time=1668875736.464405 sender=:1.10 -> destination=:1.90 serial=153 reply_serial=5
method call time=1668875736.464823 sender=:1.90 -> destination=org.freedesktop.PowerManagement serial=6 path=/org/freedesktop/PowerManagement/Inhibit; interface=org.freedesktop.PowerManagment.Inhibit; member=UnInhibit
   uint32 22
method call time=1668875736.465008 sender=:1.21 -> destination=org.freedesktop.DBus serial=232 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RemoveMatch
   string "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0=':1.10',arg2=''"
method return time=1668875736.465110 sender=:1.21 -> destination=:1.10 serial=233 reply_serial=152
error time=1668875736.465270 sender=:1.21 -> destination=:1.90 error_name=org.freedesktop.DBus.Error.UnknownInterface reply_serial=6
   string "No such interface 'org.freedesktop.PowerManagment.Inhibit' at object path '/org/freedesktop/PowerManagement/Inhibit'"
signal time=1668875736.466872 sender=org.freedesktop.DBus -> destination=:1.90 serial=5 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
   string ":1.90"
signal time=1668875736.466994 sender=org.freedesktop.DBus -> destination=(null destination) serial=45 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.90"
   string ":1.90"
   string ""
method call time=1668875736.467137 sender=:1.21 -> destination=org.freedesktop.DBus serial=235 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RemoveMatch
   string "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0=':1.90',arg2=''"
method call time=1668875736.467179 sender=:1.10 -> destination=org.freedesktop.DBus serial=154 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RemoveMatch
   string "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0=':1.90',arg2=''"

@pevers
Copy link
Owner

pevers commented Nov 20, 2022

org.freedesktop.ScreenSaver

Hi @StT191 , that's very helpful!

I think I've spotted the mistake:

DBusAPI::FreeDesktopPowerApi => dbus::Message::call_with_args(
    "org.freedesktop.PowerManagement",
    "/org/freedesktop/PowerManagement/Inhibit",
    "org.freedesktop.PowerManagment.Inhibit",
    "UnInhibit",
    (handle,),
),

PowerManagment , doh . Took me a while to find the mistake haha. Thank you so much for your report and I'll file a PR to fix it.

@pevers
Copy link
Owner

pevers commented Nov 20, 2022

Hi @StT191 , I published a new version of the crate that should fix this. Thanks again for reporting this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants