KPackageKit gives error after recent upgrade

Bug #546607 reported by Kilz
280
This bug affects 44 people
Affects Status Importance Assigned to Milestone
packagekit (Ubuntu)
Fix Released
Undecided
fort
Lucid
Opinion
Undecided
Unassigned
Maverick
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: packagekit

Here is the error

Error Type:
Error Value: coercing to Unicode: need string or buffer, exceptions.SystemError found
File : /usr/share/PackageKit/helpers/apt/aptBackend.py, line 2216, in
main()
File : /usr/share/PackageKit/helpers/apt/aptBackend.py, line 2213, in main
run(args, options.single)
File : /usr/share/PackageKit/helpers/apt/aptBackend.py, line 2175, in run
backend.dispatcher(args)
File : /usr/lib/python2.6/dist-packages/packagekit/backend.py, line 699, in dispatcher
self.dispatch_command(args[0], args[1:])
File : /usr/lib/python2.6/dist-packages/packagekit/backend.py, line 606, in dispatch_command
self.refresh_cache(force)
File : /usr/share/PackageKit/helpers/apt/aptBackend.py, line 202, in _locked_cache
func(*args, **kwargs)
File : /usr/share/PackageKit/helpers/apt/aptBackend.py, line 1498, in refresh_cache
format_string(error.message))
File : /usr/lib/python2.6/dist-packages/packagekit/backend.py, line 723, in format_string
txt = unicode(text, encoding, errors='replace')

1) The release of Ubuntu you are using, Kubuntu 10.04 beta 1
2) The version of the package you are using - .kpackagekit-0.5.4-0ubuntu3(amd64)
3) What you expected to happen - Trying to update the os.
4) What happened instead - Got error when checking for updates

Revision history for this message
Kilz (kilz) wrote :

I found that the error was caused by a misspelled line I added to software sources.

Revision history for this message
Octavian Voicu (octavian-voicu) wrote :

The bug is in /usr/share/PackageKit/helpers/apt/aptBackend.py, line 1498. In case of an error, format_string is used to display a message but error.message is not a string but an exceptions.SystemError object.

Attached patch should fix this (packagekit-backend-apt.patch).

There is also a related bug in /usr/share/pyshared/packagekit/backend.py, in function format_string. When called with a non-unicode parameter, it should convert it to unicode but doesn't because of a typo.

I'll attach another patch for this (python-packagekit.patch).

Revision history for this message
Octavian Voicu (octavian-voicu) wrote :
Revision history for this message
Octavian Voicu (octavian-voicu) wrote :
T L R (tlr)
Changed in packagekit (Ubuntu):
status: New → Confirmed
Revision history for this message
Octavian Voicu (octavian-voicu) wrote :

Btw, the bug is triggered by any error while downloading sources (for example, a HTTP 404 error caused by an invalid repository).

Can someone test the patches / integrate them into the right tree?

Thanks

Revision history for this message
ArangeL (softwarej) wrote :

I have tested the patch. All fixed. Thanks :-)

