'Job A' unable to access cache of downstream 'Job B'
See original GitHub issueHeya! I have these two jobs where Job B needs Job A: https://github.com/returntocorp/semgrep/blob/a9e8b90c2e3de705c54ca311b414608ffaa32ff7/.github/workflows/tests.yml#L15-L67
Both jobs do this:
uses: actions/cache@v3
with:
path: ocaml-build-artifacts.tgz
key: foo
But only Job B ever builds that artifact, while Job A only tries to restore it to see if Job B can be skipped altogether.
Now, I don’t see why this wouldn’t work, but it does not, see these logs:
- Job A fails to restore the cache: https://github.com/returntocorp/semgrep/runs/6823861478?check_suite_focus=true#step:5:38
- Job B successfully restores the cache: https://github.com/returntocorp/semgrep/runs/6823863765?check_suite_focus=true#step:6:61
I would expect the restore to succeed in Job A as well.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
github - Share cache between distinct jobs - Stack Overflow
GitHub Action says that cache is restored successfully in job2 , however, in job2 I can't find my_file in the directory where I...
Read more >Downstream pipelines have issues with predefined variables
In pipeline 295993300, we see the job created in the downstream project. The MY_DIR variable ( ${CI_PROJECT_DIR}/cache ) is not expanded. The ...
Read more >Failed auto triggers for downstream jobs · Issue #7518 - GitHub
I wanted to highlight that we use set_pipeline: self in many of these pipelines. We usually require any other job to wait until...
Read more >Deep Diving into CircleCI Workspaces
This post is a follow-on of our overview of persisting data in Workflows. To learn all about how to best use workspaces, caching...
Read more >Guide: SSD Particle Caching in CryoSPARC
When you run jobs that have the Cache particle images on SSD option turned ... When installing CryoSPARC, you can use the parameter...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@underyx this is happening because of two different OS containers. Due to that, in Job A case
zstd
is used for compression. Can be inferred from logsIn Job B,
zstd
is not found and hence it falls back togzip
Whenever compression technique is different, the caches are treated as unique even though cache-key is same. Otherwise the de-compression will fail.
The fix is either to use same OS or ensure that same tools (e.g.
zstd
) is installed on both.Have updated the error message to show other versions on cache miss if debug is on: https://github.com/actions/toolkit/blob/main/packages/cache/src/internal/cacheHttpClient.ts#L132 Closing this issue