actions / actions/cache

actions/cache and actions/cache/save consider cache to be uploaded sucessfully even with backend errors.

Open
#1,416 2 comments 0 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

Hi,

We are seeing 503 responses from the cloud caching backend (which we reported already to Github support), but the cache actions exit with success when the cache fails to upload, which surfaces later on the workflow as an error while restoring the cache and making harder to troubleshoot the workflow as the root cause of the issue is not the restore, but the save.

Here it is one example of a failure we saw.

##[debug]File Size: 246805853
##[debug]Reserving Cache
##[debug]Resource Url: https://acghubeus1.actions.githubusercontent.com/<INFO HIDDEN>/_apis/artifactcache/caches
##[debug]Saving Cache (ID: 2274)
##[debug]Upload cache
##[debug]Resource Url: https://acghubeus1.actions.githubusercontent.com/<INFO HIDDEN>/_apis/artifactcache/caches/<INFO HIDDEN>
##[debug]Upload concurrency: 4
##[debug]Upload chunk size: 33554432
##[debug]Awaiting all uploads
##[debug]Uploading chunk of size 33554432 bytes at offset 0 with content range: bytes 0-33554431/*
##[debug]Uploading chunk of size 33554432 bytes at offset 33554432 with content range: bytes 33554432-67108863/*
##[debug]Uploading chunk of size 33554432 bytes at offset 67108864 with content range: bytes 67108864-100663295/*
##[debug]Uploading chunk of size 33554432 bytes at offset 100663296 with content range: bytes 100663296-134217727/*
##[debug]uploadChunk (start: 67108864, end: 100663295) - Attempt 1 of 2 failed with error: Cache service responded with 503
##[debug]uploadChunk (start: 100663296, end: 134217727) - Attempt 1 of 2 failed with error: Cache service responded with 503
##[debug]uploadChunk (start: 33554432, end: 67108863) - Attempt 1 of 2 failed with error: Cache service responded with 503
##[debug]uploadChunk (start: 0, end: 33554431) - Attempt 1 of 2 failed with error: Cache service responded with 503
##[debug]uploadChunk (start: 67108864, end: 100663295) - Attempt 2 of 2 failed with error: Cache service responded with 503
Warning: Failed to save: uploadChunk (start: 67108864, end: 100663295) failed: Cache service responded with 503
Cache saved with key: Linux-9315318781-40-2-build
##[debug]Node Action run completed with exit code 0
##[debug]Finishing: Run actions/cache/save@v4

Is it possible to force the action to fail? If not is this something that can be improved?

Thanks

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 tracing the upload handling in actions/cache and actions/cache/save, using the reported 503 upload failure as the behavior to investigate. Check how a failed chunk is propagated to the action result and add coverage for the failure case if the repository has a corresponding test area. Done means backend upload errors cause the action to report failure instead of logging a warning and exiting successfully.

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
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.