actions / actions/cache

Cache miss for existing cache

Open
#1,606 8 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5.6k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

I'm getting constant cache misses for caches I can see in the interface.

My cache save step in workflow (a):

      - name: Save Slack thread to cache
        uses: actions/cache/save@v4
        id: slack-thread-id
        with:
          path: /tmp/slack_thread_id
          key: slack-thread-id-${{ github.event.pull_request.number }}

My cache restore step in workflow (b):

      - name: Restore Slack thread ID
        uses: actions/cache/restore@v4
        id: slack-thread-id
        with:
          fail-on-cache-miss: true
          path: /tmp/slack_thread_id
          key: slack-thread-id-${{ github.event.issue.number }}

Both steps report the same key (e.g. slack-thread-id-16), and I can see that cache in the GH web interface. However, I still get Error: Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: slack-thread-id-16.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining the cache save and restore action entry points used in workflow (a) and workflow (b), especially actions/cache/save@v4 and actions/cache/restore@v4. Reproduce the reported key in both workflows and trace the cache lookup context. Done means identifying why the visible cache is not restored or documenting the required behavior and adding coverage if an existing test area is found.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, typescript
Domain
ci-cd
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.