GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Cache entry from default branch considered out of scope for reusable workflow run on tag · Issue #1491 · actions/cache

Cache entry from default branch considered out of scope for reusable workflow run on tag #1491

New issue
Copy link
New issue
Copy link
Open
Open
Cache entry from default branch considered out of scope for reusable workflow run on tag#1491
Copy link

Description

@SanjayVas
SanjayVas
opened on Oct 31, 2024
Issue body actions

According to Restrictions for accessing a cache:

Workflow runs can restore caches created in either the current branch or the default branch (usually main).

I have a reusable workflow that is called from a workflow that runs on a tag ref. It's not finding the cache entry from the default branch (main in my case).

##[debug]No matching cache found for cache key 'cache-trivy-2024-10-29', version 'cfdc2bcf67bb1c3559bbfba62a7ed98abe2868ecc65f79ee627e58280adbf4d3 and scope refs/tags/nightly/20241028.1. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key 
##[debug]Other caches with similar key:
##[debug]Cache Key: cache-trivy-2024-10-29, Cache Version: 07dc9f6516584e901e644e11f92897f94dbdb6b82f1dda2bb2c3e7fd20bb931a, Cache Scope: refs/heads/main, Cache Created: 2024-10-29T05:13:41.6566667Z

Both workflows run on ubuntu-latest, so this should not be a cross-OS issue.

Reacted by Maxim Ivanov and Jacob Page
Reacted by Maxim Ivanov and Tim Chen

Activity

  1. SanjayVas commented on Oct 31, 2024

    @SanjayVas
    SanjayVas
    on Oct 31, 2024
    Author
    More actions

    I think I figured this out. The GitHub Actions cache version includes the path and does not disambiguate equivalent paths. Therefore the relative path .cache/trivy-cache results in a different version than the absolute path /home/runner/work/cross-media-measurement/cross-media-measurement/.cache/trivy.

  2. ulidtko commented on Nov 6, 2024

    @ulidtko
    ulidtko
    on Nov 6, 2024
    More actions

    I'm also struggling with this.

    On a (non-default) branch release/7.8, I've got a workflow run with actions/cache (v4.1.2) saying:

    Cache saved with key: CI-deps-v0||lts-22.20||59dbd1d2726b5396d15660895bdbfa6ade3bf971f197c99c9372255fd0e439c7

    But soon after, when the tip commit of this branch gets tagged, triggering another run, actions/cache says:

    Cache not found for input keys: CI-deps-v0||lts-22.20||59dbd1d2726b5396d15660895bdbfa6ade3bf971f197c99c9372255fd0e439c7, CI-deps-v0||lts-22.20||, CI-deps-v0||

    This cache is absolutely there, I can see it on https://github.com/org/repo/actions/caches URL.

    How do I get this to work? Tag-triggered workflow to pick up cache created on the same branch?

    @SanjayVas did you figure it out? I don't think relative/absolute paths is relevant; in my case it is a "non-reusable" workflow yaml, so the with.paths specified are exact same between store & restore.

    Dear @Link-, @jww3, any insight from you as the last releasers?

  3. jtristano commented on Nov 7, 2024

    @jtristano
    jtristano
    on Nov 7, 2024
    More actions

    I have the same problem

    gh actions-cache list
    Total caches size 25.19 MB
    
    Showing 3 of 3 cache entries in divergent3d/design-app-nx-plugin
    
    cache-name  12.59 MB  refs/tags/0.0.35             2 minutes ago
    cache-name   12.59 MB  refs/tags/0.0.34             8 minutes ago
    cache-name   12.59 MB  refs/heads/my_branch 11 minutes ago
    

    The cache has limited use and will bloat if I need to create it upon every release

    Reacted by Maxim Ivanov
  4. SanjayVas commented on Nov 7, 2024

    @SanjayVas
    SanjayVas
    on Nov 7, 2024
    Author
    More actions

    @SanjayVas did you figure it out? I don't think relative/absolute paths is relevant; in my case it is a "non-reusable" workflow yaml, so the with.paths specified are exact same between store & restore.

    Yes. My issue was indeed that the workflow that saves the cache used the relative path, whereas the action that restores the cache used the absolute path. Since I didn't write the action, I updated my saving workflow to use the absolute path as well. This resolved the issue for me.

  5. ulidtko commented on Nov 8, 2024

    @ulidtko
    ulidtko
    on Nov 8, 2024
    More actions

    Well, I believe the issue is much wider, and not related to paths.

    In particular, because what helped me was pinning to 4.0.2:

    -      uses: actions/cache@v4
    +      uses: actions/[email protected] # pinned due to https://github.com/actions/cache/issues/1491

    This implies that somewhere in v4.0.2..v4.1.2 a new bug was released.

    Steps to reproduce

    • have a tag-triggered workflow using actions/cache

    Expected result

    Cache works: can and does restore existing cache entries.

    Actual result

    Cache not found for input keys

  6. pkepa-c8y commented on Nov 29, 2024

    @pkepa-c8y
    pkepa-c8y
    on Nov 29, 2024
    More actions

    We also have a problem with getting the cache from the default main branch.

    Update of cache looks like this and It is done on the default main branch via cron.

         - name: Cache DBs
            uses: actions/cache/save@v4
            with:
              path: ${{ github.workspace }}/.cache/trivy
              key: cache-trivy-${{ steps.date.outputs.date }}

    Error:

    ##[debug]Resolved Keys:
    ##[debug]["cache-trivy-2024-11-29","cache-trivy-"]
    ##[debug]Checking zstd --quiet --version
    ##[debug]1.4.8
    ##[debug]zstd version: 1.4.8
    ##[debug]Resource Url: https://acghubeus1.actions.githubusercontent.com/M6NJow4UHymyf4TLHNvio2UC1SZrO84VocFZLFsYGxYq1TCGis/_apis/artifactcache/cache?keys=cache-trivy-2024-11-29%2Ccache-trivy-&version=d5988625b0a42be8b506c17c1f92f9afe0f75ac7b29c3434b3f3d8c5e908d3a0
    ##[debug]Resource Url: https://acghubeus1.actions.githubusercontent.com/M6NJow4UHymyf4TLHNvio2UC1SZrO84VocFZLFsYGxYq1TCGis/_apis/artifactcache/caches?key=cache-trivy-2024-11-29
    ##[debug]No matching cache found for cache key 'cache-trivy-2024-11-29', version 'd5988625b0a42be8b506c17c1f92f9afe0f75ac7b29c3434b3f3d8c5e908d3a0 and scope refs/heads/trivy_cache_test. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key 
    ##[debug]Other caches with similar key:
    ##[debug]Cache Key: cache-trivy-2024-11-29, Cache Version: 8f58c66a22afa34cd169e0a37af6dc8721535ebdeb355c04c644ff2177efde7d, Cache Scope: refs/heads/main, Cache Created: 2024-11-29T00:33:55.01Z
    ##[debug]Failed to delete archive: Error: ENOENT: no such file or directory, unlink ''
    Cache not found for input keys: cache-trivy-2024-11-29, cache-trivy-

    Cache is available on the list:
    image

    Point out what we are doing wrong because at this moment we have run out of ideas...

  7. graemechristie commented on Mar 7, 2025

    @graemechristie
    graemechristie
    on Mar 7, 2025
    More actions

    I'm also seeing these case misses with the trivy action. The actions/cache version is set by the trivvy action so it is not something we can update (i.e. to v4.0.2 as per above) without forking thier action .. was there ever any resolution to this ?

  8. ulidtko commented on Mar 7, 2025

    @ulidtko
    ulidtko
    on Mar 7, 2025 via email
    More actions
    Hey @graemechristie, no -- the issue stands open. As above, in my case **downgrading** to v4.0.2 (not the latest) was viable workaround.
  9. KtorZ
    added a commit that references this issue on Mar 7, 2025

    Document `path` behaviour and access restrictions

    d722552
  10. ulidtko commented on Mar 26, 2025

    @ulidtko
    ulidtko
    on Mar 26, 2025
    More actions

    Also reproduces on actions/[email protected]:

    Image

    — and yet, the action claims Cache not found for input keys:

    Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.