RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1800815 - "podman login" writes auth.json in a location "skopeo copy" does not expect
Summary: "podman login" writes auth.json in a location "skopeo copy" does not expect
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: skopeo
Version: 8.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.3
Assignee: Jindrich Novy
QA Contact: atomic-bugs@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: 1186913 1804543
TreeView+ depends on / blocked
 
Reported: 2020-02-07 22:54 UTC by Ken Dreyer (Red Hat)
Modified: 2023-12-15 17:17 UTC (History)
14 users (show)

Fixed In Version: skopeo-1.0.0 and newer
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-04 03:05:10 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1627819 1 None None None 2023-10-11 14:14:42 UTC
Red Hat Knowledge Base (Solution) 5189301 0 None None None 2021-06-08 13:29:48 UTC

Internal Links: 1627819

Description Ken Dreyer (Red Hat) 2020-02-07 22:54:21 UTC
Description of problem:
"podman login" writes its credentials in such a way that "skopeo copy" cannot use them.

Version-Release number of selected component (if applicable):
podman-1.6.4-3.module+el8.2.0+5399+beb15b66.x86_64
skopeo-0.1.40-8.module+el8.2.0+5352+afaeb1b9.x86_64

How reproducible:
always

Steps to Reproduce:
1. Obtain an account token that has write access to a registry.
2. Log in like so:
   sudo podman login -p **** -u unused docker-registry.example.com
3. Verify the output says "Login succeeded!"
4. Run "skopeo copy" like so:
   sudo skopeo copy docker://origin.com/mycontainer:latest docker://docker-registry.example.com/mycontainer:latest

Actual results:
Error uploading manifest latest to docker-registry.example.com/mycontainer: unauthorized: authentication required 

Expected results:
The copy operation proceeds without error.

Additional info:
This exact same set of commands works fine in Fedora 30 with podman-1.7.0-3.fc30 and skopeo-0.1.40-2.fc30. I have tested this in completely new RHEL 8.1 and Fedora 30 VMs.

In RHEL 8:
"podman login" stores its credentials in this file: /run/user/0/containers/auth.json
But "skopeo copy" is trying to read this file:
/run/containers/0/auth.json

On Fedora 30, podman and skopeo both use this file:
/run/containers/0/auth.json

When I move the file on my RHEL 8 system to the correct location, then skopeo is able to successfully copy images:

mkdir -p /run/containers/0/
mv /run/user/0/containers/auth.json /run/containers/0/

skopeo copy ...

Comment 1 Ken Dreyer (Red Hat) 2020-02-07 22:59:42 UTC
When I downgrade to podman-1.4.2-6.module+el8.1.0+4830+f49150d7.x86_64 , "podman login" correctly writes to /run/containers/0/auth.json .

Comment 2 Ken Dreyer (Red Hat) 2020-02-07 23:18:05 UTC
Reading the source of libpod-5cc9284.tar.gz, I see now that podman will use XDG_RUNTIME_DIR if that is set. That env variable is indeed defined on RHEL 8 VM. I think this means podman respects XDG_RUNTIME_DIR and skopeo does not.

Comment 3 Ken Dreyer (Red Hat) 2020-02-07 23:33:41 UTC
Even when I unset the XDG_RUNTIME_DIR environment variable, I am still unable to get podman to write its auth file to anywhere other than /run/user/0/containers/auth.json

Comment 4 Daniel Walsh 2020-02-08 13:13:06 UTC
I think this is more of a skopeo bug then a Podman bug, although we should consolidate all of the code to find the auth files into one library and share it between all of the tools.

Comment 5 Tom Sweeney 2020-02-10 23:45:14 UTC
Adding Qi to the cc list as she's been dealing with buildah and podman login and may have thoughts.

Comment 6 Tom Sweeney 2020-06-03 23:54:16 UTC
This is fixed in Skopeo v1.0 which will included in RHEL 8.3.  There is now a `skopeo login` and `skopeo logout` command that handles the authorization needs of Skopeo.

Setting to Post and assigning to Jindrich so he can handle any BZ or packaging needs.

Comment 14 errata-xmlrpc 2020-11-04 03:05:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: container-tools:rhel8 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:4694


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