Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action fails if saving cache fails #53

Closed
s-weigand opened this issue Oct 12, 2020 · 1 comment 路 Fixed by #54
Closed

Action fails if saving cache fails #53

s-weigand opened this issue Oct 12, 2020 · 1 comment 路 Fixed by #54

Comments

@s-weigand
Copy link
Contributor

First of all thanks for this action 馃槃

Today I had my pre-commit job failing, with the following error, which isn't fixable by rerunning the job:

Error: reserveCache failed: Cache already exists. Scope: refs/pull/80/merge, Key: pre-commit-2-b76e203571a33b83fd824866e8e8daaeda30555cba9e70eb155d9e5310e578b8-7365e065f5f4ed7e591c7e54ee4f8c40d559f8ff4d40fb8fc9eec5d1a9d2e11c, Version: 28cdb9f5496f334116f23e86f0063f5d3a9348c2e22425a33171e071aadada7e

My best guess is, that this caused by a corrupted cache, where a cache entry with the key exists, but cache.restoreCache is unable to restore it properly (maybe on: push and on: pull_request wanted to save the cache at the same time? 馃樀 ).
So this might be a very rare and quite impossible to reproduce case.

Anyway, since the cache is nice and all, but not a key feature, IMHO it would be reasonable to catch errors caused by cache.saveCache and give users a warning ( core.warning), instead of letting it bubble up to core.setFailed.

main().catch((e) => core.setFailed(e.message));

Also, there have been some changes to @actions/cache since version 0.2.1 which you use, so running npm upgrade might improve this action as well.

@asottile
Copy link
Member

dupe of #41 -- I'm not sure there's anything that can be done but feel free to send a PR if you think there is

dhimmel added a commit to dhimmel/obonet that referenced this issue Apr 4, 2021
dhimmel added a commit to dhimmel/obonet that referenced this issue Apr 4, 2021
asottile added a commit that referenced this issue Apr 5, 2021
Fix Action fails if saving cache fails #53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants