Bug 461154

Summary: Not very helpful error message from rpm when importing keys
Product: [Fedora] Fedora Reporter: Bruno Wolff III <bruno>
Component: rpmAssignee: Panu Matilainen <pmatilai>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 9CC: ffesti, jnovy, pnasrat
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-02-05 12:20:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Bruno Wolff III 2008-09-04 16:26:46 UTC
Description of problem:
I was try to import an old pgp key using rpm and the import failed with a message that didn't say why the import failed. Presumably it can't handle the particular key version (though gpg does with an "idea" lib installed).

Version-Release number of selected component (if applicable):
rpm-4.4.2.3-2.fc9.x86_64

How reproducible:
100%


Steps to Reproduce:
1. Try to import the key shown below using rpm.
2.
3.
  
Actual results:
[root@cerberus rpm-gpg]# cat bruno; rpm -vv --import bruno
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.9 (GNU/Linux)

mQCNAi4QRoMAAAEEANdxLMwIrLVJj298ORThEmEELSkHRNhtR8afomd8dKJOLE3r
PKB4maGwQoOQPcOvATBhtQbOGLw9aLYdqOBqXi2o33y89TilRAneH0fKIRVDhwXr
bpT+JBwU4FNRXyoQ0jJInIPnellqMVBxVtjajiWhZ8/qKOz14auclAPcXnktAAUR
tCBCcnVubyBXb2xmZiBJSUkgPGJydW5vQHdvbGZmLnRvPokAlQMFE0WdzOKrnJQD
3F55LQEBTC4EAIHVLVDxBARGpnT7u3yT9Nj0qoUISCnqrkOICRgr3a6i6JQpmt+V
WG36wtch0YrcJZ6AB6ugGPdAt5zQ1KJkNCW+JfgJRVFSJV/3kGJVqRGmHmhFK0uV
dLsFsGOFRQKu+Rj0sJ9XQqtToODOTRSg76ngn4ysgh1ywatLimWn8ezD
=S/q8
-----END PGP PUBLIC KEY BLOCK-----
D: opening  db environment /var/lib/rpm/Packages joinenv
D: opening  db index       /var/lib/rpm/Packages create mode=0x42
D: locked   db index       /var/lib/rpm/Packages
error: bruno: import failed.
D: closed   db index       /var/lib/rpm/Packages
D: closed   db environment /var/lib/rpm/Packages
D: May free Score board((nil))


Expected results:
An error message giving some hint as to why the import failed.

Additional info:

Comment 1 Jindrich Novy 2008-09-04 17:07:29 UTC
Just FYI, on rawhide rpm it seems to work:

rpm -vv --import bruno 
D: loading keyring from pubkeys in /var/lib/rpm/pubkeys/*.key
D: couldn't find any keys in /var/lib/rpm/pubkeys/*.key
D: loading keyring from rpmdb
D: opening  db environment /var/lib/rpm/Packages cdb:mpool:joinenv
D: opening  db index       /var/lib/rpm/Packages rdonly mode=0x0
D: locked   db index       /var/lib/rpm/Packages
D: opening  db index       /var/lib/rpm/Name rdonly mode=0x0
D:  read h#      44 Header sanity check: OK
D: added key gpg-pubkey-66534c2b-457c5f4f to keyring
D:  read h#     136 Header sanity check: OK
D: added key gpg-pubkey-4f2a6fd2-3f9d9d3b to keyring
D:  read h#     293 Header sanity check: OK
D:  read h#     301 Header sanity check: OK
D: added key gpg-pubkey-a109b1ec-3f6e28d5 to keyring
D:  read h#     341 Header sanity check: OK
D: added key gpg-pubkey-1ac70ce6-41bebeef to keyring
D: Using legacy gpg-pubkey(s) from rpmdb
D: closed   db index       /var/lib/rpm/Name
D: closed   db index       /var/lib/rpm/Packages
D: closed   db environment /var/lib/rpm/Packages
D: opening  db environment /var/lib/rpm/Packages cdb:mpool:joinenv
D: opening  db index       /var/lib/rpm/Packages create mode=0x42
D: opening  db index       /var/lib/rpm/Name create mode=0x42
D: adding "gpg-pubkey" to Name index.
D: opening  db index       /var/lib/rpm/Group create mode=0x42
D: adding "Public Keys" to Group index.
D: opening  db index       /var/lib/rpm/Providename create mode=0x42
D: adding 2 entries to Providename index.
D: opening  db index       /var/lib/rpm/Provideversion create mode=0x42
D: adding 2 entries to Provideversion index.
D: opening  db index       /var/lib/rpm/Installtid create mode=0x42
D: adding 1 entries to Installtid index.
D: opening  db index       /var/lib/rpm/Pubkeys create mode=0x42
D: adding 1 entries to Pubkeys index.
D: closed   db index       /var/lib/rpm/Pubkeys
D: closed   db index       /var/lib/rpm/Installtid
D: closed   db index       /var/lib/rpm/Provideversion
D: closed   db index       /var/lib/rpm/Providename
D: closed   db index       /var/lib/rpm/Group
D: closed   db index       /var/lib/rpm/Name
D: closed   db index       /var/lib/rpm/Packages
D: closed   db environment /var/lib/rpm/Packages

Comment 2 Bruno Wolff III 2008-09-04 20:44:26 UTC
Thanks. I'll try to confirm that myself, but I won't get a chance until very late tonight or tomorrow.

Comment 3 Bruno Wolff III 2008-09-05 17:32:07 UTC
I forced an rpm update using the rawhide version of rpm and was able to import the key.
I am not sure it will really work yet (for verifying packages), but that is a different issue and if a fix is needed it will be generating a new key in a more recent format.
The other thing that may be still worth looking at, is if the error message can  be improved to provide more information in the event that an import fails.

Comment 4 Panu Matilainen 2009-02-05 12:20:18 UTC
Hmm, this is actually the same thing as 462979. Reason for failure is completely different, but the message is just as uninformative in both cases, which is what this bug seems to be about.

*** This bug has been marked as a duplicate of bug 462979 ***