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

Catch push credentials error and retry auth with reauth #16

Open
rsyring opened this issue Oct 1, 2024 · 0 comments
Open

Catch push credentials error and retry auth with reauth #16

rsyring opened this issue Oct 1, 2024 · 0 comments

Comments

@rsyring
Copy link
Member

rsyring commented Oct 1, 2024

I was recently trying to deploy with mu and ran into problems with two different projects where the docker login before push would seemingly work but then the push would fail. Workaround: rm ~/.docker/config.json

I believe the root cause is described here. TL;DR: docker uses previously cached credentials even when logging in with new ones. This is apparently a feature not a bug.

The docker library we use offers a reauth option for .login() which probably resolves this error when it occurs. I wasn't able to test because I deleted the docker config and that resolve my problems.

I think we could try the push first, catch exceptions, if auth related, do a reauth login, and then push again. That would save the ecr.get_authorization_token() on every push and only fetch it when needed.

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

1 participant