Changed in packagekit (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
J Bruni (jbruni) wrote :

I just got this error here. My question is:

How to update the system and get the fix, if KPackageKit is currently broken?

Thanks.

Revision history for this message
Octavian Voicu (octavian-voicu) wrote :

I'm not very sure, but I think the update process is not really affected by the bug. The package index might be refreshed before the bug is triggered, so in this case you could update the packages (maybe restart KPackageKit and see if the updates are there).

If this doesn't work, open a terminal and type: sudo apt-get update

This will update the package index manually and after that you should be able to install the updates from KPackageKit, or via command line: sudo apt-get upgrade

Also, you might wanna look at the output of command `sudo apt-get update' and see which sources give errors (for example 404 errors), and disable those sources in KPackageKit -> Settings -> Edit Software Sources. Disabling the source that was giving errors will make KPackageKit work again, even without the bug fix.

Revision history for this message
Tigran (donkikos) wrote :

I disabled cdrom source which was not mounted and update went without errors. Thanks to Octavian Voicu.

Revision history for this message
ArangeL (softwarej) wrote :

How do we release the patched KPackagekit to upgrade Ubuntu 10.04?

Revision history for this message
J Bruni (jbruni) wrote :

I also wish to thank brilliant feedback. Octavian answered my beginner's question with lots of useful information, politely, and with patience (not to mention quickly). Community spirit at its best. Thanks!

FYI, I just ran KPackageKit again and all worked fine! :-) Maybe the cause of the error message for me was due to a temporary HTTP issue? I don't know... The fact is that a successful update using KPackageKit just happened here.

Vadim (vadim-malyutin)
Changed in packagekit (Ubuntu):
status: Fix Committed → Fix Released
status: Fix Released → Fix Committed
Revision history for this message
Jonathan Riddell (jr) wrote :

I've uploaded packagekit 0.5.7-0ubuntu3 to ppa:jr please run

sudo apt-add-repository ppa:jr
sudo apt-get update
sudo apt-get install packagekit-backend-apt

and check if this bug is fixed or not

Revision history for this message
Octavian Voicu (octavian-voicu) wrote :

$ sudo apt-get upgrade
...
The following packages will be upgraded:
  libpackagekit-glib2-12 libpackagekit-qt-12 packagekit packagekit-backend-apt python-packagekit
...

I can confirm the bug is fixed in your packages. I added an invalid source and made sure the bug was still there before the upgrade, and it was. After the upgrade I no longer get any kind of error/warning after refreshing package cache from KPackageKit.

Maybe warnings/errors encountered during update should be shown as such, so the user knows something went wrong (missing repository, missing keys etc). Anyway, this would be the subject of another bug/feature report.

Revision history for this message
Octavian Voicu (octavian-voicu) wrote :

Scratch the last thing I said -- the error was shown in the system tray with a red warning icon: "one message from the package manager".

Revision history for this message
meisterplanlos (meisterplanlos) wrote :

Hi all,

patch seems to work fine. Until now, I haven't seen any new error message.

Cheers,
Holger

papukaija (papukaija)
tags: added: lucid maverick
tags: added: patch
Changed in packagekit (Ubuntu Maverick):
status: Fix Committed → Fix Released
tags: added: iso-testing
Revision history for this message
Shaved Wookie (shavedwookie) wrote :

JR's patched Kpackagekit fixes the issue for me. Thanks! Great job. Now I can get back checking for updates to all my daily ppa's compulsively... :)

Revision history for this message
Oleg Tsarev (tsarev) wrote :

Please, provide update to Kubuntu 10.04 (LTS version)

Changed in packagekit (Ubuntu Lucid):
status: New → Opinion
Revision history for this message
Martin Wilhelm (martin-m-wilhelm) wrote :

To fix the problem for 10.04 pakets available at ppa:jr with version 5.7-0ubuntu3.0 are still necessary. The patches have currently not been merged into the update repository (Lucid-updates (0.5.7-0ubuntu2.2): main/admin).

Revision history for this message
C. Hintermüller (nothere) wrote :

how far are the backports to Lucid 10.04 LTS of the patches to this bug. Oleg Tsarev has requested them on November 3rd 2010 and 6 Month later (June 2011) the same bug (at least in case of http 404 address not found ) still exists in Lucid 10.04 LTS and 10.04 LTS server with KDE based user interface. When to expect the backports is there any estimated release date?
Greetings
Christoph

fort (cup-90)
affects: packagekit (Ubuntu) → gnome-packagekit (Ubuntu)
Matthias Klumpp (ximion)
affects: gnome-packagekit (Ubuntu) → packagekit (Ubuntu)
fort (cup-90)
Changed in packagekit (Ubuntu):
assignee: nobody → fort (cup-90)
Revision history for this message
Matthias Klumpp (ximion) wrote :

@fort: Why are you touching this old bugreport? There is really nothing to see here :-P Also, this was clearly a bug in the PackageKit Apt backend, so it belongs to the "packagekit" source package.

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.