Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docker] Failed to authorize in new workflow #1255

Closed
BadMannersXYZ opened this issue Sep 6, 2024 · 6 comments
Closed

[docker] Failed to authorize in new workflow #1255

BadMannersXYZ opened this issue Sep 6, 2024 · 6 comments

Comments

@BadMannersXYZ
Copy link
Contributor

BadMannersXYZ commented Sep 6, 2024

Follow-up of #1251

The latest builds on main seem to be failing due to an unauthorized error related to a missing token.

The exact error is:

ERROR: failed to push shish2k/shimmie2:latest: failed to authorize: failed to fetch oauth token: unexpected status from GET request to https://auth.docker.io/token?scope=repository%3A***%2Fshimmie2%3Apull%2Cpush&service=registry.docker.io: 401 Unauthorized

This is not a login issue, as that step succeeds in the workflow. Nor is this a permission issue, as a read+write token is all that's necessary.

@BadMannersXYZ
Copy link
Contributor Author

Actually, I'm not sure if a personal access token is being used as a secret for the DOCKER_PASSWORD variable. Looking at containerd/nerdctl#3378, that seems to be the proposed solution, and it matches my own working setup.

@BadMannersXYZ
Copy link
Contributor Author

I've managed to reproduce the issue. Indeed, using the regular password instead of an access token while 2FA is enabled causes the 401 Unauthorized error.

I've also made sure that switching the password in the repo secrets to a read/write personal access token solves the issue.

@shish
Copy link
Owner

shish commented Sep 6, 2024

I thought that it was already using a PAT, but maybe I'm thinking of all my other projects, and this one predates them... shall give that a go /o/

@shish
Copy link
Owner

shish commented Sep 6, 2024

Still failing with a fresh token D:

@shish
Copy link
Owner

shish commented Sep 6, 2024

Looks like all the different things that I tried for DOCKER_REGISTRY were incorrect, and the default seems to be correct (but the default isn't documented anywhere so I don't know what that value actually is)

If somebody wants to be able to push to a different registry we can re-add that flag, if somebody tells me what the correct value is 😅

@BadMannersXYZ
Copy link
Contributor Author

Huh, that's weird! Never would've guessed that was the reason. But now that it builds I tried pulling the image to my Raspberry Pi, and it works! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants