cache icon indicating copy to clipboard operation
cache copied to clipboard

Conflict: cache entry with the same key, version, and scope already exists

Open cderv opened this issue 10 months ago • 1 comments

We are using this action for caching Julia packages. I just wanted to share that today we are hitting this problem

  • https://github.com/actions/cache/issues/1541

also reported in community

  • https://github.com/orgs/community/discussions/151213

without changing our workflow.

We do

      - name: Setup Julia
        uses: julia-actions/setup-julia@v2
        with:
          version: "1.11.3"

      - name: Cache Julia Packages
        uses: julia-actions/cache@v2

Then installing packages in workflow step.

julia --color=yes --project=. -e "import Pkg; Pkg.instantiate(); Pkg.build(\"IJulia\"); Pkg.precompile()"

Post Step for Julia cache gives now


Post job cleanup.
Post job cleanup.
      Active manifest files: 1 found
      Active artifact files: 85 found
      Active scratchspaces: [2](https://github.com/quarto-dev/quarto-cli/actions/runs/13398814382/job/37424367989?pr=12108#step:62:2) found
     Deleted no artifacts, repos, packages or scratchspaces
Post job cleanup.
/usr/bin/tar --posix -cf cache.tzst --exclude cache.tzst -P -C /home/runner/work/quarto-cli/quarto-cli --files-from manifest.txt --use-compress-program zstdmt
Warning: Failed to save: Failed to CreateCacheEntry: Received non-retryable error: Failed request: ([4](https://github.com/quarto-dev/quarto-cli/actions/runs/13398814382/job/37424367989?pr=12108#step:62:4)09) Conflict: cache entry with the same key, version, and scope already exists

This is quite recent, and happening in latest run in this PR (https://github.com/quarto-dev/quarto-cli/pull/12108)

So it can either be an issue they will solve, or part of the deprecation changing toward Cache API v2 as they released new version 2 hours ago

  • https://github.com/actions/cache/releases/tag/v4.2.1

However, Julia Cache seems to pin version https://github.com/julia-actions/cache/blob/2b1bf4d8a138668ac719ea7ca149b53ed8d8401e/action.yml#L124-L131

So maybe this is a real problem only in the way to use cache action in a workflow using Job matrix.

If nothing needs to be adapted in this action, please feel free to close. And sorry for the noise.

Thank you

cderv avatar Feb 18 '25 20:02 cderv

From https://github.com/actions/cache/issues/1541#issuecomment-2668186448

The warning annotation is most likely what's causing confusion because the legacy service would have not set a warning annotation for a cache entry key collision. This is not a failure, your workflow jobs are finishing successfully. (...) The (409) Conflict is normal and expected behaviour. Cache entries are also immutable at the moment, there are no configurable parameters to change that behaviour.

So it seems this is an expected change, but one that clutter the summary annotations of workflow for now.

cderv avatar Feb 19 '25 10:02 cderv