bzr pull: X11 initialization failed.

Bug #279486 reported by strk
154
This bug affects 6 people
Affects Status Importance Assigned to Milestone
bzr-dbus
Fix Released
Medium
Unassigned
bzr-dbus (Ubuntu)
Fix Released
Undecided
Unassigned
Nominated for Intrepid by Alex Muntada

Bug Description

This is what I get when DISPLAY env variable points to ssh-forwarded port (unsetting DISPLAY fixes it):

$ bzr pull
bzr: ERROR: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ExecFailed: dbus-launch failed to autolaunch D-Bus session: Autolaunch error: X11 initialization failed.

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 846, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 797, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 499, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 665, in run
    possible_transports=possible_transports)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/workingtree.py", line 1493, in pull
    possible_transports=possible_transports)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 1766, in pull
    run_hooks=run_hooks)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 1913, in set_last_revision_info
    self._run_post_change_branch_tip_hooks(old_revno, old_revid)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 1431, in _run_post_change_branch_tip_hooks
    hook(params)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/dbus/hook.py", line 50, in on_post_change_branch_tip
    activity.Activity().advertise_branch(params.branch)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/dbus/activity.py", line 57, in __init__
    self.bus = _get_bus(bus)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/dbus/activity.py", line 42, in _get_bus
    return dbus.SessionBus()
  File "/var/lib/python-support/python2.5/dbus/_dbus.py", line 217, in __new__
    mainloop=mainloop)
  File "/var/lib/python-support/python2.5/dbus/_dbus.py", line 106, in __new__
    bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)
  File "/var/lib/python-support/python2.5/dbus/bus.py", line 125, in __new__
    bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
DBusException: org.freedesktop.DBus.Error.Spawn.ExecFailed: dbus-launch failed to autolaunch D-Bus session: Autolaunch error: X11 initialization failed.

bzr 1.5 on python 2.5.2 (linux2)
arguments: ['/usr/bin/bzr', 'pull']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.utf8'
plugins:
  bzrtools /usr/lib/python2.5/site-packages/bzrlib/plugins/bzrtools [1.5.0]
  dbus /usr/lib/python2.5/site-packages/bzrlib/plugins/dbus [unknown]
  gtk /usr/lib/python2.5/site-packages/bzrlib/plugins/gtk [0.94.0]
  launchpad /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [unknown]
*** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred.

Related branches

Revision history for this message
strk (strk) wrote :

Sorry, I was wrong, unsetting DISPLAY doesn't fix this !

Revision history for this message
Dan Watkins (oddbloke) wrote :

Hi strk,

Thanks for the bug report. This is actually a problem with the DBUS plugin, rather than bzr itself. You can work around it by either removing the DBUS plugin or running bzr with the '--no-plugins' option.

Dan

Changed in bzr:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

This is fixed in the attached branch, which basically makes bzr-dbus warn if it can't connect to the dbus daemon rather than blow up.

Changed in bzr-dbus:
status: Confirmed → Fix Committed
Revision history for this message
Luke Faraone (lfaraone) wrote :

Jelmer,

Could you set it so that only happens if the -v param is passed to bzr? I'd rather have it fail silently unless unsilenced, as this is a _very_ common usecase.

Revision history for this message
Matt Zimmerman (mdz) wrote :

I saw a similar error, but with DISPLAY unset (logging into a remote system over ssh without forwarding).

bzr --no-plugins avoids the error, but doesn't work etiher (bzr: ERROR: Not a branch: <destination dir>)

Revision history for this message
Robert Collins (lifeless) wrote :

The fix is in trunk now. I pushed a further revision to not show any warning, but that hasn't synced just yet.

Changed in bzr-dbus:
status: Fix Committed → Fix Released
Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 279486] Re: bzr pull: X11 initialization failed.

On Thu, 2008-12-11 at 18:11 +0000, Matt Zimmerman wrote:
> I saw a similar error, but with DISPLAY unset (logging into a remote
> system over ssh without forwarding).
>
> bzr --no-plugins avoids the error, but doesn't work etiher (bzr: ERROR:
> Not a branch: <destination dir>)

Please update to trunk revno 37 or newer on that system (packages not
rolled yet sorry) and see if its hapier.

-Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Revision history for this message
Shah Japan (jsh.axelor) wrote :

here is the trace back....

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 716, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 911, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 547, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 918, in run
    possible_transports=possible_transports)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/workingtree.py", line 1551, in pull
    possible_transports=possible_transports)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 2207, in pull
    _override_hook_target=_override_hook_target)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 2029, in pull
    graph=graph)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 725, in update_revisions
    overwrite, graph)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 2846, in update_revisions
    self.target.set_last_revision_info(stop_revno, stop_revision)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 2381, in set_last_revision_info
    self._run_post_change_branch_tip_hooks(old_revno, old_revid)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 875, in _run_post_change_branch_tip_hooks
    hook(params)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/dbus/hook.py", line 46, in on_post_change_branch_tip
    activity.Activity().advertise_branch(params.branch)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/dbus/activity.py", line 71, in __init__
    self.bus = _get_bus(bus)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/dbus/activity.py", line 49, in _get_bus
    return dbus.SessionBus()
  File "/var/lib/python-support/python2.5/dbus/_dbus.py", line 217, in __new__
    mainloop=mainloop)
  File "/var/lib/python-support/python2.5/dbus/_dbus.py", line 106, in __new__
    bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)
  File "/var/lib/python-support/python2.5/dbus/bus.py", line 125, in __new__
    bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
DBusException: org.freedesktop.DBus.Error.Spawn.ExecFailed: dbus-launch failed to autolaunch D-Bus session: Autolaunch error: X11 initialization failed.

Revision history for this message
Reinhard Tartler (siretart) wrote :

with 0.1~bzr36-3 it doesn't fail, but gives this annoying message:

Unable to contact DBus session: org.freedesktop.DBus.Error.Spawn.ExecFailed: dbus-launch failed to autolaunch D-Bus session: Autolaunch error: X11 initialization failed.

Can it please be hidden somehow?

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Fixed in the version in karmic.

Changed in bzr-dbus (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.