cache: Bug: Failed to CreateCacheEntry
Greetings.
Since today Feb 7th around 1AM CET we got a problem with the actions/cache.
We can’t use actions/cache/save anymore and get the following error
Warning: Failed to save: Failed to CreateCacheEntry: Received non-retryable error: Failed request: (404) Not Found: invalid request
This is a simple cache step as described in the docs:
- name: Cache vendor
uses: actions/cache/save@v4
with:
key: ${{ env.VENDOR_CACHE_KEY }}
path: |
vendor/
vendor-bin/
Current workaround:
Fix the version to v4.1.2. This should solve the issue for now.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 29
- Comments: 45 (12 by maintainers)
Commits related to this issue
- chore: fix actions/cache version https://github.com/actions/cache/issues/1541 — committed to Tiphereth-A/CP-lib by Tiphereth-A 2 years ago
- chore: fix actions/cache version https://github.com/actions/cache/issues/1541 — committed to Tiphereth-A/CP-lib by Tiphereth-A 2 years ago
- Modify cache key in check-catalyst action (#1526) Circumvents upstream bug in GitHub caching infrastructure: https://github.com/actions/cache/issues/1541#issuecomment-2669564066 --------- Co-author... — committed to PennyLaneAI/catalyst by erick-xanadu 2 years ago
- [`actions/setup-go`] Cache issue (ref https://github.com/actions/cache/issues/1541 + https://github.com/actions/setup-go/issues/403) — committed to warrensbox/terraform-switcher by yermulnik 2 years ago
- Workaround for https://github.com/actions/cache/issues/1541 — committed to hylo-lang/Swifty-LLVM by dabrahams a year ago
- Workaround for https://github.com/actions/cache/issues/1541 — committed to hylo-lang/Swifty-LLVM by dabrahams a year ago
This is a backend change and I’ll update this issue once we deploy the fix.
In my repository, it reports
so maybe there is another issue of new service backend.
@MikeMcC399 et al, the fix is now in production. All previously locked cache keys have been cleared. New cache entries that are created but not finalized will only be reserved for up to 24 hours.
I’m going to keep this issue open for a few days in case we have some other edge cases to handle.
@yonitou et al, the backend change is coming this week. We had to iterate on a couple of ideas and put the change in motion. In short, cache keys that are locked due to a failed upload will be cleared every
24 hoursfrom the time they’re created (after the backend fix finishes rolling out).In the meantime, I recommend that you maintain some level of flexibility with your cache keys. As a best practice, cache availability should not be blocking to your workflows even if we aim to provide the same level of stability and availability as workflow artifacts and packages.
We identified the problem, thank you all for chiming in! The fix will be released in a day or two.
In short, when a cache entry is created, if for whatever reason it’s not finalized that slot is locked and will not be reused in future attempts to create a cache entry with the same key. Since the cache entry was never finalized, it will also not be served.
The issue just started to appear again … It’s quite urgent to fix it @Link-
My case is a little different. I expect to get this warning because I have several parallel jobs, and the first one to complete will save the cache while the rest will receive the warning. I think this is a valid pattern.
In my opinion, this warning should be removed or at least moved to the debug level. I don’t care that there is already a cache entry, and moreover, there is nothing I can do about it.
I’m currently also facing this issue. The save action is not able to save a new cache although none are existing at that moment. It always tells me that the cache is already existing although it’s not.
@andothomas and others who are still experiencing similar issues: please open a support ticket with the GitHub team and feel free to link this comment. This way we can investigate your specific situation. Please share links to the repo and workflow runs affected, and a copy of the workflow file you’re using, this will help us investigate faster what might be happening.
For now, I’m closing this issue.
@BeyondEvil - We need to separate 2 issues here:
For that error you’re seeing please read: https://github.com/actions/cache/issues/1541#issuecomment-2666975007
As a fix, start using
actions/cachev4.2.2: https://github.com/actions/cache/releases/tag/v4.2.2It seems to be exactly the issue 😃 after changing the name of the cache key I used before (even if my cache was completely empty), the 409 errors disappeared
@Link- We are also facing the issue in this public workflow
Both when trying to update to using
actions/cache/restoreandactions/cache/savebut also while using julia-actions/cache which seems to use a pinned version of actions/cache: https://github.com/julia-actions/cache/blob/2b1bf4d8a138668ac719ea7ca149b53ed8d8401e/action.yml#L124-L131Our current usage of caching involves:
save-alwaysin the past).However, it seems that even using
cache-hitis problematiccache-hit = falsecache-hit = false, but key already exists (because of first job that end) and warning is thrownI would be happy to have misunderstood though…
Anyhow, I’ll be interested to really understand the new constraint to correctly adapt key and restore/save in a situation of multiple job created through Matrix. All jobs should share a cache and there should not be one for each matrix element.
Thanks a lot.
@Tiphereth-A - This is not an error, cache entries are immutable. If you’re trying to create a cache entry with the same key, you will get this
warning. In a future release we will be removing this annotation to reduce confusion.I think it works again - we use v3.
Sorry for perhaps beating a dead horse, but I’m still seeing this.
On the
restoreaction:That’s fine, but then when the
saveaction runs:Am I doing something wrong?
The hash (for the version of the action) corresponds to v4.2.0 (https://github.com/actions/cache/releases/tag/v4.2.0)
Thanks @MikeMcC399 for your help @cderv, I check my cache multiple times. The cache key is not there. The slot is just locked as you mentioned. This is exactly what I’m talking about
@yonitou
I am a community member like you, so I can’t provide any ETA. I also doubt whether the backend fix will solve your problem. The fix is only to suppress the warning. That’s all. You may need to open a new issue for your problem.
@dime10 - let me review, thanks for sharing the run
To conclude this report. The previous implementation of
actions/cachealso posts an annotation when it fails to upload a cache entry if the key exists already. The new version is just a bit more verbose.I’ll adjust the annotation text to match the former version and add some guidance.
I think you got it right.
Yes there is no failure. One of the job is doing the saving, and the other jobs try to save later on but there is this warning thrown from each one of them as they indeed can’t. This clutter the log with a lot of warning, and this indeed created confusion has it seemed to work ok.
That is good to know. This confirm my initial understanding. I will go on with my initial change.
That would really help to not have this warning thrown by default, especially if everything is going as expected. maybe annotate in workflow debug mode only ? or do not create an annotation that go up in summary ?
This created the confusion indeed, especially as I did not see anyway to avoid each following job to detect cache have been saved already, and not try to save the cache.
Thank you.
Yes. Workaround is to fix the version to v4.1.2 then it works again.