actions / cache

Cache dependencies and build outputs in GitHub Actions
MIT License
4.36k stars 1.16k forks source link

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

Open caquino opened 1 month ago

caquino commented 1 month ago

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