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

failed to SAVE IMAGE with two docker repos #3930

Open
rougsig opened this issue Mar 21, 2024 · 5 comments
Open

failed to SAVE IMAGE with two docker repos #3930

rougsig opened this issue Mar 21, 2024 · 5 comments
Labels
type:bug Something isn't working

Comments

@rougsig
Copy link

rougsig commented Mar 21, 2024

What went wrong?
Error: failed to SAVE IMAGE: server message: insufficient_scope: authorization failed

Do that pipeline:

docker login -u user1
// Was successfully pushed
earthly --ci --push +docker --IMAGE=user1/app:latest

docker logout
docker login -u user2
// Error: failed to SAVE IMAGE: server message: insufficient_scope: authorization failed
// All build was cached
earthly --ci --push +docker --IMAGE=user2/app:latest

We can swap user2 to be first and it will be successfully pushed for user2, but not for both.

What should have happened?
Successfully pushed

@rougsig rougsig added the type:bug Something isn't working label Mar 21, 2024
@rougsig
Copy link
Author

rougsig commented Mar 21, 2024

As workaround we can add --no-cache to build command and it will be pushed successfully for two repos

@rougsig
Copy link
Author

rougsig commented Mar 21, 2024

It looks like SAVE IMAGE knows that the image was pushed and wants to add a new tag. But it is an another user to another repository.

@rougsig
Copy link
Author

rougsig commented Mar 21, 2024

сс containerd/containerd#2865

@rougsig
Copy link
Author

rougsig commented Mar 21, 2024

As one more workaround, add just after FROM
ARG --required DOCKER_USER
RUN echo $DOCKER_USER > user.txt

In the result all layers below will be with another hashes, and both users will be pushed. At least all other caches will work, rather than --no-cache workaround.

@idodod
Copy link
Contributor

idodod commented Mar 22, 2024

Thanks for reporting the issue @rougsig.
I happened to encounter it myself just now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

2 participants