Bug 1623528

Summary: yumdownloader doesn't work as non-root: https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/os/Packages/iproute-4.11.0-14.el7.x86_64.rpm: [Errno 14] curl#58 - "unable to load client key: -8178 (SEC_ERROR_BAD_KEY)"
Product: Red Hat Enterprise Linux 7 Reporter: Richard W.M. Jones <rjones>
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED WONTFIX QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.6CC: khowell, mdomonko, packaging-team-maint, rjones
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-25 14:16:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 910269    

Description Richard W.M. Jones 2018-08-29 14:35:09 UTC
Description of problem:

$ yumdownloader --destdir /tmp iproute
Loaded plugins: product-id, subscription-manager
Repo rhel-7-server-extras-rpms forced skip_if_unavailable=True due to: /etc/pki/entitlement/5977450362948290138-key.pem
Repo rhel-7-server-rh-common-rpms forced skip_if_unavailable=True due to: /etc/pki/entitlement/5977450362948290138-key.pem
Repo rhel-7-server-rpms forced skip_if_unavailable=True due to: /etc/pki/entitlement/5977450362948290138-key.pem
Repo rhel-7-server-optional-rpms forced skip_if_unavailable=True due to: /etc/pki/entitlement/5977450362948290138-key.pem
iproute-4.11.0-14.el7.x86_64.r FAILED                                          
https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/os/Packages/iproute-4.11.0-14.el7.x86_64.rpm: [Errno 14] curl#58 - "unable to load client key: -8178 (SEC_ERROR_BAD_KEY)"
Trying other mirror.
iproute-4.11.0-14.el7.x86_64: [Errno 256] No more mirrors to try.

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

yum-utils-1.1.31-46.el7_5.noarch

How reproducible:

100%

Steps to Reproduce:
1. See description above.

Comment 2 Richard W.M. Jones 2018-08-29 14:36:43 UTC
Can be fixed by:

$ sudo chmod 0644 /etc/pki/entitlement/*

but this really shouldn't be necessary.

Comment 4 Kevin Howell 2018-10-18 14:21:52 UTC
> $ sudo chmod 0644 /etc/pki/entitlement/*

What were the permissions originally? I assume this is as a non-root user?

Comment 5 Richard W.M. Jones 2018-10-18 15:19:36 UTC
(In reply to Kevin Howell from comment #4)
> > $ sudo chmod 0644 /etc/pki/entitlement/*
> 
> What were the permissions originally?

I've no idea, I didn't knowingly touch any of these files.

> I assume this is as a non-root user?

Yes, running yumdownloader as non-root.

Comment 6 Richard W.M. Jones 2018-10-18 15:23:09 UTC
Do you mean before I chmod'd them?  Again, I'm not sure, except
they were not readable as non-root before.

What's interesting is that no RPM contains these files.  It seems as
if they were created as a side effect of something else
(perhaps running S-M?) and because they are not readable as
non-root, that breaks yumdownloader.

Comment 7 Kevin Howell 2018-10-25 14:16:01 UTC
Given that installing packages requires root, and a simple chmod should do the trick, we're not going to support this use case.

FWIW, on my local machine, the permissions were 644 by default, maybe the umask setting affects this? Either way a simple `sudo chmod 644 -R /etc/pki/entitlement` works if you hit this.