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 Not Found After Previous Successful Caching: Windows (latest)

See original GitHub issue

YAML File is fairly straightforward.

...
jobs:
  build:
    runs-on: windows-latest
    
    steps:
    - uses: actions/checkout@v2
    - uses: bazelbuild/setup-bazelisk@v1
    
    - name: Cache Build
          uses: actions/cache@v2
          env:
            cache-name: build-cache
          with:
            path: |
              ~/_bazel_runneradmin/*/action_cache
              ~/_bazel_runneradmin/*/execroot
              ~/_bazel_runneradmin/*/external
              ~/_bazel_runneradmin/*/server
            key: ${{ runner.os }}-${{ env.cache-name }}
...

In one repository, the cache works just fine, albeit slow (~ 4.5 mins to unravel ~1GB). I went to set up a second repository with the exact same code with the following output:

Post job cleanup.
C:\Windows\System3[2](https://github.com/J-B-Blankenship/[private_repository]/runs/5135821556?check_suite_focus=true#step:11:2)\tar.exe --posix -z -cf cache.tgz -P -C D:/a/[private_repository]/[private_repository] --files-from manifest.txt
Cache Size: ~952 MB (9984257[3](https://github.com/J-B-Blankenship/[private_repository]/runs/5135821556?check_suite_focus=true#step:11:3)[4](https://github.com/J-B-Blankenship/[private_repository]/runs/5135821556?check_suite_focus=true#step:11:4) B)
Cache saved successfully
Cache saved with key: Windows-build-cache

The next pull request rolls in:

Run actions/cache@v[2](https://github.com/J-B-Blankenship/[private_repository]/runs/5135821556?check_suite_focus=true#step:4:2)
  with:
    path: ~/_bazel_runneradmin/*/action_cache
  ~/_bazel_runneradmin/*/execroot
  ~/_bazel_runneradmin/*/external
  ~/_bazel_runneradmin/*/server
  
    key: Windows-build-cache
  env:
    cache-name: build-cache
Cache not found for input keys: Windows-build-cache

The only thing I can think of is that during the setup of the repository, the default branch was set to “main”. I manually reverted this back to the traditional “master”. All other repository settings are identical.

Any help would be greatly appreciated, including the rather long “Run actions/cache@v2” step.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:16

github_iconTop GitHub Comments

1reaction
bishal-pdMSFTcommented, Sep 11, 2022

Running through this old thread, I can see two things which probably need to be called out clearly in documentation.

  1. The cache uniqueness is also identified by the path used. Same cache cannot be used if path is different across workflows/runs.
  2. PR check runs won’t share the cache unless the cache is created by the base branch for PRs
0reactions
bishal-pdMSFTcommented, Nov 7, 2022

README is updated to add more details about how version is computed https://github.com/actions/cache/pull/971

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot Connected Cache - Configuration Manager
First, verify the registry properties are configured correctly: HKLM\SOFTWARE\Microsoft\Delivery Optimization In-Network Cache . For example, ...
Read more >
How Do I Fix My Caching Problems Or Clear Web Browser's ...
Close your browser and re-open it (make sure you are NOT on the cached page) and delete your temporary Internet files (clear your...
Read more >
Caching Dependencies - CircleCI
These errors are often caused by missing users, users with different UIDs, and missing paths. Use extra care when caching files in these...
Read more >
Caching dependencies to speed up workflows - GitHub Docs
If there are no exact matches, the action searches for partial matches of the restore keys. When the action finds a partial match,...
Read more >
Debugging and diagnosing cache misses - Gradle User Manual
Finding problems with task output caching; Helpful data for diagnosing a cache ... Like with the previous test, you should have no remote...
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