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

Skip to content

actions/cache/save does not fail the step on error #1581

@Kaltenbach

Description

@Kaltenbach

actions/cache/save recently (2025-03-26) failed with a timeout and a subsequent error as it looks like the key has been created in the initial attempt:

Attempt 1 of 5 failed with error: Request timeout: /twirp/github.actions.results.api.v1.CacheService/CreateCacheEntry. Retrying request in 3000 ms...
Failed to save: Unable to reserve cache with key Linux-build-workspace-930, another job may be creating this cache.
Warning: Cache save failed.

The action is configured as follows:

    - name: Cache workspace
      uses: actions/cache/save@v4
      env:
        cache-name: persist-workspace
      with:
        path: |
          ...
        key: ${{ runner.os }}-build-workspace-${{ github.run_number }}

Current behavior: the step's conclusion is success:

        {
          "name": "Persist build workspace",
          "status": "completed",
          "conclusion": "success",
          "number": 19,
          "started_at": "2025-03-26T02:17:23Z",
          "completed_at": "2025-03-26T02:17:40Z"
        }

Expected behavior: the action (and job) fails if the cache cannot be created. If this is not generally wanted, having a parameter to fail the step/job on cache creation would be highly welcomed.

Please note: this is a sporadic error which we cannot reproduce. We have not noticed such a behavior before the Deprecation Notice - Upgrade to latest before February 1st 2025.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions