-
Notifications
You must be signed in to change notification settings - Fork 386
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 compute cache key' error with invalid symbolic link #1067
Comments
This might possibly be related to #1062 in which the file is being accessed without being explicitly referenced? We can most definitely improve the error message here. We do have an experimental |
In our case we got this error with the following line: |
I am seeing something similar. This Earthfile works with Earthly v0.5.16 but not with v0.5.17:
I think it's because many of the files that have been saved as artifacts are symbolic links to |
@jamesalucas I encountered the same yesterday. v0.5.15 works, v0.5.17 does not. |
@jamesalucas I too am getting the same error; thanks for reproducing the bug, that'll make it easier for us to fix. |
under v0.5.15, earthly is resolving symlinks when copying a specific file:
In this case the However when copying a directory containing a symlink, earthly is not copying the contents of the file like in the above example, but instead maintains the symlinks, e.g.
This used to work under |
narrowing this down a bit more, this builds:
output:
HOWEVER, changing it to this:
fails:
|
I'm still working at the issue. I noticed a similar problem exists in docker; consider a Dockerfile such as: # syntax=docker/dockerfile:1
FROM alpine:3.13
RUN mkdir /root/datastore
RUN echo -n thedata > /root/datastore/data.txt
RUN mkdir /root/symlinks
RUN ln -s /root/datastore/data.txt /root/symlinks/datalink
RUN rm /root/datastore/data.txt
FROM alpine:3.13
WORKDIR /root
COPY --from=0 /root/symlinks/* .
RUN ls -la this outputs the same error:
and this makes a bit of sense, as the file was removed after I linked it, but before the second target could copy it. I'm still leaning towards restoring our old functionality where we just made a symlink even if it doesn't point to a valid file. |
I also think this is also the way forward, it should be possible to copy a broken symlink imho. |
#1067 reported the issue when dealing with wildcards; this updates the test to match that use case. The case of copying an individual invalid symlink never worked in earlier versions of earthly. Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
* Introduce a --no-follow option for copying The --no-follow option will instruct buildkit not to follow symlinks. This is helpful for cases where one wishes to copy an invalid symlink. Signed-off-by: Alex Couture-Beil <alex@earthly.dev> * adjust test to work for reported issue #1067 reported the issue when dealing with wildcards; this updates the test to match that use case. The case of copying an individual invalid symlink never worked in earlier versions of earthly. Signed-off-by: Alex Couture-Beil <alex@earthly.dev> * extend --no-follow flag for SAVE ARTIFACT This allows users to save an invalid symlink when the symlink is directly referenced. Signed-off-by: Alex Couture-Beil <alex@earthly.dev> * update expected ast test results to reflect new copy.earth tests that have been added. Signed-off-by: Alex Couture-Beil <alex@earthly.dev> * rename --no-follow to --symlink-no-follow make the flag extra clear on what it does Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
We have released https://github.com/earthly/earthly/releases/tag/v0.5.18 which contains the new |
failed to compute cache key: "/src/deps/oban_web/lib/oban_web/lib/oban_web" not found: not found
This is the tree, as you can see it contains an invalid symlink.
Is this a docker bug or an earthly bug? I'm not sure what the correct behavior should be here, throw a more clear error?
The text was updated successfully, but these errors were encountered: