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

Warning message "D-Bus socket address not found", even if command itself works #180

Closed
pvx- opened this issue Aug 9, 2020 · 5 comments
Closed
Assignees
Labels

Comments

@pvx-
Copy link

pvx- commented Aug 9, 2020

Related to #107 - I was affected by the problem there and blacklisted all 2.x versions as result; now I tested 2.2.1 (latest at this time) and it works OK, it just shows "D-Bus socket address not found, unable to list player names" warning every time (every single command I tested works and displays this message).

Not a big problem :), but hopefully can be fixed easily. Small shell-example (playerctl-0.6.1 is version 0.6.1 binary I was using until today):

$ playerctl -l

(playerctl:4290): playerctl-WARNING **: 11:34:11.230: D-Bus socket address not found, unable to list player names
mpv
$ playerctl status

(playerctl:4318): playerctl-WARNING **: 11:34:24.473: D-Bus socket address not found, unable to list player names
Paused
$ playerctl-0.6.1 -l
Could not connect: No such file or directory
$ playerctl-0.6.1 status
Paused
$ dbus-send --session --dest=org.freedesktop.DBus --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListNames
method return time=1596965682.488785 sender=org.freedesktop.DBus -> destination=:1.41834 serial=3 reply_serial=2
   array [
      string "org.freedesktop.DBus"
      string ":1.41834"
      string "org.mpris.MediaPlayer2.mpv"
      string ":1.41829"
   ]

If you need any other info, just let me know (including code modification and recompile).

@pvx- pvx- added the bug label Aug 9, 2020
@acrisci
Copy link
Member

acrisci commented Aug 9, 2020

It's probably for the system bus address. You might have an env I'm not anticipating. Maybe the warning is too much.

Set G_MESSAGES_DEBUG=playerctl to get a log and it might give me more info.

@pvx-
Copy link
Author

pvx- commented Aug 9, 2020

There doesn't seem to be much, but maybe you'll see something I do not :) (btw. the blank line before warning is there every time, I didn't add that):

$ G_MESSAGES_DEBUG=playerctl playerctl -l
(process:13724): playerctl-DEBUG: 23:20:33.361: playerctl version 2.2.1
(playerctl:13724): playerctl-DEBUG: 23:20:33.364: Getting list of player names from D-Bus

(playerctl:13724): playerctl-WARNING **: 23:20:33.364: D-Bus socket address not found, unable to list player names
mpv
$ G_MESSAGES_DEBUG=playerctl playerctl status
(process:13740): playerctl-DEBUG: 23:20:45.153: playerctl version 2.2.1
(playerctl:13740): playerctl-DEBUG: 23:20:45.157: Getting list of player names from D-Bus

(playerctl:13740): playerctl-WARNING **: 23:20:45.157: D-Bus socket address not found, unable to list player names
(playerctl:13740): playerctl-DEBUG: 23:20:45.157: found player: mpv
(playerctl:13740): playerctl-DEBUG: 23:20:45.158: initializing player: mpv
(playerctl:13740): playerctl-DEBUG: 23:20:45.158: executing command status
Paused

@acrisci
Copy link
Member

acrisci commented Aug 9, 2020

The error indicates you either have an env variable called DBUS_SYSTEM_BUS_ADDRESS set to a nonexistent path or the default path does not exist. Try stat /var/run/dbus/system_bus_address. I've never seen someone with a session bus without a system bus so this is a weird situation.

Since neither bus type should actually be required, I think I'll change this to a debug message and maybe only fail if it doesn't connect to either.

@pvx-
Copy link
Author

pvx- commented Aug 9, 2020

I must start by saying that I have no idea about how dbus actually works and I use it only with playerctl to control mpv from scripts :).

The problem seems to be that I have dbus-daemon running only under my user, not as a system service. If I start the system service (dbus-daemon running as root), the warning disappears. When I stop it, it is back again :). Your "socket address" request probably works only with the system service, but should not be needed, if the action itself works with user-run dbus.

Btw. the file you mention doesn't exist on my system (Gentoo) even when the system service is running:

# stat /var/run/dbus/system_bus_address
stat: cannot stat '/var/run/dbus/system_bus_address': No such file or directory
# ls -l /var/run/dbus
total 0
srwxrwxrwx 1 root root 0 Aug 10 01:14 system_bus_socket

@acrisci
Copy link
Member

acrisci commented Nov 7, 2020

a1cfd4a

@acrisci acrisci closed this as completed Nov 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants