Poor handling of broken sources.list files

Bug #886273 reported by Jean-Baptiste Lallement
478
This bug affects 45 people
Affects Status Importance Assigned to Milestone
Aptdaemon
Confirmed
Undecided
Unassigned
aptdaemon (Ubuntu)
Confirmed
Undecided
Matthew Paul Thomas
software-center (Ubuntu)
Invalid
Undecided
Unassigned
update-manager (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

Ubuntu Software Center 2.1.16.1, Ubuntu Maverick
Ubuntu Software Center 5.1.11, Ubuntu 12.04 beta 1

1. echo "deb http://ppa.launchpad.net/tualatrix/ppa/ubuntu main #Ubuntu Tweak Stable Source" | sudo tee /etc/apt/sources.list.d/ubuntu-tweak-stable.list
2. software-center
3. update-manager

What happens:
2. ----------
Traceback (most recent call last):
  File "/usr/share/software-center/softwarecenter/db/pkginfo_impl/aptcache.py", line 222, in open
    self._cache = apt.Cache(GtkMainIterationProgress())
  File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 102, in __init__
    self.open(progress)
  File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 145, in open
    self._cache = apt_pkg.Cache(progress)
SystemError: E:Malformed line 1 in source list /etc/apt/sources.list.d/ubuntu-tweak-stable.list (dist parse), E:The list of sources could not be read., E:The package lists or status file could not be parsed or opened.
2012-03-12 10:52:15,573 - softwarecenter.db.enquire - ERROR - _get_estimate_nr_apps_and_nr_pkgs failed
Traceback (most recent call last):
  File "/usr/share/software-center/softwarecenter/db/enquire.py", line 115, in _get_estimate_nr_apps_and_nr_pkgs
    tmp_matches = enquire.get_mset(0, len(self.db), None, xfilter)
  File "/usr/share/software-center/softwarecenter/db/appfilter.py", line 74, in __call__
    if (not pkgname in self.cache and
  File "/usr/share/software-center/softwarecenter/db/pkginfo_impl/aptcache.py", line 241, in __contains__
    return self._cache.__contains__(k)
AttributeError: 'NoneType' object has no attribute '__contains__'
Traceback (most recent call last):
  File "/usr/bin/software-center", line 176, in <module>
    app.run(args)
  File "/usr/share/software-center/softwarecenter/ui/gtk3/app.py", line 1279, in run
    self.show_available_packages(args)
  File "/usr/share/software-center/softwarecenter/ui/gtk3/app.py", line 1208, in show_available_packages
    self.view_manager.set_active_view(ViewPages.AVAILABLE)
  File "/usr/share/software-center/softwarecenter/ui/gtk3/session/viewmanager.py", line 148, in set_active_view
    view_widget.init_view()
  File "/usr/share/software-center/softwarecenter/ui/gtk3/panes/availablepane.py", line 157, in init_view
    self.apps_filter)
  File "/usr/share/software-center/softwarecenter/ui/gtk3/views/catview_gtk.py", line 234, in __init__
    self.build(desktopdir)
  File "/usr/share/software-center/softwarecenter/ui/gtk3/views/catview_gtk.py", line 476, in build
    self._build_homepage_view()
  File "/usr/share/software-center/softwarecenter/ui/gtk3/views/catview_gtk.py", line 253, in _build_homepage_view
    self._append_whats_new()
  File "/usr/share/software-center/softwarecenter/ui/gtk3/views/catview_gtk.py", line 415, in _append_whats_new
    whats_new_cat = self._update_whats_new_content()
  File "/usr/share/software-center/softwarecenter/ui/gtk3/views/catview_gtk.py", line 404, in _update_whats_new_content
    docs = whats_new_cat.get_documents(self.db)
  File "/usr/share/software-center/softwarecenter/db/categories.py", line 120, in get_documents
    nonblocking_load=False)
  File "/usr/share/software-center/softwarecenter/db/enquire.py", line 316, in set_query
    self._blocking_perform_search()
  File "/usr/share/software-center/softwarecenter/db/enquire.py", line 211, in _blocking_perform_search
    matches = enquire.get_mset(0, self.limit, None, xfilter)
  File "/usr/share/software-center/softwarecenter/db/appfilter.py", line 74, in __call__
    if (not pkgname in self.cache and
  File "/usr/share/software-center/softwarecenter/db/pkginfo_impl/aptcache.py", line 241, in __contains__
    return self._cache.__contains__(k)
AttributeError: 'NoneType' object has no attribute '__contains__'
------------

3. A dialog is displayed with something along these lines:
------------
Could not initialize the package information
An unresolvable problem occurred while initializing the package information.
Please report this bug against the 'update-manager' package and include the following error message:
'E:Type 't/screenlets/ppa/ubuntu' is not known on line 3 in source list /etc/apt/sources.list.d/screenlets-ppa-oneiric.list'
------------
And an obese menu appears in the corner of the screen. <http://imgur.com/a/pgGEf#2>

Besides the duplicates marked here, there are dozens of bug reports with particular examples of malformed sources.list, such as bug 128775, bug 163933, bug 164135, bug 176253, bug 183861, bug 241154, bug 311399, bug 350373, bug 358587, bug 416872, bug 432318, bug 470589, bug 617232, bug 617998, bug 677698, bug 728258, bug 753253, bug 799600, bug 830588, bug 835258, bug 879221, bug 880661, bug 886641, bug 890138, bug 927987, bug 947296, bug 981357, bug 1008359, bug 1009618, and bug 1063099.

Often these bug reports are marked as Incomplete or Invalid, or converted into questions, on the grounds that the user must have edited sources.list themselves. But Ubuntu should be robust enough to repair problems like this itself.

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in update-manager (Ubuntu):
status: New → Confirmed
Changed in update-manager (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → Low
Revision history for this message
Edward Donovan (edward.donovan) wrote :

I made this the master for bug 108601 and all its duplicates:

  Update-manager needs help info when terminating on wrong repositories and generally deal better with incorrect sources.list data

since that bug has a lot of garbage comments, making it hard to read. The first couple comments are articulate, though. Also, the launchpad questions related to that bug don't show up here. Just a lot of evidence that users are running into problems with update-manager blowing up on sources.list entries.

Perhaps that bug could be seen as having a slightly larger scope, but I think the basic needs are the same. Thanks.

Changed in aptdaemon (Ubuntu):
assignee: nobody → Matthew Paul Thomas (mpt)
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in aptdaemon (Ubuntu):
status: New → Confirmed
description: updated
summary: - improve handling of broken sources.list files
+ Poor handling of broken sources.list files
Revision history for this message
Matthew Paul Thomas (mpt) wrote :

I'm going to work on a detailed design for this, but here's what I'm thinking so far:

If Software Updater does an automatic check, OR you launch it manually, OR you launch Ubuntu Software Center, when sources.list is invalid, then:

a. aptdaemon puts up a dialog explaining the problem and illustrating how it can fix it for you

b. if you choose to fix it, an error tracker dialog appears giving you the option to report the error

c. the program launches as normal.

Perhaps (a) and (b) should be around the other way. Or perhaps they can be merged by introducing a new variation of the RecoverableError dialog.

Revision history for this message
svein-roar (sveinroaraas) wrote : RE: [Bug 886273] Re: Poor handling of broken sources.list files
Download full text (6.7 KiB)

Thank you so much for using time on this issue.
I`m today using Mac, but I will by a new machine to connect to Linuxprograms as soon as I have time and energy to follow up.
Br,
Svein

> Date: Mon, 17 Dec 2012 17:43:35 +0000
> From: <email address hidden>
> To: <email address hidden>
> Subject: [Bug 886273] Re: Poor handling of broken sources.list files
>
> I'm going to work on a detailed design for this, but here's what I'm
> thinking so far:
>
> If Software Updater does an automatic check, OR you launch it manually,
> OR you launch Ubuntu Software Center, when sources.list is invalid,
> then:
>
> a. aptdaemon puts up a dialog explaining the problem and illustrating
> how it can fix it for you
>
> b. if you choose to fix it, an error tracker dialog appears giving you
> the option to report the error
>
> c. the program launches as normal.
>
> Perhaps (a) and (b) should be around the other way. Or perhaps they can
> be merged by introducing a new variation of the RecoverableError dialog.
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (108601).
> https://bugs.launchpad.net/bugs/886273
>
> Title:
> Poor handling of broken sources.list files
>
> Status in “aptdaemon” package in Ubuntu:
> Confirmed
> Status in “software-center” package in Ubuntu:
> New
> Status in “update-manager” package in Ubuntu:
> Triaged
>
> Bug description:
> Ubuntu Software Center 2.1.16.1, Ubuntu Maverick
> Ubuntu Software Center 5.1.11, Ubuntu 12.04 beta 1
>
> 1. echo "deb http://ppa.launchpad.net/tualatrix/ppa/ubuntu main #Ubuntu Tweak Stable Source" | sudo tee /etc/apt/sources.list.d/ubuntu-tweak-stable.list
> 2. software-center
> 3. update-manager
>
> What happens:
> 2. ----------
> Traceback (most recent call last):
> File "/usr/share/software-center/softwarecenter/db/pkginfo_impl/aptcache.py", line 222, in open
> self._cache = apt.Cache(GtkMainIterationProgress())
> File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 102, in __init__
> self.open(progress)
> File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 145, in open
> self._cache = apt_pkg.Cache(progress)
> SystemError: E:Malformed line 1 in source list /etc/apt/sources.list.d/ubuntu-tweak-stable.list (dist parse), E:The list of sources could not be read., E:The package lists or status file could not be parsed or opened.
> 2012-03-12 10:52:15,573 - softwarecenter.db.enquire - ERROR - _get_estimate_nr_apps_and_nr_pkgs failed
> Traceback (most recent call last):
> File "/usr/share/software-center/softwarecenter/db/enquire.py", line 115, in _get_estimate_nr_apps_and_nr_pkgs
> tmp_matches = enquire.get_mset(0, len(self.db), None, xfilter)
> File "/usr/share/software-center/softwarecenter/db/appfilter.py", line 74, in __call__
> if (not pkgname in self.cache and
> File "/usr/share/software-center/softwarecenter/db/pkginfo_impl/aptcache.py", line 241, in __contains__
> return self._cache.__contains__(k)
> AttributeError: 'NoneType' object has no attribute '__contains__'
> Traceback (most recent call last):
> File "/usr/bin/software-center", line 1...

Read more...

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in software-center (Ubuntu):
status: New → Confirmed
Revision history for this message
marcobra (Marco Braida) (marcobra) wrote :

i'm usually watch and group the answers on ubuntu...

The answers grouped here https://answers.launchpad.net/ubuntu/+source/apt
show common user trouble on apt errors

kabilakhan (kabilakhan)
Changed in aptdaemon (Ubuntu):
status: Confirmed → Incomplete
Changed in software-center (Ubuntu):
status: Confirmed → Opinion
Changed in update-manager (Ubuntu):
status: Triaged → Fix Released
Changed in software-center (Ubuntu):
status: Opinion → Fix Released
Changed in aptdaemon (Ubuntu):
status: Incomplete → Fix Released
Changed in software-center (Ubuntu):
status: Fix Released → Confirmed
Changed in aptdaemon (Ubuntu):
status: Fix Released → Confirmed
Changed in update-manager (Ubuntu):
status: Fix Released → Confirmed
Changed in aptdaemon:
status: New → Confirmed
Revision history for this message
monomakh (monomakh) wrote :

same problem on dist-upgrade from 13.04 to 13.10

Revision history for this message
gbet (gbetntong) wrote :

thanks

On Thursday, October 17, 2013 11:04 PM, Vladimir Plotnikov <email address hidden> wrote:

same problem on dist-upgrade from 13.04 to 13.10

--
You received this bug notification because you are subscribed to a
duplicate bug report (108601).
https://bugs.launchpad.net/bugs/886273

Title:
  Poor handling of broken sources.list files

To manage notifications about this bug go to:
https://bugs.launchpad.net/aptdaemon/+bug/886273/+subscriptions

Revision history for this message
Michel-Ekimia (michel.ekimia) wrote :

Hi , is there a corresponding bug on debian side ?

We try to list bugs that would definitely avoid using command line for users when apt cannot update.

Revision history for this message
Paul White (paulw2u) wrote :

software-center task is no longer valid as that package isn't included in any currently supported release of Ubuntu.

Changed in software-center (Ubuntu):
status: Confirmed → Invalid
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.