Skip to content

Catch push credentials error and retry auth with reauth #16

@rsyring

Description

@rsyring

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions