software-properties-gtk crashed with ImportError in /usr/lib/python3/dist-packages/aptdaemon/client.py: No module named gobject

Bug #1026066 reported by Alin Andrei
388
This bug affects 81 people
Affects Status Importance Assigned to Milestone
aptdaemon (Ubuntu)
Fix Released
Critical
Martin Pitt
Quantal
Fix Released
Critical
Martin Pitt
software-properties (Ubuntu)
Invalid
Medium
Unassigned
Quantal
Invalid
Medium
Unassigned

Bug Description

This is what happens when I try to run software-properties-gtk:

andrei@andrei-quantal:~$ software-properties-gtk
Traceback (most recent call last):
  File "/usr/bin/software-properties-gtk", line 37, in <module>
    from softwareproperties.gtk.SoftwarePropertiesGtk import SoftwarePropertiesGtk
  File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 34, in <module>
    from aptdaemon import client
  File "/usr/lib/python3/dist-packages/aptdaemon/client.py", line 43, in <module>
    import gobject as GObject
ImportError: No module named gobject

ProblemType: Crash
DistroRelease: Ubuntu 12.10
Package: software-properties-gtk 0.89
ProcVersionSignature: Ubuntu 3.5.0-4.4-generic 3.5.0-rc6
Uname: Linux 3.5.0-4-generic i686
ApportVersion: 2.3-0ubuntu4
Architecture: i386 AND amd64
Date: Wed Jul 18 13:35:09 2012
ExecutablePath: /usr/bin/software-properties-gtk
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Alpha i386 (20120717.1)
InterpreterPath: /usr/bin/python3.2mu
PackageArchitecture: all
ProcCmdline: /usr/bin/python3.2 /usr/bin/software-properties-gtk
ProcEnviron:
 TERM=xterm
 SHELL=/bin/bash
 PATH=(custom, no user)
 LANG=en_US.UTF-8
PythonArgs: ['/usr/bin/software-properties-gtk']
SourcePackage: software-properties
Title: software-properties-gtk crashed with ImportError in /usr/lib/python3/dist-packages/aptdaemon/client.py: No module named gobject
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo

Revision history for this message
Alin Andrei (nilarimogard) wrote :
visibility: private → public
tags: removed: need-duplicate-check
Changed in software-properties (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in software-properties (Ubuntu):
status: New → Confirmed
Revision history for this message
TK (tkrishan) wrote :

This crash occurs for me when either clicking the Settings button on the Software Updater or attempting to select the menu item Settings/Repositories in Synaptic Package Manager

Revision history for this message
dino99 (9d9) wrote :

confirm post #3 above on quantal i386

Revision history for this message
Edward Donovan (edward.donovan) wrote :

#3 and #4 : yeah, both of those buttons call 'software-properties-gtk' and produce the same result as if you run it directly. Which at the moment is this crash. :)

Revision history for this message
Edward Donovan (edward.donovan) wrote :

So, as of version 0.89, software-properties-gtk uses aptdaemon's client module, client.py. And that's breaking.

/usr/lib/python3/dist-packages/aptdaemon/client.py has this at line 40:

if 'gi.repository' in sys.modules:
    from gi.repository import GObject
else:
    import gobject as GObject

I don't know if it should be getting it from 'gi.repository', but it's not. And then the 'else' import statement isn't working either.

Nor do I know yet, if client.py is purely broken there, or if software-properties-gtk isn't quite importing it correctly. Maybe there's a missing dependency that the developers had on their machine, but the reporters don't? But I've tried a few gobject packages and haven't hit on anything.

Changed in aptdaemon (Ubuntu):
status: New → Confirmed
Revision history for this message
Martin Pitt (pitti) wrote :

That happened to me a few days ago as well. I fixed that in http://bazaar.launchpad.net/~aptdaemon-developers/aptdaemon/main/revision/848

Changed in aptdaemon (Ubuntu):
status: Confirmed → Fix Committed
Changed in software-properties (Ubuntu):
status: Confirmed → Fix Committed
Changed in aptdaemon (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Elfy (elfy) wrote :

Whether the upates I just received (main server) where the ones you released I am not sure

Package: software-properties-gtk
Status: install ok installed
Priority: optional
Section: admin
Installed-Size: 362
Maintainer: Michael Vogt <email address hidden>
Architecture: all
Source: software-properties
Version: 0.91

But I still get this

hob@sidh:~$ software-properties-gtk
Traceback (most recent call last):
  File "/usr/bin/software-properties-gtk", line 37, in <module>
    from softwareproperties.gtk.SoftwarePropertiesGtk import SoftwarePropertiesGtk
  File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 34, in <module>
    from aptdaemon import client
  File "/usr/lib/python3/dist-packages/aptdaemon/client.py", line 43, in <module>
    import gobject as GObject
ImportError: No module named gobject

Revision history for this message
dino99 (9d9) wrote :

0.91 is still crashing on quantal i386 if i try to open it (same error as into comment #8 above )

Revision history for this message
John Belton (jbelton1950) wrote :

I'm still getting random closures when I try to update and if I try to access the"settings" to check what is set. I have used the terminal to do updates but the setting status doesn't seem to apply as some updates listed as "proposed" don't get updated but when I originally set the options I ticked that option on the original installation. I wanted to check this had not changed, hence my attempt to access the "settings".
John

Revision history for this message
Doug McMahon (mc3man) wrote :

The fix per comment #7 is in aptdaemon, not software-properties-gtk & has not been released yet

Can confirm that manually editing, (replacing lines 40 -43), /usr/lib/python3/dist-packages/aptdaemon/client.py as shown in the link allows software-properties-gtk to start up & run

Though it is a littles low to appear, about 4-5 sec's here

Revision history for this message
Jessica Lambiase (siliconjey) wrote :

Same bug for me. Quantal i386.

Revision history for this message
Edward Donovan (edward.donovan) wrote :

Yeah, I think aptdaemon should be marked Fix Committed, not yet Fix Released, but I can't change it myself.

Changed in aptdaemon (Ubuntu):
status: Fix Released → Triaged
Revision history for this message
Anastasia Antonitsi (psydefects22) wrote :

after fresh dvdom install,update-grade and all the stuff we do when upgrading, me too confirming this one, its pretty annoying. some details, i had synaptic doing some installs, and like many here described i was browsing the software center, only other app i had was etherape and gkrellm but these are almost always on. it happened about the time i switched from docky/v.desktop2 to synaptic/v.desktop1 to see the console scroll-out.when i used the unity to switch, it didn't happen at all.

Eduard Gotwig (gotwig)
description: updated
Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu Package testing tracker.

A list of all reports related to this bug can be found here:
http://packages.qa.ubuntu.com/qatracker/reports/bugs/1026066

tags: added: package-qa-testing
Revision history for this message
tsj (ts3141592) wrote :

Same error. Newly installed 64-bit quantal from the daily build.

Revision history for this message
Paddy Landau (paddy-landau) wrote :

I have manually installed the fix in comment #7 (thank you, Martin Pitt).

I confirm that it now works from the terminal, Synaptic Package Manager, Ubuntu Software Centre, and Settings.

Revision history for this message
Paddy Landau (paddy-landau) wrote :

Oh, I should add that I wasn't sure which item to fix, because there were two, so I fixed them both:

/usr/share/pyshared/aptdaemon/client.py
/usr/lib/python3/dist-packages/aptdaemon/client.py

Revision history for this message
dino99 (9d9) wrote :

Have made changes as posted above into comment #18 :

dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)

if 'gobject' in sys.modules:
    import gobject as GObject
else:
    from gi.repository import GObject

from . import enums

but got error:

  File "/usr/lib/python3/dist-packages/aptdaemon/client.py", line 40
    if 'gobject' in sys.modules:
       ^
SyntaxError: invalid character in identifier

Does not see what is wrong there (remove/add done as per #7 link details)

Revision history for this message
Edward Donovan (edward.donovan) wrote :

dino99, I'm not sure what went wrong for you, either. Could it be a different type of quote character in your file? Hm.

This may be what you have already done, but I'll spell out what I did to apply Martin's patch for aptdaemon, until a fixed aptdaemon package is released:

Here's a direct link to the patch:

  http://bazaar.launchpad.net/~aptdaemon-developers/aptdaemon/main/diff/848

Firefox doesn't display that, it just prompts me to save it, and most browsers probably will, too. It will save it as:

  848_847.diff

Note where it is saved; probably in ~/Downloads .

In the shell, do this:

  cd /usr/lib/python3/dist-packages/aptdaemon/
  sudo patch < ~/Downloads/848_847.diff

I'd recommend that for anyone who wants to fix this bug on the systems while waiting for a release. dino, if that doesn't work for you, still, I guess I'll be scratching my head.

Revision history for this message
Edward Donovan (edward.donovan) wrote :

Paddy, that's good to note we have two versions of the file on our systems. For the moment, at least, we have "python-aptdaemon", and "python3-aptdaemon" packages in Quantal installs. It's the python3 file that's getting included by software-propeties-gtk. So fixing just

   /usr/lib/python3/dist-packages/aptdaemon/client.py

as I described in the last post, will do it.

Revision history for this message
Edward Donovan (edward.donovan) wrote :

So, a lot of people trying to run Quantal are being bothered by this bug. This fix has been committed. Is there more I can do, to push the release of a fixed aptdaemon package? Thanks.

Revision history for this message
Elfy (elfy) wrote :

#20 got mine going - no idea I what I was doing wrong following #7

Revision history for this message
dino99 (9d9) wrote :

Thanks Edward for your howto above into post #20, now both synaptic & System Sources can be set back again.

Revision history for this message
Davide Depau (depau) wrote :

Sorry, I've changed bug visibility for mistake...

security vulnerability: no → yes
visibility: public → private
security vulnerability: yes → no
visibility: private → public
Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:
http://iso.qa.ubuntu.com/qatracker/reports/bugs/1026066

tags: added: iso-testing
janakaravi (janakaravi)
Changed in software-properties (Ubuntu Quantal):
status: Fix Committed → Confirmed
Changed in aptdaemon (Ubuntu Quantal):
status: Triaged → Fix Released
Changed in software-properties (Ubuntu Quantal):
status: Confirmed → Fix Released
Changed in software-properties (Ubuntu Quantal):
status: Fix Released → Fix Committed
Changed in aptdaemon (Ubuntu Quantal):
status: Fix Released → Triaged
Revision history for this message
Martin Pitt (pitti) wrote :

Starting software-properties-gtk is enough to trigger it. Bug is in aptdaemon.

Changed in software-properties (Ubuntu Quantal):
status: Fix Committed → Invalid
Changed in aptdaemon (Ubuntu Quantal):
milestone: none → quantal-alpha-3
importance: Undecided → Critical
status: Triaged → In Progress
assignee: nobody → Martin Pitt (pitti)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package aptdaemon - 0.45+bzr848-0ubuntu1

---------------
aptdaemon (0.45+bzr848-0ubuntu1) quantal; urgency=low

  * New upstream snapshot:
    - aptdaemon/client.py: Prefer GI GObject module. (LP: #1026066)
    - lintian supports skipping user profiles since 2.5.9, make use of this to
      simplify code a bit.
  * debian/rules: Temporarily make test suite non-fatal while
    tests.test_worker.WorkerTestCase.test_install_file() is failing, as above
    fix is urgent for alpha-3.
 -- Martin Pitt <email address hidden> Tue, 24 Jul 2012 10:09:31 +0200

Changed in aptdaemon (Ubuntu Quantal):
status: In Progress → 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.