Software Centre should fail gracefully on failures to open source lists

Bug #602152 reported by Ben McCann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
software-center (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Binary package hint: software-center

I ran the following command as suggested on http://www.playonlinux.com/en/download.html:
sudo wget http://deb.playonlinux.com/playonlinux_lucid.list -O /etc/apt/sources.list.d/playonlinux.list

This created a file which was not readable:
$ ls -l /etc/apt/sources.list.d/playonlinux.list
-rw-r----- 1 root root 43 May 1 09:42 playonlinux.list

As a result the "Ubuntu Software Center" was entirely broken and it told me I had 0 packages installed. It should be able to deal with this or give me a reasonable error message. This caused me needless amounts of frustration.

When I finally launched synpatic from the command line it was clear what was going on:
E: Opening /etc/apt/sources.list.d/playonlinux.list - ifstream::ifstream (13: Permission denied)
E: The list of sources could not be read.
Go to the repository dialog to correct the problem.
E: _cache->open() failed, please report.

Changed in software-center (Ubuntu):
assignee: nobody → michael wentzell (mikewentz22)
status: New → In Progress
Changed in software-center (Ubuntu):
status: In Progress → Confirmed
Revision history for this message
michael wentzell (mikewentz22) wrote :

Thank you for reporting a bug please be patient as your bug is fixed, although i may not set your status as triaged i am applying for the bug control team and this is one of my test bugs.

Revision history for this message
C de-Avillez (hggdh2) wrote :

I did the same wget as noted by the OP. One thing should be noted here: 'sudo wget ... -O...' will create a file respecting the UMASK. It happens mine is the default (022), so I did not experience this issue. I then forcefully changed permissions:

sudo chmod 640 /etc/apd/source.list.d/playonlinux.list

And then was able to reproduce:

cerdea@xango2:/src/buildd/arsenal/scripts$ software-center
** Message: pygobject_register_sinkfunc is deprecated (GtkWindow)
** Message: pygobject_register_sinkfunc is deprecated (GtkInvisible)
** Message: pygobject_register_sinkfunc is deprecated (GtkObject)
/usr/share/software-center/softwarecenter/view/historypane.py:30: DeprecationWarning: please use 'debian' instead of 'debian_bundle'
  from debian_bundle import deb822
Traceback (most recent call last):
  File "/usr/share/software-center/softwarecenter/apt/aptcache.py", line 94, in open
    self._cache = apt.Cache(GtkMainIterationProgress())
  File "/usr/lib/python2.6/dist-packages/apt/cache.py", line 86, in __init__
    self.open(progress)
  File "/usr/lib/python2.6/dist-packages/apt/cache.py", line 123, in open
    self._cache = apt_pkg.Cache(progress)
SystemError: E:Opening /etc/apt/sources.list.d/playonlinux.list - ifstream::ifstream (13: Permission denied), E:The list of sources could not be read.
Traceback (most recent call last):
  File "/usr/bin/software-center", line 83, in <module>
    app = SoftwareCenterApp(datadir, xapian_base_path, enable_lp_integration=options.enable_lp)
  File "/usr/share/software-center/softwarecenter/app.py", line 243, in __init__
    self.view_switcher = ViewSwitcher(datadir, self.db, self.cache, self.icons)
  File "/usr/share/software-center/softwarecenter/view/viewswitcher.py", line 57, in __init__
    store = ViewSwitcherList(datadir, db, cache, icons)
  File "/usr/share/software-center/softwarecenter/view/viewswitcher.py", line 231, in __init__
    self._update_channel_list()
  File "/usr/share/software-center/softwarecenter/view/viewswitcher.py", line 296, in _update_channel_list
    self._update_channel_list_installed_view()
  File "/usr/share/software-center/softwarecenter/view/viewswitcher.py", line 344, in _update_channel_list_installed_view
    if (pkgname in self.cache and
  File "/usr/share/software-center/softwarecenter/apt/aptcache.py", line 106, in __contains__
    return self._cache.__contains__(k)
AttributeError: 'NoneType' object has no attribute '__contains__'

Confirming for Maverick.

Changed in software-center (Ubuntu):
assignee: michael wentzell (mikewentz22) → nobody
importance: Undecided → Medium
C de-Avillez (hggdh2)
summary: - Ubuntu Software Center fails and swallows error message
+ Software Centre should fail gracefully on failures to open source lists
Revision history for this message
Kiwinote (kiwinote) wrote :

Hi! Thanks for your bug report. The bug you describe is being tracked in a different bug report, so I will mark this bug as a duplicate of the other one. Please continue to report any bugs you may find in software-center. Thanks again for your help!

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.