dbus - ARM target - ERROR: Couldn't connect to session bus

Trilok Soni soni.trilok at gmail.com
Fri Feb 15 04:24:56 PST 2008


Hi All,

I am trying to run ARM cross-compiled libdbus and libdbus-glib based
application on ARM9 DaVinci based board.
These libraries are compiled with the following options under scratchbox.

libdbus configure options:

./configure --prefix=/usr --disable-xml-docs --disable-doxygen-docs
--without-x --localstatedir=/var --enable-verbose-mode

libdbus-glib configure options:

./configure --prefix=/usr --disable-doxygen-docs --localstatedir=/var
--with-test-socket-dir=/var
--with-introspect-xml=../dbus-bus-introspect.xml

I have created the "messagebus" UID and GID for system bus on board
filesystem. Configuration files like session.conf and system.conf
are in "/usr/etc/dbus-1" on filesystem.

I am first launching system-bus using following command

<from root user>
#export DBUG_VERBOSE=1
#dbus-daemon --system

#ps
<snip>
 1140 root        816 S   -sh
 1391 trilok      708 S   -sh
 1405 messageb    468 S   dbus-daemon --system
 1407 trilok      648 R   ps
<snip>

Now login into normal user "trilok" account to launch session bus.
#login trilok
<trilok># dbus-daemon --session --nofork --print-pid --print-address 0
<trilok># unix:path=/tmp/session_bus_socket,guid=9b99e59ebe05b5a27f22730000004f86
             1466
<trilok>#  ps
 1430 trilok      808 S   -sh
 1466 trilok      408 S   dbus-daemon --session --fork --print-pid 0 --print-ad
 1468 trilok      648 R   ps
<trilok># export
DBUS_SESSION_BUS_ADDRESS="unix:path=/tmp/session_bus_socket,guid=9b99e59ebe05b5a27f22730000004f86"
             Now running my player-server dbus-glib written application.
 <trilok># player-server

It throws the following error:
"player-server: ERROR: Couldn't connect to session bus (Did not
receive a reply. Possible causes include: the remote application did
not send a reply, the message bus security policy blocked the reply,
the reply timeout expired, or the network connection was broken.)"


And here is the detailed verbose log emitted by libdbus.

--------------------snip----------------------
player-server:main Connecting to the Session D-Bus.
player-server:main Connecting to the Session D-Bus.
1500: Filling in system bus address...
1500:   used default system bus "unix:path=/var/run/dbus/system_bus_socket"
1500: Filling in session bus address...
1500:   "unix:path=/tmp/session_bus_socket,guid=9b99e59ebe05b5a27f22730000004f86"
1500: Filling in activation bus address...
1500:   "none set"
1500: opening shared connection to:
unix:path=/tmp/session_bus_socket,guid=9b99e59ebe05b5a27f22730000004f86
1500: checking for existing connection
1500: creating shared_connections hash table
1500:   successfully created shared_connections
1500: connecting to unix socket /tmp/session_bus_socket abstract=0
1500: Successfully connected to unix socket /tmp/session_bus_socket
1500: client: going from state NeedSendAuth to state WaitingForData
1500: Initialized transport on address unix:path=/tmp/session_bus_socket
1500:   LOCK: _dbus_connection_new_for_transport
1500:   UNLOCK: protected_change_watch
1500:   LOCK: protected_change_watch
1500:   UNLOCK: protected_change_watch
1500:   LOCK: protected_change_watch
1500: check_read_watch: fd = 3
1500:   setting read watch enabled = 0
1500:   UNLOCK: protected_change_watch
1500:   LOCK: protected_change_watch
1500: check_write_watch(): needed = 1 on connection 0x1ac10 watch
0x1a940 fd = 3 outgoing messages exist 0
1500:   UNLOCK: protected_change_watch
1500:   LOCK: protected_change_watch
1500:   UNLOCK: _dbus_connection_new_for_transport
1500:   LOCK: _dbus_connection_open_internal
1500: stored connection to 9b99e59ebe05b5a27f22730000004f86 to be shared
1500:   UNLOCK: _dbus_connection_open_internal
1500:   LOCK: dbus_connection_set_exit_on_disconnect
1500:   UNLOCK: dbus_connection_set_exit_on_disconnect
1500: Allocated slot 0 on allocator 0x40073bf0 total 1 slots allocated 1 used
1500:   LOCK: dbus_connection_get_data
1500:   UNLOCK: dbus_connection_get_data
1500:   LOCK: dbus_connection_set_data
1500:   UNLOCK: dbus_connection_set_data
1500:   LOCK: dbus_connection_send_with_reply
1500: Allocated slot 0 on allocator 0x40073c38 total 1 slots allocated 1 used
1500:   UNLOCK: protected_change_timeout
1500:   LOCK: protected_change_timeout
1500: Message 0x1af58 (1 /org/freedesktop/DBus org.freedesktop.DBus
Hello '') for org.freedesktop.DBus added to outgoing queue 0x1ac10, 1
pending to send
1500: Message 0x1af58 serial is 1
1500: _dbus_connection_do_iteration_unlocked start
1500:   UNLOCK: _dbus_connection_acquire_io_path
1500: _dbus_connection_acquire_io_path locking io_path_mutex
1500: _dbus_connection_acquire_io_path start
connection->io_path_acquired = 0 timeout = 0
1500: _dbus_connection_acquire_io_path end
connection->io_path_acquired = 1 we_acquired = 1
1500: _dbus_connection_acquire_io_path unlocking io_path_mutex
1500:   LOCK: _dbus_connection_acquire_io_path
1500: Transport iteration flags 0x1 timeout -1 connected = 1
1500:  iteration flags = write timeout = -1 read_watch = 0x1a968
write_watch = 0x1a940 fd = 3
1500: in iteration, need_read=0 need_write=1
1500: exchange_credentials: do_reading = 0, do_writing = 1
1500: wrote credentials byte
1500:  client auth state: bytes to send
1500: client: Sent 24 bytes of: AUTH EXTERNAL 31303030


1500: exchange_credentials: do_reading = 0, do_writing = 1
1500:  client auth state: waiting for input
1500: check_read_watch: fd = 3
1500:   setting read watch enabled = 1
1500:   UNLOCK: protected_change_watch
1500:   LOCK: protected_change_watch
1500: check_write_watch(): needed = 0 on connection 0x1ac10 watch
0x1a940 fd = 3 outgoing messages exist 1
1500:   UNLOCK: protected_change_watch
1500:   LOCK: protected_change_watch
1500: Not authenticated, not writing anything
1500: check_write_watch(): needed = 0 on connection 0x1ac10 watch
0x1a940 fd = 3 outgoing messages exist 1
1500:   UNLOCK: protected_change_watch
1500:   LOCK: protected_change_watch
1500:  ... leaving do_iteration()
1500: _dbus_transport_do_iteration end
1500: _dbus_connection_release_io_path locking io_path_mutex
1500: _dbus_connection_release_io_path start connection->io_path_acquired = 1
1500: _dbus_connection_release_io_path unlocking io_path_mutex
1500: _dbus_connection_do_iteration_unlocked end
1500: dispatch status = complete is_connected = 1
1500:   UNLOCK: _dbus_connection_update_dispatch_status_and_unlock
1500:   LOCK: dbus_connection_unref
1500:   UNLOCK: dbus_connection_unref
1500:   LOCK: _dbus_connection_lock
1500:   UNLOCK: _dbus_connection_unlock
1500:   LOCK: _dbus_connection_lock
1500:   UNLOCK: _dbus_connection_unlock
1500:   LOCK: _dbus_connection_lock
1500: doing iteration in _dbus_connection_flush_unlocked
1500: _dbus_connection_do_iteration_unlocked start
1500:   UNLOCK: _dbus_connection_acquire_io_path
1500: _dbus_connection_acquire_io_path locking io_path_mutex
1500: _dbus_connection_acquire_io_path start
connection->io_path_acquired = 0 timeout = -1
1500: _dbus_connection_acquire_io_path end
connection->io_path_acquired = 1 we_acquired = 1
1500: _dbus_connection_acquire_io_path unlocking io_path_mutex
1500:   LOCK: _dbus_connection_acquire_io_path
1500: Transport iteration flags 0x7 timeout -1 connected = 1
1500:  iteration flags = readwrite timeout = -1 read_watch = 0x1a968
write_watch = 0x1a940 fd = 3
1500: unlock socket_do_iteration pre poll
1500:   UNLOCK: _dbus_connection_unlock
1500: lock socket_do_iteration post poll
1500:   LOCK: _dbus_connection_lock
1500: in iteration, need_read=1 need_write=0
1500: exchange_credentials: do_reading = 1, do_writing = 0
1500:  client auth state: waiting for input
1500:  read 37 bytes in auth phase
1500: client: got command "OK 9b99e59ebe05b5a27f22730000004f86"
1500: Got GUID '9b99e59ebe05b5a27f22730000004f86' from the server
1500: client: going from state WaitingForData to state Authenticated
1500: exchange_credentials: do_reading = 1, do_writing = 0
1500:  client auth state: bytes to send
1500: check_read_watch: fd = 3
1500:   setting read watch enabled = 0
1500:   UNLOCK: protected_change_watch
1500:   LOCK: protected_change_watch
1500: check_write_watch(): needed = 1 on connection 0x1ac10 watch
0x1a940 fd = 3 outgoing messages exist 1
1500:   UNLOCK: protected_change_watch
1500:   LOCK: protected_change_watch
1500: do_reading: fd = 3
1500: check_write_watch(): needed = 1 on connection 0x1ac10 watch
0x1a940 fd = 3 outgoing messages exist 1
1500:   UNLOCK: protected_change_watch
1500:   LOCK: protected_change_watch
1500:  ... leaving do_iteration()
1500: _dbus_transport_do_iteration end
1500: _dbus_connection_release_io_path locking io_path_mutex
1500: _dbus_connection_release_io_path start connection->io_path_acquired = 1
1500: _dbus_connection_release_io_path unlocking io_path_mutex
1500: _dbus_connection_do_iteration_unlocked end
1500: doing iteration in _dbus_connection_flush_unlocked
1500: _dbus_connection_do_iteration_unlocked start
1500:   UNLOCK: _dbus_connection_acquire_io_path
1500: _dbus_connection_acquire_io_path locking io_path_mutex
1500: _dbus_connection_acquire_io_path start
connection->io_path_acquired = 0 timeout = -1
1500: _dbus_connection_acquire_io_path end
connection->io_path_acquired = 1 we_acquired = 1
1500: _dbus_connection_acquire_io_path unlocking io_path_mutex
1500:   LOCK: _dbus_connection_acquire_io_path
1500: Transport iteration flags 0x7 timeout -1 connected = 1
1500:  iteration flags = readwrite timeout = -1 read_watch = 0x1a968
write_watch = 0x1a940 fd = 3
1500: unlock socket_do_iteration pre poll
1500:   UNLOCK: _dbus_connection_unlock
1500: lock socket_do_iteration post poll
1500:   LOCK: _dbus_connection_lock
1500: in iteration, need_read=0 need_write=1
1500: exchange_credentials: do_reading = 0, do_writing = 1
1500:  client auth state: bytes to send
1500: client: Sent 7 bytes of: BEGIN


1500: check_read_watch: fd = 3
1500:   setting read watch enabled = 1
1500:   UNLOCK: protected_change_watch
1500:   LOCK: protected_change_watch
1500: check_write_watch(): needed = 1 on connection 0x1ac10 watch
0x1a940 fd = 3 outgoing messages exist 1
1500:   UNLOCK: protected_change_watch
1500:   LOCK: protected_change_watch
1500: check_write_watch(): needed = 1 on connection 0x1ac10 watch
0x1a940 fd = 3 outgoing messages exist 1
1500:   UNLOCK: protected_change_watch
1500:   LOCK: protected_change_watch
1500:  ... leaving do_iteration()
1500: _dbus_transport_do_iteration end
1500: _dbus_connection_release_io_path locking io_path_mutex
1500: _dbus_connection_release_io_path start connection->io_path_acquired = 1
1500: _dbus_connection_release_io_path unlocking io_path_mutex
1500: _dbus_connection_do_iteration_unlocked end
1500: doing iteration in _dbus_connection_flush_unlocked
1500: _dbus_connection_do_iteration_unlocked start
1500:   UNLOCK: _dbus_connection_acquire_io_path
1500: _dbus_connection_acquire_io_path locking io_path_mutex
1500: _dbus_connection_acquire_io_path start
connection->io_path_acquired = 0 timeout = -1
1500: _dbus_connection_acquire_io_path end
connection->io_path_acquired = 1 we_acquired = 1
1500: _dbus_connection_acquire_io_path unlocking io_path_mutex
1500:   LOCK: _dbus_connection_acquire_io_path
1500: Transport iteration flags 0x7 timeout -1 connected = 1
1500:  iteration flags = readwrite timeout = -1 read_watch = 0x1a968
write_watch = 0x1a940 fd = 3
1500: unlock socket_do_iteration pre poll
1500:   UNLOCK: _dbus_connection_unlock
1500: lock socket_do_iteration post poll
1500:   LOCK: _dbus_connection_lock
1500: in iteration, need_read=0 need_write=1
1500: do_writing(), have_messages = 1, fd = 3
1500:  wrote 128 bytes of 128
1500: Message 0x1af58 (1 /org/freedesktop/DBus org.freedesktop.DBus
Hello '') removed from outgoing queue 0x1ac10, 0 left to send
1500: check_write_watch(): needed = 0 on connection 0x1ac10 watch
0x1a940 fd = 3 outgoing messages exist 0
1500:   UNLOCK: protected_change_watch
1500:   LOCK: protected_change_watch
1500:  ... leaving do_iteration()
1500: _dbus_transport_do_iteration end
1500: _dbus_connection_release_io_path locking io_path_mutex
1500: _dbus_connection_release_io_path start connection->io_path_acquired = 1
1500: _dbus_connection_release_io_path unlocking io_path_mutex
1500: _dbus_connection_do_iteration_unlocked end
1500: _dbus_connection_flush_unlocked middle
1500:  0 unused bytes sent to message loader
1500: dispatch status = complete is_connected = 1
1500: dbus_connection_send_with_reply_and_block(): will block 25000
milliseconds for reply serial 1 from 20546 sec 776691 usec to 20571
sec 776691 usec
1500: _dbus_connection_do_iteration_unlocked start
1500:   UNLOCK: _dbus_connection_acquire_io_path
1500: _dbus_connection_acquire_io_path locking io_path_mutex
1500: _dbus_connection_acquire_io_path start
connection->io_path_acquired = 0 timeout = 25000
1500: _dbus_connection_acquire_io_path end
connection->io_path_acquired = 1 we_acquired = 1
1500: _dbus_connection_acquire_io_path unlocking io_path_mutex
1500:   LOCK: _dbus_connection_acquire_io_path
1500: Transport iteration flags 0x6 timeout 25000 connected = 1
1500:  iteration flags = read timeout = 25000 read_watch = 0x1a968
write_watch = 0x1a940 fd = 3
1500: unlock socket_do_iteration pre poll
1500:   UNLOCK: _dbus_connection_unlock
1500: lock socket_do_iteration post poll
1500:   LOCK: _dbus_connection_lock
1500: in iteration, need_read=1 need_write=0
1500: do_reading: fd = 3
1500: check_read_watch: fd = 3
1500:   setting read watch enabled = 1
1500:   UNLOCK: protected_change_watch
1500:   LOCK: protected_change_watch
1500: Disconnected from remote app
1500: _dbus_transport_disconnect start
1500: socket_disconnect
1500: free_watches start
1500:   UNLOCK: protected_change_watch
1500:   LOCK: protected_change_watch
1500: Setting watch fd -1 data to data = (nil) function = (nil) from
data = (nil) function = (nil)
1500:   UNLOCK: protected_change_watch
1500:   LOCK: protected_change_watch
1500: Setting watch fd -1 data to data = (nil) function = (nil) from
data = (nil) function = (nil)
1500: free_watches end
1500: _dbus_transport_disconnect end
1500:  ... leaving do_iteration()
1500: _dbus_transport_do_iteration end
1500: _dbus_connection_release_io_path locking io_path_mutex
1500: _dbus_connection_release_io_path start connection->io_path_acquired = 1
1500: _dbus_connection_release_io_path unlocking io_path_mutex
1500: _dbus_connection_do_iteration_unlocked end
1500: _dbus_connection_block_pending_call top of recheck
1500: dispatch status = complete is_connected = 0
1500: Sending disconnect message from
notify_disconnected_and_dispatch_complete_unlocked
1500: Synthesized message 0x1b0b8 added to incoming queue 0x1ac10, 1 incoming
1500:   UNLOCK: protected_change_timeout
1500:   LOCK: protected_change_timeout
1500:   UNLOCK: _dbus_connection_unlock
1500:   LOCK: free_pending_call_on_hash_removal
1500:   UNLOCK: _dbus_connection_unlock
1500:   LOCK: connection_timeout_and_complete_all_pending_calls_unlocked
1500: Synthesized message 0x1ac98 added to incoming queue 0x1ac10, 2 incoming
1500: check_for_reply_and_update_dispatch_unlocked checked for reply
1500: dbus_connection_send_with_reply_and_block(): got reply
1500:   handing message 0x1b0b8 (error) to pending call serial 1
1500:   UNLOCK: _dbus_connection_unlock
1500:   LOCK: _dbus_connection_lock
1500:   UNLOCK: _dbus_connection_unlock
1500:   LOCK: check_for_reply_and_update_dispatch_unlocked
1500:   UNLOCK: _dbus_connection_update_dispatch_status_and_unlock
1500:   LOCK: dbus_connection_unref
1500:   UNLOCK: dbus_connection_unref
1500:   LOCK: _dbus_connection_lock
1500:   UNLOCK: _dbus_connection_unlock
1500:   LOCK: _dbus_connection_lock
1500:   UNLOCK: _dbus_connection_unlock
1500:   LOCK: _dbus_connection_lock
1500:   UNLOCK: _dbus_connection_unlock
1500: Freeing slot 0 on allocator 0x40073c38 total 1 allocated 1 used
1500:   LOCK: dbus_connection_unref
1500:   UNLOCK: dbus_connection_unref
1500:   LOCK: _dbus_connection_close_possibly_shared
1500: Disconnecting 0x1ac10
1500: _dbus_transport_disconnect start
1500:   UNLOCK: _dbus_connection_update_dispatch_status_and_unlock
1500:   LOCK: dbus_connection_unref
1500:   UNLOCK: dbus_connection_unref
1500:   LOCK: dbus_connection_unref
1500:   UNLOCK: dbus_connection_unref
1500:   LOCK: dbus_connection_unref
1500:   UNLOCK: dbus_connection_unref
player-server: ERROR: Couldn't connect to session bus (Did not receive
a reply. Possible causes include: the remote application did not send
a reply, the message bus security policy blocked the reply, the reply
timeout expired, or the network connection was broken.)
---------------------snip---------------------

