KPackageKit gives error after recent upgrade

Bug #546607 reported by Kilz on 2010-03-25
280
This bug affects 44 people
Affects Status Importance Assigned to Milestone
packagekit (Ubuntu)
Undecided
fort
Lucid
Undecided
Unassigned
Maverick
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

Kilz (kilz) wrote :

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

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).

Octavian Voicu (octavian-voicu) wrote :
Octavian Voicu (octavian-voicu) wrote :
T L R (tlr) on 2010-05-07
Changed in packagekit (Ubuntu):
status: New → Confirmed
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

ArangeL (softwarej) wrote :

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

Changed in packagekit (Ubuntu):
status: Confirmed → Fix Committed
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.

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.

Tigran (donkikos) wrote :

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

ArangeL (softwarej) wrote :

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

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) on 2010-05-15
Changed in packagekit (Ubuntu):
status: Fix Committed → Fix Released
status: Fix Released → Fix Committed
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

$ 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.

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".

Hi all,

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

Cheers,
Holger

papukaija (papukaija) on 2010-07-26
tags: added: lucid maverick
tags: added: patch
Changed in packagekit (Ubuntu Maverick):
status: Fix Committed → Fix Released
tags: added: iso-testing
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... :)

Oleg Tsarev (tsarev) wrote :

Please, provide update to Kubuntu 10.04 (LTS version)

Changed in packagekit (Ubuntu Lucid):
status: New → Opinion

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).

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) on 2012-10-10
affects: packagekit (Ubuntu) → gnome-packagekit (Ubuntu)
Matthias Klumpp (ximion) on 2012-10-10
affects: gnome-packagekit (Ubuntu) → packagekit (Ubuntu)
fort (cup-90) on 2012-10-10
Changed in packagekit (Ubuntu):
assignee: nobody → fort (cup-90)
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.