Problems installing package signature from Python script

Bug #1116503 reported by Till Kamppeter
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
aptdaemon (Ubuntu)
Invalid
High
Unassigned
packagekit (Ubuntu)
Invalid
Medium
Unassigned
system-config-printer (Ubuntu)
Fix Released
High
Till Kamppeter

Bug Description

I use PackageKit to auto-download printer driver packages using the script /usr/share/system-config-printer/install-printerdriver.py (part of the system-config-printer-gnome package). For Epson's drivers the signature with ID 8AA65D56 is needed and the "gpg" command line tool has no problem to load it:

----------
till@till-lenovo:/usr/lib/cups/backend$ gpg --recv-keys 8AA65D56
gpg: requesting key 8AA65D56 from hkp server subkeys.pgp.net
gpg: key 8AA65D56: "Seiko Epson Corporation (Epson Inkjet Printer Driver) <email address hidden>" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
till@till-lenovo:/usr/lib/cups/backend$
----------

So it exists and is valid.

But if I let package kit install it via its Python bindings I get

----------
till@till-raring:/usr/lib/cups/backend$ python
Python 2.7.3 (default, Jan 26 2013, 15:27:43)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from gi.repository import GLib, PackageKitGlib
>>> pk = PackageKitGlib.Client()
>>> def progress(progress, type, user_data):
... return
...
>>> res = pk.install_signature(PackageKitGlib.SigTypeEnum.GPG, '8AA65D56', '', None, progress, None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/gi/types.py", line 113, in function
    return info.invoke(*args, **kwargs)
gi._glib.GError: Failed to download and install the key 8AA65D56 from hkp://keyserver.ubuntu.com:80:

>>>
----------

What is going wrong here?

description: updated
Revision history for this message
Matthias Klumpp (ximion) wrote :

I am not sure if this is properly implemented in PackageKit's Apt backend. Can you please download & install PackageKit >= 0.8.x from Debian Experimental (or use my PK snapshot PPA: https://launchpad.net/~ximion/+archive/packagekit ) and test it with this, more recent version? (The one in Ubuntu is outdated)
Also, do you use a proxy? Is network properly set up? Because maybe PK just has problems downloading the data.
Also, do you use PackageKit and not the Aptdaemon compat layer? (Simply test it by running "sudo /usr/lib/packagekit/packagekitd --verbose" - If the command is present, you use PackageKit. Alternatively you can also test if the "packagekit" package is installed.)
Cheers,
   Matthias

Changed in packagekit (Ubuntu):
importance: High → Medium
status: New → Incomplete
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

I do not use a proxy and my network seems to be working, as I am regularly updating the system and the updates get downloaded without any problems. I also can load the key with the gpg utility.

As you can see below I am using the Aptdaemon compat layer, packagekitd is not installed.

Do I then still have to test PackageKit >= 0.8.x? Probably a fix there will not help much as standard installations of Ubuntu use aptdaemon.

Adding aptdaemon task.

till@till-lenovo:/usr/lib/cups/backend$ sudo /usr/lib/packagekit/packagekitd --verbose
[sudo] password for till:
sudo: /usr/lib/packagekit/packagekitd: command not found
till@till-lenovo:/usr/lib/cups/backend$ dpkg -l | grep packagekit
ii gir1.2-packagekitglib-1.0 0.7.6-2 amd64 GObject introspection data for the PackageKit GLib library
ii libpackagekit-glib2-14:amd64 0.7.6-2 amd64 Library for accessing PackageKit using GLib
ii packagekit-backend-aptcc 0.7.6-2 amd64 APT backend for PackageKit
ii python-packagekit 0.7.6-2 all PackageKit backend Python bindings
till@till-lenovo:/usr/lib/cups/backend$ dpkg -l | grep aptdaemon
ii aptdaemon 0.45+bzr883-0ubuntu1 all transaction based package management service
ii aptdaemon-data 0.45+bzr883-0ubuntu1 all data files for clients
ii python-aptdaemon 0.45+bzr883-0ubuntu1 all Python 2 module for the server and client of aptdaemon
ii python-aptdaemon-gtk 0.45+bzr883-0ubuntu1 all Transitional dummy package
ii python-aptdaemon.gtk3widgets 0.45+bzr883-0ubuntu1 all Python 2 GTK+ 3 widgets to run an aptdaemon client
ii python-aptdaemon.gtkwidgets 0.45+bzr883-0ubuntu1 all Python GTK+ 2 widgets to run an aptdaemon client
ii python3-aptdaemon 0.45+bzr883-0ubuntu1 all Python 3 module for the server and client of aptdaemon
ii python3-aptdaemon.gtk3widgets 0.45+bzr883-0ubuntu1 all Python 3 GTK+ 3 widgets to run an aptdaemon client
ii python3-aptdaemon.pkcompat 0.45+bzr883-0ubuntu1 all PackageKit compatibilty for AptDaemon
ii software-center-aptdaemon-plugins 0.1.5 all The aptdaemon plugins for software-center
till@till-lenovo:/usr/lib/cups/backend$

Changed in packagekit (Ubuntu):
status: Incomplete → New
Changed in aptdaemon (Ubuntu):
importance: Undecided → High
milestone: none → ubuntu-13.04-feature-freeze
Matthias Klumpp (ximion)
Changed in packagekit (Ubuntu):
status: New → Invalid
Revision history for this message
Sebastian Heinlein (glatzor) wrote :

For security reasons the short key ID isn't enough. Could you please try E5E86C008AA65D56 instead.

I will check why we don't get a better error message here.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

I get exactly the same error with the longer key ID.

In addition, "gpg" seems to use always only the short IDs:

----------
till@till-lenovo:/usr/lib/cups/backend$ gpg --recv-keys E5E86C008AA65D56
gpg: requesting key 8AA65D56 from hkp server subkeys.pgp.net
gpg: key 8AA65D56: "Seiko Epson Corporation (Epson Inkjet Printer Driver) <email address hidden>" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
till@till-lenovo:/usr/lib/cups/backend$
----------

To test the whole thing, run

/usr/bin/python /usr/share/system-config-printer/install-printerdriver.py epson-inkjet-printer-escpr 'deb http://download.ebz.epson.net/dsc/op/stable/debian/ lsb3.2 main' 8AA65D56

on a Raring machine, in a terminal window on the desktop (not SSHed from another machine).

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

glatzor, thanks for the hint, using the full 40-character fingerprint instead of the 8-character key ID works. I am changing system-config-printer appropriately now.

Changed in system-config-printer (Ubuntu):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Till Kamppeter (till-kamppeter)
milestone: none → ubuntu-13.04-feature-freeze
Changed in system-config-printer (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package system-config-printer - 1.3.11+20120807-0ubuntu13

---------------
system-config-printer (1.3.11+20120807-0ubuntu13) raring; urgency=low

  * debian/patches/30_driver-autodownload.patch: Use the full 40-character
    key fingerprint instead of the 8-character key ID as key ID when retreiving
    the signature key from a keyserver to verify auto-downloaded printer
    driver packages (LP: #1116503).
 -- Till Kamppeter <email address hidden> Thu, 7 Feb 2013 19:31:18 +0100

Changed in system-config-printer (Ubuntu):
status: Fix Committed → Fix Released
Changed in aptdaemon (Ubuntu):
status: New → 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.