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

ENOENT: no such file or directory, stat 'image-layers/xxxxxxx/layer.tar' #75

Open
clems4ever opened this issue Nov 23, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@clems4ever
Copy link

Hello,

First, thank you for the great action that you have created. We have been facing a strange error lately on version 0.0.4 and the same error after upgrading to 0.0.8. This action is running on linux (ubuntu-latest).

Here is the issue that we are facing and I was wondering if this would ring a bell to you?

image

The issue can be seen with this build: https://github.com/criteo/JVips/runs/1441932624

Can you please help me find out what I can check further to solve that error? In the meantime I set the continue-on-error flag in https://github.com/clems4ever/JVips/commit/59a3bd7737df4dd2b261af2124009a370be3ee1c but I'd like to have your point of view on this error anyway.

Thank you in advance.

@clems4ever clems4ever added the bug Something isn't working label Nov 23, 2020
@satackey
Copy link
Owner

satackey commented Dec 6, 2020

This action uses the workflow name Build and release as a key for the cache; the error seems to be due to the fact that both Windows and Linux builds share a key.

If you manually set a key for each job, this cache should work well.
https://github.com/satackey/action-docker-layer-caching#inputs

@rcowsill
Copy link
Contributor

rcowsill commented Dec 7, 2020

Yes, it does look like the shared cache is causing the problem in the case above. That said, it's possible to get the same error on a single-job workflow if it ever runs concurrently: https://github.com/rcowsill/layer-cache-test/actions?query=branch%3Amain

In that test I committed "Test 3, Step 2" before the run for "Test 3, Step 1" had written its cache. The second job can't save all its layer cache files because one already exists. That results in a corrupted cache, making the "Test 3, Step 3" run fail.

This can happen because the extracted tar output from docker save uses symlinks for layers with identical contents. For a set of layers with the same content, one will have a full copy of layer.tar and the others have a symlink to that. This error happens if the cache contains a symlink without the corresponding layer.tar when this line is reached:

const layerTars = (await recursiveReaddir(fromDir))

I'm going to try changing the action to save only the real layer.tar files and keep all the symlinks in the root cache. As well as fixing this issue it should make the caching more efficient. If it works it'll be possible to share caches across jobs too, though that might need some further changes.

EDIT: The proof of concept works on Linux: https://github.com/rcowsill/layer-cache-test/actions?query=branch%3Atest%2F75-fix
On Windows jobs it fails due to #87.

@rcowsill
Copy link
Contributor

See discussion #97 for more detail on a proposed fix for this.

@JPMoresmau
Copy link

I am still getting this issue on version 11:

Error: Error: ENOENT: no such file or directory, stat '/home/runner/work/_actions/satackey/action-docker-layer-caching/v0.0.11/dist/ttsc-dist/.adlc/image-layers/18bf75313098a3270fa0787659dc50475861705f6596a8fdfacf2dea982adc26/layer.tar'

Rerunning the workflow results in the same error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants