Bug 828909 - Unable to import GPG key to consumer from server
Unable to import GPG key to consumer from server
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Infrastructure (Show other bugs)
Unspecified Unspecified
unspecified Severity medium (vote)
: Unspecified
: 6.0
Assigned To: Martin Bacovsky
Sachin Ghai
: Triaged
Depends On: 1022462
  Show dependency treegraph
Reported: 2012-06-05 11:04 EDT by Martin Bacovsky
Modified: 2014-09-18 12:47 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-07-02 10:06:58 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
package install success (97.48 KB, image/png)
2013-10-23 05:15 EDT, Sachin Ghai
no flags Details
package installed on client (43.76 KB, image/png)
2014-06-19 08:38 EDT, Sachin Ghai
no flags Details

  None (edit)
Description Martin Bacovsky 2012-06-05 11:04:45 EDT
Description of problem:
I tried to install signed package on a consumer system using UI. The install failed with 
  YumBaseError: Didn't install any keys
in the pulp.log

Once the associated GPG key is manually imported (e.g. using yum) to the consumer the install works fine.

Problem is the installpackages method from the Pulp server API does not support
the importKeys parameter (despite the callback __installpackages seems to implement that)

Version-Release number of selected component (if applicable):

How reproducible:
Always (when the key is not imported on consumer)

Steps to Reproduce:
1. try to install signed package form repo with associated GPG key
 (from UI or CLI [kk system packages --name cons1 --install cow])

Actual results:
[root@katest ~]# kk system packages --name cons1 --install cow 
Performing remote action [ 6156e6dc-af1f-11e1-8aff-525400d85dff ]... 
Remote action failed:
Didn't install any keys

Expected results:
Imports missing GPG key and and install succeeds
(I assume it is safe from security perspective)

Additional info:
Change in Pulp API will be necessary before fixing our code
Comment 1 Bryan Kearney 2013-09-23 10:41:31 EDT
I believe this is in.
Comment 2 Sachin Ghai 2013-10-23 05:13:55 EDT
Verified with snap6 compose3


I didn't face the reported issue. I installed a package on consumer via UI. And  it imports the gpg-key on client automatically. I did not import it manually on client

gpgcheck was enabled under redhat.repo and  I installed zsh package on client.

Please see the screenshot.
Comment 3 Sachin Ghai 2013-10-23 05:15:44 EDT
Created attachment 815295 [details]
package install success
Comment 4 Sachin Ghai 2013-10-23 06:42:33 EDT
From cli: 

on server:
[root@cloud-qe-8 ~]# katello -u admin -p admin system packages --install zsh --name dhcp201-165.englab.pnq.redhat.com --env DEV --org "Katello Infrastructure"
Performing remote action [ 38f25ded-6434-43d9-bf95-5e9090dfee00 ]... 
Remote action finished:zsh-4.3.10-5.el6.x86_64
[root@cloud-qe-8 ~]# 

on client:
[root@dhcp201-165 ~]# rpm -qa | grep zsh
[root@dhcp201-165 ~]# rpm -qa | grep zsh
Comment 5 Sachin Ghai 2013-10-23 06:44:34 EDT
For custom repos, gpgcheck always set to '0', not sure what is expected there. So filed a bz 1022462. Once that clarified, I'll verify this too.
Comment 6 Og Maciel 2013-10-24 19:09:05 EDT
Punting it to MDP3 since this is blocked by https://bugzilla.redhat.com/show_bug.cgi?id=1022462
Comment 7 Sachin Ghai 2014-06-19 08:35:34 EDT
Verified with sat6 beta snap10. For custom repos, if you associate the key with repo while creation then it is set to '1' in redhat.repo on client, otherwise set to '0'

[root@shost yum.repos.d]# yum repolist
Loaded plugins: package_upload, product-id, security, subscription-manager
This system is receiving updates from Red Hat Subscription Management.
ACME_Corporation_fake_zoo                                                                                                      | 2.1 kB     00:00     
ACME_Corporation_fake_zoo/primary                                                                                              | 3.7 kB     00:00     
ACME_Corporation_fake_zoo                                                                                                                       32/32
repo id                                                                            repo name                                                    status
ACME_Corporation_fake_zoo                                                          zoo                                                          32
repolist: 32
[root@shost yum.repos.d]# cat redhat.repo 
# Certificate-Based Repositories
# Managed by (rhsm) subscription-manager
# If this file is empty and this system is subscribed consider 
# a "yum repolist" to refresh available repos

name = zoo
baseurl = https://dhcp207-55.lab.eng.pnq.redhat.com/pulp/repos/ACME_Corporation/Library/custom/fake/zoo
enabled = 1
gpgcheck = 1
gpgkey = https://dhcp207-55.lab.eng.pnq.redhat.com/katello/api/repositories/11/gpg_key_content
sslverify = 1
sslcacert = /etc/rhsm/ca/candlepin-local.pem
sslclientkey = /etc/pki/entitlement/752459387118277068-key.pem
sslclientcert = /etc/pki/entitlement/752459387118277068.pem
Comment 8 Sachin Ghai 2014-06-19 08:37:16 EDT
I installed package from UI and key was auto imported on client. I installed cow package on client.

logs from client:

[root@shost ~]# rpm -qa | grep gpg-pubkey
[root@shost ~]# rpm -qa | grep cow
[root@shost ~]# 

Please see screenshot for package install from server. It was successfully installed and key is imported on client too.
Comment 9 Sachin Ghai 2014-06-19 08:38:25 EDT
Created attachment 910372 [details]
package installed on client
Comment 10 Bryan Kearney 2014-07-02 10:06:58 EDT
This was delivered with 6.0.3, which is the Satellite 6 Beta.

Note You need to log in before you can comment on or make changes to this bug.