redhat-actions / podman-login

GitHub Action to log into a container image registry. For use with podman, buildah, and skopeo.
https://github.com/marketplace/actions/podman-login
MIT License
50 stars 15 forks source link

[BUG] (Self-hosted arm64 runner) Error: Error: ENOENT: no such file or directory, open '/tmp/podman-run-0/containers/auth.json' #41

Open yuravk opened 3 months ago

yuravk commented 3 months ago

Version

redhat-actions/podman-login@v1

Describe the bug

The action fails on self-hosted runner because of the error:

Error: Error: ENOENT: no such file or directory, open '/tmp/podman-run-0/containers/auth.json'

However log in to quay.io succeed.

Steps to reproduce, workflow links, screenshots

The action runs on AlmaLinux (Red Hat binary compatible OS) arm64 based self-hosted runner:

# cat /etc/redhat-release 
AlmaLinux release 9.4 (Seafoam Ocelot)
# uname -m
aarch64

The workflow raw log:

2024-08-01T16:00:16.4675431Z ##[group]Run redhat-actions/podman-login@v1
2024-08-01T16:00:16.4676162Z with:
2024-08-01T16:00:16.4677195Z   username: ***
2024-08-01T16:00:16.4677930Z   password: ***
2024-08-01T16:00:16.4678376Z   registry: ***
2024-08-01T16:00:16.4678767Z   logout: false
2024-08-01T16:00:16.4679168Z env:
2024-08-01T16:00:16.4679522Z   LATEST_MAJOR: 9
2024-08-01T16:00:16.4679933Z   IMAGE_NAME: almalinux-bootc
2024-08-01T16:00:16.4680380Z ##[endgroup]
2024-08-01T16:00:16.6707726Z ##[group]/usr/bin/podman version
2024-08-01T16:00:16.6710120Z [command]/usr/bin/podman version
2024-08-01T16:00:16.7317432Z Client:       Podman Engine
2024-08-01T16:00:16.7343319Z Version:      4.9.4-rhel
2024-08-01T16:00:16.7420044Z API Version:  4.9.4-rhel
2024-08-01T16:00:16.7420990Z Go Version:   go1.21.11 (Red Hat 1.21.11-1.el9_4)
2024-08-01T16:00:16.7421792Z Built:        Wed Jul 24 09:17:01 2024
2024-08-01T16:00:16.7481393Z OS/Arch:      linux/arm64
2024-08-01T16:00:16.7482785Z ##[endgroup]
2024-08-01T16:00:16.7484038Z [command]/usr/bin/podman login *** -u *** -p *** --verbose
2024-08-01T16:00:17.3922216Z Used:  /run/containers/0/auth.json
2024-08-01T16:00:17.3922982Z Login Succeeded!
2024-08-01T16:00:17.3994396Z ✅ Successfully logged in to *** as ***
2024-08-01T16:00:17.3995344Z Exporting REGISTRY_AUTH_FILE=/tmp/podman-run-0/containers/auth.json
2024-08-01T16:00:17.4034249Z ##[error]Error: ENOENT: no such file or directory, open '/tmp/podman-run-0/containers/auth.json'

The workflow link: https://github.com/yuravk/bootc-images/actions/runs/10201571885/job/28223790588#step:4:25

nzwulfin commented 2 months ago

I ran into this issue on a similar host and found this to work when running as root in the buildah container, added to with:

      auth_file_path: /run/containers/0/auth.json
yuravk commented 2 months ago

Tried that as well. Fails with:

2024-08-05T07:44:52.0017077Z [command]/usr/bin/podman login *** -u *** -p *** --verbose --authfile=/run/containers/0/auth.json
2024-08-05T07:44:52.5977018Z Used:  /run/containers/0/auth.json
2024-08-05T07:44:52.6026821Z Login Succeeded!
2024-08-05T07:44:52.6054295Z ✅ Successfully logged in to *** as ***
2024-08-05T07:44:52.6055253Z Exporting REGISTRY_AUTH_FILE=/run/containers/0/auth.json
2024-08-05T07:44:52.6057019Z ✍️ Writing registry credentials to "/root/.docker/config.json"
2024-08-05T07:44:52.6104257Z ##[error]Error: ENOENT: no such file or directory, open '/root/.docker/config.json'

The workflow: https://github.com/yuravk/bootc-images/actions/runs/10244618540/job/28337995308

nzwulfin commented 2 months ago

I reported an issue on that error to (#42 ), my current workaround there is to use a local custom buildah container that includes this line from (#39 )

RUN echo "{ \"auths\": {} }" > $HOME/.docker/config.json

Then I use that container as the runner instead of the upstream buildah stable image on quay