Skip to content

Unexpected cache misses when running actions/cache@v3 #2448

@chetbox

Description

@chetbox

Describe the bug
actions/cache@v3 has cache misses all of a sudden.

To Reproduce
Steps to reproduce the behavior:

  1. Create an job that saves to the cache and restores via prefix match. e.g.
    - uses: actions/cache@v3
      with:
        path: folder
        key: folder-${{ env.SUFFIX }}
        restore-keys: |
          folder-
        fail-on-cache-miss: true

(In my case this ran successfully earlier today.)
2. When this action runs it creates an error because of a cache miss
3. See error

Expected behavior
A cache with key folder-* is retrieved. There is no error.

Runner Version and Platform

Current runner version: '2.301.1'
Operating System
[3](https://github.com/chetbox/brighton-explorers-signal/actions/runs/4208212963/jobs/7303978034#step:1:3)
  Ubuntu
[4](https://github.com/chetbox/brighton-explorers-signal/actions/runs/4208212963/jobs/7303978034#step:1:4)
  22.04.1
[5](https://github.com/chetbox/brighton-explorers-signal/actions/runs/4208212963/jobs/7303978034#step:1:5)
  LTS
Runner Image
[7](https://github.com/chetbox/brighton-explorers-signal/actions/runs/4208212963/jobs/7303978034#step:1:8)
  Image: ubuntu-22.04
[8](https://github.com/chetbox/brighton-explorers-signal/actions/runs/4208212963/jobs/7303978034#step:1:9)
  Version: 20230217.1
[9](https://github.com/chetbox/brighton-explorers-signal/actions/runs/4208212963/jobs/7303978034#step:1:10)
  Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20230217.1/images/linux/Ubuntu2204-Readme.md
[10](https://github.com/chetbox/brighton-explorers-signal/actions/runs/4208212963/jobs/7303978034#step:1:11)
  Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20230217.1

What's not working?

Cache fails to restore.

Error: Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: folder-73489456

Job Log Output

Run actions/cache@v3
  with:
    path: folder
    key: folder-656528678
    restore-keys: folder-
    fail-on-cache-miss: true
    enableCrossOsArchive: false
  env:
    SUFFIX: 73489456
Error: Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: folder-73489456

Extra info

I have verified the multiple caches I expect to exist with the prefix folder- exist by running:

gh api \
  -H "Accept: application/vnd.github+json" \
  /repos/OWNER/REPO/actions/caches

actions/cache@v3 appears to have no new releases since last week. I was successfully running job that restore caches a few hours ago.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions