Bug 828909 - Unable to import GPG key to consumer from server
Unable to import GPG key to consumer from server
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Infrastructure (Show other bugs)
6.0.0
Unspecified Unspecified
unspecified Severity medium (vote)
: Unspecified
: 6.0
Assigned To: Martin Bacovsky
Sachin Ghai
: Triaged
Depends On: 1022462
Blocks:
  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:
Environment:
Last Closed: 2014-07-02 10:06:58 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
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):
pulp-1.1.10-1.el6.noarch
katello-0.2.39-1.el6.noarch


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

katello-1.4.6-44.el6sat.noarch
katello-qpid-client-key-pair-1.0-1.noarch
katello-configure-1.4.7-7.el6sat.noarch
katello-glue-elasticsearch-1.4.6-44.el6sat.noarch
katello-foreman-all-1.4.6-44.el6sat.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
ruby193-rubygem-foreman-katello-engine-0.0.17-6.el6sat.noarch
katello-common-1.4.6-44.el6sat.noarch
pulp-katello-plugins-0.2-1.el6sat.noarch
katello-configure-foreman-1.4.7-7.el6sat.noarch
katello-cli-1.4.3-26.el6sat.noarch
katello-certs-tools-1.4.4-1.el6sat.noarch
katello-qpid-broker-key-pair-1.0-1.noarch
katello-selinux-1.4.4-4.el6sat.noarch
katello-glue-pulp-1.4.6-44.el6sat.noarch
katello-glue-candlepin-1.4.6-44.el6sat.noarch
katello-cli-common-1.4.3-26.el6sat.noarch
katello-all-1.4.6-44.el6sat.noarch
ruby193-rubygem-katello_api-0.0.3-4.el6sat.noarch
signo-katello-0.0.23-2.el6sat.noarch
ruby193-rubygem-katello-foreman-engine-0.0.12-3.el6sat.noarch


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
zsh-4.3.10-5.el6.x86_64
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
#

[ACME_Corporation_fake_zoo]
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
gpg-pubkey-f78fb195-4f0d5ba1
[root@shost ~]# rpm -qa | grep cow
cow-2.2-3.noarch
[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.