software-properties-gtk crashed with AttributeError in toggle_source_use(): 'NoneType' object has no attribute 'disabled'

Bug #854818 reported by los-nikos
250
This bug affects 70 people
Affects Status Importance Assigned to Milestone
software-properties (Ubuntu)
Fix Released
High
Martin Pitt
Precise
Fix Released
High
Martin Pitt

Bug Description

Reproduced this, with the following steps:
1. Add PPA with add-apt-repository (adds both deb and deb-src)
2. Remove PPA with add-apt-repository --remove (only removes deb entry , deb-src is left there, see bug #838507)
3. Open Software sources and try to disable or remove the deb-src entry left there

Expected result:
The deb-src entry is removed
What happens:
Nothing, but the trace attached is written to stdout.

ProblemType: Crash
DistroRelease: Ubuntu 11.10
Package: software-properties-gtk 0.81.9
ProcVersionSignature: Ubuntu 3.0.0-11.18-generic 3.0.4
Uname: Linux 3.0.0-11-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 1.23-0ubuntu1
Architecture: amd64
CheckboxSubmission: be2fbfde253285762d2d7eaf0e9f7c54
CheckboxSystem: edda5d4f616ca792bf437989cb597002
Date: Tue Sep 20 19:59:12 2011
ExecutablePath: /usr/bin/software-properties-gtk
InterpreterPath: /usr/bin/python2.7
PackageArchitecture: all
ProcCmdline: /usr/bin/python /usr/bin/software-properties-gtk --open-tab 2
PythonArgs: ['/usr/bin/software-properties-gtk', '--open-tab', '2']
SourcePackage: software-properties
Title: software-properties-gtk crashed with AttributeError in toggle_source_use(): 'NoneType' object has no attribute 'disabled'
UpgradeStatus: Upgraded to oneiric on 2011-09-20 (0 days ago)
UserGroups: adm admin audio cdrom dialout dip floppy fuse plugdev sudo tape video

Revision history for this message
los-nikos (id4me) wrote :
tags: removed: need-duplicate-check
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
visibility: private → public
Revision history for this message
Michael Vogt (mvo) wrote :

Could you please attach your /etc/apt/sources.list and the files in /etc/apt/sources.list.d ?

Revision history for this message
Michael Vogt (mvo) wrote :

This may actually be a dupe (or different sympthom) of #820028 that got fixed with:

software-properties (0.81.10) oneiric; urgency=low

  * softwareproperties/dbus/SoftwarePropertiesDBus.py, tests/test_dbus.py:
    - fix crash when there are unicode comments in the sources.list
      file (LP: #820028). Dbus always sends us a dbus.String which is
      type unicode, but python-apt expects utf8 encoded str

 -- Michael Vogt <email address hidden> Mon, 10 Oct 2011 10:55:45 +0200

Revision history for this message
Sebastien Bacher (seb128) wrote :

Could you try if that's still an issue?

Changed in software-properties (Ubuntu):
importance: Undecided → High
status: Confirmed → Incomplete
Revision history for this message
Robert Roth (evfool) wrote :

Reproduced this, with the following steps:
1. Add PPA with add-apt-repository (adds both deb and deb-src)
2. Remove PPA with add-apt-repository --remove (only removes deb entry , deb-src is left there, see bug #838507)
3. Open Software sources and try to disable or remove the deb-src entry left there

Expected result:
The deb-src entry is removed
What happens:
Nothing, but the trace attached is written to stdout.

Changed in software-properties (Ubuntu):
status: Incomplete → Triaged
Robert Roth (evfool)
description: updated
Revision history for this message
Mauro (jasmines) wrote :

Same here, 11.10 and Gnome Shell.
Some other infos:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 649, in on_isv_source_toggled
    self.backend.ToggleSourceUse(str(source_entry))
  File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 143, in __call__
    **keywords)
  File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 630, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Python.AttributeError: Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/dbus/service.py", line 702, in _message_cb
    retval = candidate_method(self, *args, **keywords)
  File "/usr/lib/python2.7/dist-packages/softwareproperties/dbus/SoftwarePropertiesDBus.py", line 156, in ToggleSourceUse
    self.toggle_source_use(source.encode("utf-8"))
  File "/usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py", line 433, in toggle_source_use
    source.disabled = not source.disabled
AttributeError: 'NoneType' object has no attribute 'disabled'

Revision history for this message
Christopher (soft-kristal) wrote :

All I can add is that it occurred on bootup.

Revision history for this message
Ir0nsh007er (ir0n) wrote :

On boot up too

Revision history for this message
Susan Cragin (susancragin) wrote :

any modification triggers it. I added the ppa for wine and tried to edit the distribution from placid to oneric, and it misbehaved.

Revision history for this message
Joost Van Durme (joostvandurme) wrote :

Happened in 12.04 (latest updates) after Unity booted up.

Revision history for this message
Kalsan (info-kalsan) wrote :

Cannot remove the ticks on the left of the sources (added with add-apt-repository), then crash.

Revision history for this message
Martin Pitt (pitti) wrote :

Can reproduce.

Changed in software-properties (Ubuntu Precise):
assignee: nobody → Martin Pitt (pitti)
status: Triaged → In Progress
Revision history for this message
Martin Pitt (pitti) wrote :

So this seems to happen when starting software-properties-dbus, then adding a new apt source; the D-BUS backend does not know about it yet, but the frontend does, so the backend doesn't find the Source for the corresponding string when trying to disable it.

Martin Pitt (pitti)
Changed in software-properties (Ubuntu Precise):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package software-properties - 0.82.5

---------------
software-properties (0.82.5) precise; urgency=low

  * softwareproperties/gtk/SoftwarePropertiesGtk.py: Drop duplicate definition
    of on_treeview_sources_cursor_changed().
  * softwareproperties/gtk/SoftwarePropertiesGtk.py: Fix crash when closing
    the application with the window title bar button. (LP: #911834)
  * add-apt-repository: Intercept ValueError in addition to URLError, as this
    is the error thrown when trying to decode invalid JSON (which happens on
    404 pages etc.). (LP: #861258)
  * softwareproperties/SoftwareProperties.py, _find_source_from_string():
    Reload the sources list before searching, as it might have changed while
    the D-BUS backend was running. (LP: #854818, #820150)
  * softwareproperties/gtk/SoftwarePropertiesGtk.py: Add missing argument to
    menu popup() call. (LP: #815236)
 -- Martin Pitt <email address hidden> Wed, 07 Mar 2012 10:14:52 +0100

Changed in software-properties (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Sasa Paporovic (melchiaros) wrote :

It is still there on oneiric.

Revision history for this message
Oibaf (oibaf) wrote :

I reproduced this bug with software-properties 0.82.7 on precise and I was redirect here by the automatic bug reporting.

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.