Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Failed to connect to user bus
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3635

PostPosted: Sun Dec 20, 2020 11:38 am    Post subject: [SOLVED] Failed to connect to user bus Reply with quote

On executing sway I am getting this error:
Code:
WARNING: Kernel has no file descriptor comparison support: Function not implemented
2020-12-20 10:35:52 - [swaybg-1.0/main.c:299] Found config * for output eDP-1 (Unknown 0x4C48 0x00000000)

Any help is highly appreciated


Last edited by charles17 on Mon Jan 04, 2021 5:34 pm; edited 2 times in total
Back to top
View user's profile Send private message
AlexJGreen
Tux's lil' helper
Tux's lil' helper


Joined: 19 Sep 2018
Posts: 149

PostPosted: Sun Dec 20, 2020 11:40 am    Post subject: Reply with quote

_

Last edited by AlexJGreen on Mon Dec 28, 2020 2:55 am; edited 1 time in total
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3635

PostPosted: Wed Dec 30, 2020 8:23 am    Post subject: Reply with quote

Also stopping sway makes trouble here.

On start I get:
Code:
2020-12-29 13:01:06 - [swaybg-1.0/main.c:299] Found config * for output eDP-1 (Unknown 0x4C48 0x00000000)
00:00:00.008 [swaybar/tray/tray.c:42] Failed to connect to user bus: No such file or directory

Then when I try to end sway using SUPER+SHIFT+c I get:
Code:
2020-12-29 13:02:12 - [swaybg-1.0/main.c:299] Found config * for output eDP-1 (Unknown 0x4C48 0x00000000)
00:00:00.007 [swaybar/tray/tray.c:42] Failed to connect to user bus: No such file or directory
00:01:06.582 [sway/ipc-server.c:208] IPC Client socket error, removing client

Using killall sway gives me:
Code:
00:01:24.002 [ERROR] [backend/drm/atomic.c:36] eDP-1: Atomic commit failed (modeset): Permission denied

So what am I missing?
Back to top
View user's profile Send private message
GDH-gentoo
l33t
l33t


Joined: 20 Jul 2019
Posts: 624
Location: South America

PostPosted: Wed Dec 30, 2020 3:56 pm    Post subject: Reply with quote

charles17 wrote:
So what am I missing?

For these two at least, probably D-Bus. More precisely, the login session message bus.

charles17 wrote:
On start I get:
Code:
...
00:00:00.008 [swaybar/tray/tray.c:42] Failed to connect to user bus: No such file or directory

Then when I try to end sway using SUPER+SHIFT+c I get:
Code:
...
00:00:00.007 [swaybar/tray/tray.c:42] Failed to connect to user bus: No such file or directory
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3635

PostPosted: Thu Dec 31, 2020 7:15 am    Post subject: Reply with quote

Ah, thanks.
On that system I got dbus running, started as a dependency of elogind. So I checked the dbus wiki article.

Running dbus-monitor tells me:
dbus-monitor --system :
signal time=1609398039.791159 sender=org.freedesktop.DBus -> destination=:1.8 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.8"
signal time=1609398039.791186 sender=org.freedesktop.DBus -> destination=:1.8 serial=4 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
   string ":1.8"

dbus-monitor --session :
Failed to open connection to session bus: Using X11 for dbus-daemon autolaunch was disabled at compile time, set your DBUS_SESSION_BUS_ADDRESS instead

So, what would I have to do to set my DBUS_SESSION_BUS_ADDRESS?
Back to top
View user's profile Send private message
GDH-gentoo
l33t
l33t


Joined: 20 Jul 2019
Posts: 624
Location: South America

PostPosted: Thu Dec 31, 2020 3:32 pm    Post subject: Reply with quote

charles17 wrote:
So, what would I have to do to set my DBUS_SESSION_BUS_ADDRESS?

How are you starting sway? From a shell after logging in on a tty? Try:
Code:
$ dbus-run-session sway <sway arguments...>
Given that you have elogind installed, you can then check the session bus from a GUI terminal using busctl --user.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3635

PostPosted: Thu Dec 31, 2020 6:13 pm    Post subject: Reply with quote

GDH-gentoo wrote:
How are you starting sway? From a shell after logging in on a tty?

Yes, but without dbus-run-session. It is a system with system wide USE="dbus elogind -X" and I am trying to run sway from a tty after login without a session manager.


GDH-gentoo wrote:
Try:
Code:
$ dbus-run-session sway <sway arguments...>
Given that you have elogind installed, you can then check the session bus from a GUI terminal using busctl --user.

This way I also get the --session
dbus-monitor --session :
signal time=1609436334.612050 sender=org.freedesktop.DBus -> destination=:1.3 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.3"
signal time=1609436334.612201 sender=org.freedesktop.DBus -> destination=:1.3 serial=4 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
   string ":1.3
busctl --user :
NAME                                     PID PROCESS     USER      CONNECTION UNIT SESSION DESCRIPTION
:1.0                                    3130 swaybar     charles17 :1.0       1    -       -         
:1.1                                    3286 busctl      charles17 :1.1       1    -       -         
org.freedesktop.DBus                    3116 dbus-daemon charles17 -          1    -       -         
org.freedesktop.StatusNotifierHost-3130 3130 swaybar     charles17 :1.0       1    -       -         
org.freedesktop.StatusNotifierWatcher   3130 swaybar     charles17 :1.0       1    -       -         
org.kde.StatusNotifierHost-3130         3130 swaybar     charles17 :1.0       1    -       -         
org.kde.StatusNotifierWatcher           3130 swaybar     charles17 :1.0       1    -       -         


But still I cannot find anything looking like a tray, and ...
starting sway :
2020-12-31 18:34:04 - [swaybg-1.0/main.c:299] Found config * for output eDP-1 (Unknown 0x4C48 0x00000000)
00:00:00.024 [swaybar/tray/icon.c:348] Warning: no icon themes loaded
stopping sway using SUPER+SHIFT+c :
2020-12-31 18:15:30 - [swaybg-1.0/main.c:299] Found config * for output eDP-1 (Unknown 0x4C48 0x00000000)
00:00:00.009 [swaybar/tray/icon.c:348] Warning: no icon themes loaded
00:00:40.467 [sway/ipc-server.c:208] IPC Client socket error, removing client

It would not stop until I did a killall sway.
Does it really need an icon theme for showing the tray?
And how to solve that IPC Client socket error?
And why is Unknown 0x4C48?
Back to top
View user's profile Send private message
GDH-gentoo
l33t
l33t


Joined: 20 Jul 2019
Posts: 624
Location: South America

PostPosted: Thu Dec 31, 2020 9:41 pm    Post subject: Reply with quote

I'm not familiar with sway, but:
  • The "Found config * for output" message is coming from swaybg, not sway itself, it seems to be just a debugging message, and "Unknown 0x4C48 0x00000000" seems to be the description returned by the Wayland compositor for output eDP-1.
  • The "IPC Client socket error, removing client" message means that sway is getting an error when reading from a connection made to its socket (apparently $XDG_RUNTIME_DIR/sway-ipc.*.sock by default). It might be the reason why it doesn't stop. Looking at the code from dev-libs/wayland, I would guess that the underlying cause is an error in an epoll_wait() system call. You could make tests using swaymsg to send commands to sway, e.g. swaymsg -t get_outputs or swaymsg exit (I think these are correct). You might get better clues using strace.
I don't know about the icon theme thing.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3635

PostPosted: Mon Jan 04, 2021 9:24 am    Post subject: Reply with quote

One step further. I've installed dev-util/strace and run strace -o /tmp/sway_strace dbus-run-session sway
Could you pls help me analyze the output? Is there anything wrong?

Code:
execve("/usr/bin/dbus-run-session", ["dbus-run-session", "sway"], 0x7ffced9e4ff8 /* 30 vars */) = 0
brk(NULL)                               = 0x5624c6f81000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=33289, ...}) = 0
mmap(NULL, 33289, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fb3c8045000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib64/libdbus-1.so.3", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\354\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=292416, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb3c8043000
mmap(NULL, 295152, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fb3c7ffa000
mprotect(0x7fb3c8007000, 233472, PROT_NONE) = 0
mmap(0x7fb3c8007000, 163840, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xd000) = 0x7fb3c8007000
mmap(0x7fb3c802f000, 65536, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x35000) = 0x7fb3c802f000
mmap(0x7fb3c8040000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x45000) = 0x7fb3c8040000
mmap(0x7fb3c8042000, 240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fb3c8042000
close(3)                                = 0
openat(AT_FDCWD, "/lib64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360k\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=148000, ...}) = 0
mmap(NULL, 128088, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fb3c7fda000
mmap(0x7fb3c7fe0000, 61440, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7fb3c7fe0000
mmap(0x7fb3c7fef000, 20480, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15000) = 0x7fb3c7fef000
mmap(0x7fb3c7ff4000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19000) = 0x7fb3c7ff4000
mmap(0x7fb3c7ff6000, 13400, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fb3c7ff6000
close(3)                                = 0
openat(AT_FDCWD, "/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200?\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1802320, ...}) = 0
mmap(NULL, 1815760, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fb3c7e1e000
mprotect(0x7fb3c7e40000, 1638400, PROT_NONE) = 0
mmap(0x7fb3c7e40000, 1327104, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x22000) = 0x7fb3c7e40000
mmap(0x7fb3c7f84000, 307200, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x166000) = 0x7fb3c7f84000
mmap(0x7fb3c7fd0000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b1000) = 0x7fb3c7fd0000
mmap(0x7fb3c7fd6000, 13520, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fb3c7fd6000
close(3)                                = 0
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb3c7e1b000
arch_prctl(ARCH_SET_FS, 0x7fb3c7e1b740) = 0
mprotect(0x7fb3c7fd0000, 16384, PROT_READ) = 0
mprotect(0x7fb3c7ff4000, 4096, PROT_READ) = 0
mprotect(0x7fb3c8040000, 4096, PROT_READ) = 0
mprotect(0x5624c5370000, 4096, PROT_READ) = 0
mprotect(0x7fb3c8078000, 4096, PROT_READ) = 0
munmap(0x7fb3c8045000, 33289)           = 0
set_tid_address(0x7fb3c7e1ba10)         = 8266
set_robust_list(0x7fb3c7e1ba20, 24)     = 0
rt_sigaction(SIGRTMIN, {sa_handler=0x7fb3c7fe0650, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x7fb3c7fec7e0}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x7fb3c7fe06f0, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7fb3c7fec7e0}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
pipe([3, 4])                            = 0
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fb3c7e1ba10) = 8267
close(4)                                = 0
read(3, "unix:abstract=/tmp/dbus-bhG81Uji"..., 511) = 73
read(3, "", 438)                        = 0
close(3)                                = 0
brk(NULL)                               = 0x5624c6f81000
brk(0x5624c6fa2000)                     = 0x5624c6fa2000
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fb3c7e1ba10) = 8268
wait4(-1,
Back to top
View user's profile Send private message
GDH-gentoo
l33t
l33t


Joined: 20 Jul 2019
Posts: 624
Location: South America

PostPosted: Mon Jan 04, 2021 4:55 pm    Post subject: Reply with quote

I'd recommend that you try swaymsg -t get_outputs and swaymsg exit to see if they succeed. So that you can see if there's a general problem with communcating with sway using its socket.

charles17 wrote:
One step further. I've installed dev-util/strace and run strace -o /tmp/sway_strace dbus-run-session sway

That way you are tracing dbus-run-session rather than sway. Do dbus-run-session strace -o /tmp/sway_strace sway. The intresting part should be the epoll*() calls.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3635

PostPosted: Mon Jan 04, 2021 5:21 pm    Post subject: Reply with quote

GDH-gentoo wrote:
I'd recommend that you try swaymsg -t get_outputs and swaymsg exit to see if they succeed. So that you can see if there's a general problem with communcating with sway using its socket.

charles17 wrote:
One step further. I've installed dev-util/strace and run strace -o /tmp/sway_strace dbus-run-session sway

That way you are tracing dbus-run-session rather than sway. Do dbus-run-session strace -o /tmp/sway_strace sway. The intresting part should be the epoll*() calls.

Yes. swaymsg -t get_outputs and swaymsg exit both do work. And my main problem was not properly reading the docs. Cleaning my glasses and reading again I've learned I should use $mod+Shift+e to exit sway. This is how it works, now I can exit sway the regular way.
Thanks for your patience in teaching me about dbus and strace. Guess I can use it soon.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3635

PostPosted: Sun Jan 24, 2021 10:58 am    Post subject: Reply with quote

Updated the Executing sway and Troubleshooting sections.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum