Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Misleading error message when attempting to overwrite the existing cache #1665

@Yuri05

Description

@Yuri05

The caching step in my GHA workflow is defined as follows:

    - name: Restore setup cache
      id: cache-setup
      uses: actions/cache@v4
      with:
        key: SingleAction-ospsuite-${{ env.TOOLS_CSV_HASH }}
        path: |
          ${{ env.R_LIBS_USER }}

For some reason, the action cannot find an existing cache, but that's a different issue that I'm investigating.

As the cache could not be found, the action attempts to save it again in the Post-restore setup cache step, which results in the error message.
Failed to save: Unable to reserve cache with key SingleAction-ospsuite-f063a3bc68c3b4305b4e8672a9616eeab746134e3af41c4a95b6f14b6bd85cf6, another job may be creating this cache.

I struggled with this error message for a while — there were no parallel jobs that could lock the cache or anything like that.
After enabling action debugging, the last debug message before this error appeared was:
##[debug]Failed to reserve cache: Error: Failed to CreateCacheEntry: Received non-retryable error: Failed request: (409) Conflict: cache entry with the same key, version, and scope already exists

This makes perfect sense and should be displayed as an error message.

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