actions / actions/toolkit

Cache upload does not handle 429 error

Open
#1,589 4 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
5.9k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
Occasionally, caching actions fail at Post step:

Post job cleanup.
/usr/bin/tar --posix --use-compress-program zstdmt -cf cache.tzst --exclude cache.tzst -P -C /runner/_work/beam/beam --files-from manifest.txt
Warning: Failed to save: Cache service responded with 429 during upload chunk.
/runner/_work/_actions/actions/setup-java/v3.8.0/dist/cleanup/index.js:401
                        throw new Error(`Cache upload failed because file read failed with ${error.message}`);
                        ^

Error: Cache upload failed because file read failed with EBADF: bad file descriptor, read
    at ReadStream.<anonymous> (/runner/_work/_actions/actions/setup-java/v3.8.0/dist/cleanup/index.js:401:31)
    at ReadStream.emit (node:events:513:28)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at errorOrDestroy (node:internal/streams/destroy:220:7)
    at node:internal/fs/streams:262:9
    at FSReqCallback.wrapper [as oncomplete] (node:fs:671:5)

Example run: https://github.com/apache/beam/actions/runs/6307333506/job/17123805683?pr=28079

A solution could be ignore this transient error similar to here: https://github.com/coursier/cache-action/issues/131

Additional context
original issue: https://github.com/actions/setup-java/issues/543

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 with the failing Apache Beam workflow and the referenced setup-java cleanup/index.js stack trace, then compare the cache-upload behavior with the linked coursier and setup-java issues. Identify where a 429 during chunk upload is surfaced during post-job cleanup; done means the transient response no longer causes this cleanup failure while the behavior for other upload errors remains clear.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.