Please guide me what I am doing wrong, or something left out in the
configuration. I am using dbus-1.0.2 and dbus-glib0.74 versions. Do I
need to upgrade to latest dbus versions? Do we need to copy
dbus-introspect.xml file on target filesystem? OR does upgrading
libdbus to latest version could solve the problem?

My session.conf is as follows:
----------------session.conf----------------------
<!-- This configuration file controls the per-user-login-session message bus.
     Add a session-local.conf and edit that rather than changing this
     file directly. -->

<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
  <!-- Our well-known bus type, don't change this -->
  <type>session</type>

  <listen>unix:path=/tmp/session_bus_socket</listen>

  <standard_session_servicedirs />

  <policy context="default">
    <!-- Allow everything to be sent -->
    <allow send_destination="*"/>
    <!-- Allow everything to be received -->
    <allow eavesdrop="true"/>
    <!-- Allow anyone to own anything -->
    <allow own="*"/>
  </policy>

  <!-- This is included last so local configuration can override what's
       in this standard file -->
  <include ignore_missing="yes">session-local.conf</include>

  <include if_selinux_enabled="yes"
selinux_root_relative="yes">contexts/dbus_contexts</include>

</busconfig>

----------------session.conf----------------------

-- 
--Trilok Soni


More information about the dbus mailing list