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

Cannot save images locally when tag is too long #2053

Closed
dchw opened this issue Jul 26, 2022 · 6 comments · Fixed by #2216
Closed

Cannot save images locally when tag is too long #2053

dchw opened this issue Jul 26, 2022 · 6 comments · Fixed by #2216
Assignees
Labels
type:bug Something isn't working

Comments

@dchw
Copy link
Collaborator

dchw commented Jul 26, 2022

Take, for example, this Earthfile:

VERSION 0.6

long-tag:
    FROM alpine:3.16
    RUN echo "hi" > test
    SAVE IMAGE docker.io/this-is-a-super-long-company-name/and-a-super-duper-long-image-name:also-a-very-long-long-long-long-tag-for-reals

It fails with this error:

Error: build target: build main: failed to solve: image pull: 1 error occurred:
        * command failed: docker pull 127.0.0.1:8371/sess-3jrbwgudg3htkxk6z1rz8xghs/pullping:dockeriothisisasuperlongcompanynameandasuperduperlongimagenamealsoaverylonglonglonglongtagforreals-nYUCXTV4HWTYmiMRYFFl9m1yJj9beNnQ: exit status 1: invalid reference format: exit status 1

(https://ci.earthly.dev/logs?logId=a75aa13b-6caf-4a7c-b40b-44bf0c8010ba)

It appears that the additional metadata added to the image tag for the internal registry creates a tag that is too long.

It is possible to workaround this failure with --no-output, or by shortening your tags; but we should have a better way to handle this that doesn't depend on unbounded input from the user.

@dchw
Copy link
Collaborator Author

dchw commented Jul 26, 2022

It has been observed by members of our community that this appears to be a regression in v0.6.20, as this appears to work in v0.6.19.

@dchw
Copy link
Collaborator Author

dchw commented Jul 26, 2022

After further investigation, this regressions was introduced in #1982

@dchw dchw added the type:bug Something isn't working label Jul 26, 2022
@alexcb alexcb self-assigned this Jul 26, 2022
andyli added a commit to giffon/charleywong that referenced this issue Aug 19, 2022
@kclejeune
Copy link

commenting to mention that I'm encountering this issue as well when pushing images that are tagged with long branch names

@vyas-n
Copy link

vyas-n commented Sep 18, 2022

Hi folks,

I also ran into the same issue using Docker Desktop for macOS with Earthly.
For me, it was this setting that caused the error to appear:

Screen Shot 2022-09-18 at 01 56 14

When enabled, it seems to mess with the container registry settings that are incompatible with any recent version of Earthly (I tested with 0.6.14, 0.6.19, & 0.6.22).

Disabling the setting fixed it for me.

@vladaionescu
Copy link
Member

Thanks for reporting @vyas-n - that actually seems like a distinct issue. I've opened #2217 to track that separately.

vladaionescu added a commit that referenced this issue Sep 23, 2022
Fixes #2053

Co-authored-by: Vlad A. Ionescu <vladaionescu@users.noreply.github.com>
@vladaionescu
Copy link
Member

The fix for this is going out in the next release v0.6.25+

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
None yet
Development

Successfully merging a pull request may close this issue.

5 participants