question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cache restore sometimes downloads ~0MB caches

See original GitHub issue

We use the cache for tools installed with asdf, and for perl libraries. We have a flaky bug where sometimes, the same cache that works fine on a branch doesn’t work on another branch, and a ~0MB archive is downloaded. This has been happening randomly over the last 6 months (maybe once every 30/40 pull request).

Example:

On both branches A and B, our install-dev-tools job sees that we haven’t updated anything, and gets a cache hit:

Post job cleanup.
Post job cleanup.
Cache hit occurred on the primary key Linux-yarn-cache-07a3008bf228aaf955d98ce084eb8e6b09b623263d80578af5b7d65840fbbbe3-v2, not saving cache.
Post job cleanup.
Cache hit occurred on the primary key Linux-perl-cache-391933be47fcbd2760fbcccebd7446cf5f0f10d80e572e5adeeb9c4f9f62b6e8-v2, not saving cache.
Post job cleanup.
Cache hit occurred on the primary key Linux-asdf-cache-8093192a4cdff5685410dbe3b09b322ef56cc2496b4af9cf83ac7196aafffb7c, not saving cache.

On branch A, the subsequent job, running tests, restores the cache and everything works well:

Run actions/cache@v2
  with:
    path: ~/.asdf
  
    key: Linux-asdf-cache-8093192a4cdff5685410dbe3b09b322ef56cc2496b4af9cf83ac7196aafffb7c
  env:
    PGUSER: postgres
    ASDF_DIR: /home/runner/.asdf
    ASDF_DATA_DIR: /home/runner/.asdf
    PERL5LIB: /home/runner/perl5/lib/perl5
    PERL_LOCAL_LIB_ROOT: /home/runner/perl5
    PERL_MB_OPT: --install_base '/home/runner/perl5'
    PERL_MM_OPT: INSTALL_BASE=/home/runner/perl5
Received 176160768 of 261546746 (67.4%), 167.8 MBs/sec
Received 261546746 of 261546746 (100.0%), 158.1 MBs/sec
Cache Size: ~249 MB (261546746 B)
/usr/bin/tar --use-compress-program zstd -d -xf /home/runner/work/_temp/301a4ee1-882b-4c9d-8005-1ffe324dadbb/cache.tzst -P -C /home/runner/work/cas-cif/cas-cif
Cache restored successfully

Cache restored from key: Linux-asdf-cache-8093192a4cdff5685410dbe3b09b322ef56cc2496b4af9cf83ac7196aafffb7c

Now, on branch B, for some reason, the cache is different, and the job fails later, because it is missing the executable the cache was supposed to restore. Note the difference in cache size

Run actions/cache@v2
  with:
    path: ~/.asdf
  
    key: Linux-asdf-cache-8093192a4cdff5685410dbe3b09b322ef56cc2496b4af9cf83ac7196aafffb7c
  env:
    PGUSER: postgres
    ASDF_DIR: /home/runner/.asdf
    ASDF_DATA_DIR: /home/runner/.asdf
    PERL5LIB: /home/runner/perl5/lib/perl5
    PERL_LOCAL_LIB_ROOT: /home/runner/perl5
    PERL_MB_OPT: --install_base '/home/runner/perl5'
    PERL_MM_OPT: INSTALL_BASE=/home/runner/perl5
Received 413443 of 413443 (100.0%), 5.8 MBs/sec
Cache Size: ~0 MB (413443 B)
/usr/bin/tar --use-compress-program zstd -d -xf /home/runner/work/_temp/77537a38-6e05-4b3b-9f00-eecc3d3b5904/cache.tzst -P -C /home/runner/work/cas-cif/cas-cif
Cache restored successfully

Cache restored from key: Linux-asdf-cache-8093192a4cdff5685410dbe3b09b322ef56cc2496b4af9cf83ac7196aafffb7c

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
matthieu-foucaultcommented, Aug 29, 2022

Nevermind, the issue my latest message above is expected behaviour due to misconfiguration of our workflow. Closing this issue, I’ll open a new one if I see this happening again with a properly configured workflow

0reactions
matthieu-foucaultcommented, Aug 29, 2022

Hi @kotewar , just encountered it now in https://github.com/bcgov/CONN-CCBC-portal/runs/8073512335?check_suite_focus=true:

Run actions/cache@v2
  with:
    path: ~/.asdf
  
    key: Linux-asdf-cache-fcc9bf91c47d06add757287d0fb86747258f3ba45ca5cc3de4a6a744ee1a6410
  env:
    PGPASSWORD: postgres
    PGUSER: postgres
    PGDATABASE: ccbc
    ASDF_DIR: /home/runner/.asdf
    ASDF_DATA_DIR: /home/runner/.asdf
    PERL5LIB: /home/runner/perl5/lib/perl5
    PERL_LOCAL_LIB_ROOT: /home/runner/perl5
    PERL_MB_OPT: --install_base '/home/runner/perl5'
    PERL_MM_OPT: INSTALL_BASE=/home/runner/perl5
Received 394868 of 394868 (100.0%), 1.4 MBs/sec
Cache Size: ~0 MB (394868 B)
/usr/bin/tar --use-compress-program zstd -d -xf /home/runner/work/_temp/d6403261-63cd-4882-9d71-178db5f5faa7/cache.tzst -P -C /home/runner/work/CONN-CCBC-portal/CONN-CCBC-portal
Cache restored successfully
Read more comments on GitHub >

github_iconTop Results From Across the Web

Shader Pre-caching are not detected in client beta (2021 Aug 4)
The Steam Shader Pre-caching is listed as 0MB in the client beta instead of the previous value (GB+) in stable client. Every time...
Read more >
Please HELP! Download 80% to 0% after Clear cache
I got an error corrupted download and i follow the steam guide that i must clear cache to continue download and then it...
Read more >
How Do I Fix My Caching Problems Or Clear Web Browser's ...
Try holding down the Shift key while pressing the Refresh button. Close your browser and re-open it (make sure you are NOT on...
Read more >
Do Not Let NPM Cache Snowball on CI - Gleb Bahmutov
The action first tries to restore this folder ~/.npm on CI by looking up caches stored for this project. Every cache has a...
Read more >
How to Reset or Clear Microsoft Windows Store Cache in ...
Downloading of Windows Store applications is one the new features of Windows 10/8. Sometimes, you might encounter issues where the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found