You are not logged in.

#1 2013-03-08 22:08:25

scummos
Member
Registered: 2013-03-08
Posts: 14

dbus errors after system has been running for a while

Hi!

At first, my system works okay, but after a while I start getting this error message from every GUI application I try to start:

No protocol specified
Cannot connect to X server :0.0

and application startup fails. I was unable to find a specific action which causes the behavior, but it is pretty reproducable after the system has been running for about an hour.

The "no protocol specified" is generated by dbus-launch. I checked that the dbus server is running... apparently it is (according to systemd and top). I tried to restart it... no luck. I tried "xhost +" -- nothing.

The error occurs for all applications which try to communicate with X, but also stuff that needs dbus, like qdbus -- so I guess it's a problem with dbus. But, what kind of problem? What could I try to find the reason for this behaviour? Also, what does the error message even mean, "no protocol specified"?

Greetings,
Sven

Edit: The error always occurs after the system has been put in standby mode (with pm-suspend).

Last edited by scummos (2013-03-10 15:50:41)

Offline

#2 2013-03-11 14:14:52

scummos
Member
Registered: 2013-03-08
Posts: 14

Re: dbus errors after system has been running for a while

The problem persists even after a reinstallation of the base system (I kept my home directory, tough).
Restarting the X server makes everything work again.

I'm really clueless...

Offline

#3 2013-03-23 06:09:59

ant32
Member
Registered: 2013-03-23
Posts: 24

Re: dbus errors after system has been running for a while

I have been having the same problem on my laptop, and at my computer at work.
I would estimate the problem started about 2 weeks ago.

xxxxx@localhost ~ :( $ firefox
No protocol specified
No protocol specified
Error: cannot open display: :0
xxxxx@localhost ~ :( $ rekonq
QDBusConnection: session D-Bus connection created before 
QCoreApplication. Application may misbehave.
QDBusConnection: session D-Bus connection created before 
QCoreApplication. Application may misbehave.
No protocol specified
rekonq: cannot connect to X server :0
unnamed app(27810): Communication problem with  "rekonq" , it probably 
crashed. 
Error message was:  "org.freedesktop.DBus.Error.NoReply" : " "Message 
did not receive a reply (timeout by message bus)" "

I was able to make this repeat as often as I wantd by starting vpn connection.
After I open vpn I can not open any applications.
I tried deleting all files and folders in my home directory that started with a "." but nothing helps.

Offline

#4 2013-04-15 09:24:53

scummos
Member
Registered: 2013-03-08
Posts: 14

Re: dbus errors after system has been running for a while

Good to know I'm not the only one with this problem. I can often reproduce it by putting my computer into standby mode (pm-suspend) and wake it up again, but not reliably. I didn't go as far as removing all dot files from my home directory, since I have lots of applications carefully configured and I'd rather not redo this configuration (nor work without it for a period long enough to be sure it's because of that), but if you did it already then I don't see a point in trying anyways...
What I did do was moving my whole home directory and just copying back a few selected dot-files which I considered non-critical (such as my IRC client config file), and that didn't help. So I think we can rule out the possibility that this issue is related to some user-owned program's configuration (which would of course be a bug on the system (as opposed to "user") side too, since a user program must not crash dbus-daemon in such a way).

So, since reinstalling the system itself doesn't help, and removing user configuration doesn't help either, what might cause this problem? I think the most likely thing is a regression in some software... but which one? Most likely candidates are of course dbus-daemon and X11, both beasts to debug.
I'll try to do further debugging and I'll let you know if I find out anything.

Cheers,
Sven

Last edited by scummos (2013-04-15 09:33:13)

Offline

#5 2013-04-15 16:57:01

ant32
Member
Registered: 2013-03-23
Posts: 24

Re: dbus errors after system has been running for a while

I think my problems stopped after upgrading KDE to 4.10.2

Offline

#6 2013-04-16 17:38:49

scummos
Member
Registered: 2013-03-08
Posts: 14

Re: dbus errors after system has been running for a while

Yes, I'm beginning to think some KDE app is at fault too. I have no idea which one though. I'm using 4.10.2 too but I still have the same problem.

Here's an extract of a strace log when starting xterm:

socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC, 0) = 3
connect(3, {sa_family=AF_FILE, sun_path=@"/tmp/.X11-unix/X0"}, 20) = 0
getpeername(3, {sa_family=AF_FILE, sun_path=@"/tmp/.X11-unix/X0"}, [20]) = 0
uname({sys="Linux", node="localhost.localdomain", ...}) = 0
access("/home/sven/.Xauthority", R_OK)  = 0
open("/home/sven/.Xauthority", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0600, st_size=54, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc4f604b000
read(4, "\1\0\0\tlocalhost\0\0010\0\22MIT-MAGIC-COOK"..., 4096) = 54
read(4, "", 4096)                       = 0
close(4)                                = 0
munmap(0x7fc4f604b000, 4096)            = 0
fcntl(3, F_GETFL)                       = 0x2 (flags O_RDWR)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK)    = 0
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
poll([{fd=3, events=POLLIN|POLLOUT}], 1, 4294967295) = 1 ([{fd=3, revents=POLLOUT}])
writev(3, [{"l\0\v\0\0\0\0\0\0\0\0\0", 12}, {"", 0}], 2) = 12
recvfrom(3, 0x15c8950, 8, 0, 0, 0)      = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}], 1, 4294967295) = 1 ([{fd=3, revents=POLLIN|POLLHUP}])
recvfrom(3, "\0\26\v\0\0\0\6\0", 8, 0, NULL, NULL) = 8
recvfrom(3, "No protocol specified\n\0\0", 24, 0, NULL, NULL) = 24
write(2, "No protocol specified\n", 22No protocol specified
) = 22
shutdown(3, SHUT_RDWR)                  = 0
close(3)                                = 0
open("/usr/lib/X11/XtErrorDB", O_RDONLY) = -1 ENOENT (No such file or directory)
getuid()                                = 1000
geteuid()                               = 1000
getuid()                                = 1000
write(2, "xterm: ", 7xterm: )                  = 7
write(2, "Xt error: Can't open display: :0"..., 33Xt error: Can't open display: :0
) = 33
exit_group(1)                           = ?
+++ exited with 1 +++

(I played around with xauthority a bit already so that might be off)
The error message is read from the socket which it uses to connect to X... I think it's probably a permission problem, some program revoked my permissions to access X, and I can't even put it back, because I have no user which is allowed to talk to X (xhost + always fails with the same error). But which program that is or how to track it down... no idea sad

Cheers,
Sven

Offline

#7 2013-04-17 12:58:39

scummos
Member
Registered: 2013-03-08
Posts: 14

Re: dbus errors after system has been running for a while

Hm, no, the xauth files are not being touched.

Additionally to that problem, I now start getting freezes when it occured and I restart X.

If I can't solve this issue soon-ish I fear I'll have to switch to another distribution, since it's really unbearable. sad

Cheers,
Sven

Offline

#8 2013-05-12 10:39:57

scummos
Member
Registered: 2013-03-08
Posts: 14

Re: dbus errors after system has been running for a while

I finally found the reason I think.

After startup, the hostname is "localhost", and the full hostname ("hotname -f") ist "localhost.localdomain". When the error occurs, the full hostname is still "localhost.localdomain", but the hostname is also "localhost.localdomain". Invoking "hostname localhost" fixes the problem. So, apparently, some program does "hostname localhost.localdomain" which causes the problem. I have no idea which program this is, but at least I can resolve the problem now without restarting my whole environment...

Cheers,
Sven

Offline

#9 2013-05-12 14:38:08

ant32
Member
Registered: 2013-03-23
Posts: 24

Re: dbus errors after system has been running for a while

Offline

#10 2013-05-12 15:04:58

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: dbus errors after system has been running for a while

ant32 wrote:

QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.

Fedora shuts up that tedious error, with qt-everywhere-opensource-src-4.8.3-qdbusconnection_no_debug.patch for qt:

+#ifndef QT_NO_DEBUG
             qWarning("QDBusConnection: %s D-Bus connection created before QCore Application. Application may misbehave.",
                      type == SessionBus ? "session" : type == SystemBus ? "system" : "generic");
+#endif

Offline

#11 2013-05-17 20:13:04

scummos
Member
Registered: 2013-03-08
Posts: 14

Re: dbus errors after system has been running for a while

ant32 wrote:

Yes. Re-running that command fixes it for the moment, but after a while the wrong hostname gets activated again.

Any ideas how I could search for the application causing it?

Offline

#12 2013-05-18 19:36:26

ant32
Member
Registered: 2013-03-23
Posts: 24

Re: dbus errors after system has been running for a while

if the file is being changed, you could maybe use inotify-tools http://linux.die.net/man/1/inotifywatch
or write a script that alerts you when it has been changed could help? you'll need to install inotify-tools

#!/bin/sh
while inotifywait -e modify /etc/hostname; do
    kdialog --msgbox "hostname has changed :("
done

I'm sorry I don't think I can help you. Is reinstalling maybe an option?

Offline

#13 2013-05-19 10:48:04

scummos
Member
Registered: 2013-03-08
Posts: 14

Re: dbus errors after system has been running for a while

ant32 wrote:

if the file is being changed, you could maybe use inotify-tools http://linux.die.net/man/1/inotifywatch

I think I checked that before, the file isn't being modified. It's a good idea neverthereless, I'll try it.

ant32 wrote:

I'm sorry I don't think I can help you. Is reinstalling maybe an option?

Not even that -- I tried re-installing the core system already, the problem persisted.

What I'll try too is just setting the hostname to "localhost.localdomain" at boot, it's stupid but it might work wink

Cheers,
Sven

Offline

#14 2013-05-22 10:30:42

scummos
Member
Registered: 2013-03-08
Posts: 14

Re: dbus errors after system has been running for a while

Surely not the correct solution, but setting the hostname to "localhost.localdomain" always fixes the problem.
Thanks for helping!

Offline

Board footer

Powered by FluxBB