setup-node: Errors out on npm cache (no changes, worked fine until now)
Description:
The Setup Node.js action fails with Error: Cache service responded with 422. This was not happening until today and now it happens on the three existing repos I tried, plus the new minimal repro linked below. Using cache: 'npm'. Full log:
Run actions/setup-node@v2
Found in cache @ /opt/hostedtoolcache/node/22.14.0/x64
/opt/hostedtoolcache/node/22.14.0/x64/bin/npm config get cache
/home/runner/.npm
Error: Cache service responded with 422
Action version: v2
Platform:
- Ubuntu
- macOS
- Windows
Runner type:
- Hosted
- Self-hosted
Tools version: node v22.14.0 on ubuntu locally, “22” in GitHub runner.
Repro steps:
https://github.com/bhaugeea/tmp
Expected behavior: Until now the CI job in the repro succeeded.
Actual behavior: Node-setup errors on an npm cache interaction.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 15
- Comments: 19 (7 by maintainers)
Commits related to this issue
- upgrade actions/setup-node from v2 -> v4 (https://github.com/actions/setup-node/issues/1275#issuecomment-2788204086) — committed to wechaty/jekyll by huan 2 years ago
- chore: update setup node action This should solve issues with the cache service (error 422) See https://github.com/actions/setup-node/issues/1275#issuecomment-2808800966 — committed to curvefi/curve-frontend by DanielSchiavini 2 years ago
- ci: use setup-node@v4.4.0 See https://github.com/actions/setup-node/issues/1275#issuecomment-2808800966 — committed to seasick/zamg-measurment-collector by seasick 2 years ago
- use different action cause https://github.com/actions/setup-node/issues/1275 — committed to wix-incubator/pro-gallery by dragonofdeath 2 years ago
- Upgrade to actions/cache@v4 for Shardy GitHub workflow. Reference: https://github.com/actions/setup-node/issues/1275 PiperOrigin-RevId: 748399822 — committed to openxla/shardy by ZixuanJiang 2 years ago
- Upgrade the actions for Shardy GitHub workflow. * bazelbuild/setup-bazelisk: v2 -> v3 * actions/cache: v3 -> v4 Reference: https://github.com/actions/setup-node/issues/1275 PiperOrigin-RevId: 7483998... — committed to openxla/shardy by ZixuanJiang 2 years ago
- Upgrade the actions for Shardy GitHub workflow. * bazelbuild/setup-bazelisk: v2 -> v3 * actions/cache: v3 -> v4 Reference: https://github.com/actions/setup-node/issues/1275 PiperOrigin-RevId: 7483998... — committed to openxla/shardy by ZixuanJiang 2 years ago
- Upgrade the actions for Shardy GitHub workflow. * bazelbuild/setup-bazelisk: v2 -> v3 * actions/cache: v3 -> v4 Reference: https://github.com/actions/setup-node/issues/1275 PiperOrigin-RevId: 7484317... — committed to openxla/shardy by ZixuanJiang 2 years ago
- upgrade setup-node@v2 to setup-node@v4 setup-node@v2 will not work after 4/15/2025. See https://github.com/actions/setup-node/issues/1275 for more info. — committed to jest-community/vscode-jest by connectdotz 2 years ago
- upgrade setup-node@v2 to setup-node@v4 (#1236) setup-node@v2 will not work after 4/15/2025. See https://github.com/actions/setup-node/issues/1275 for more info. — committed to jest-community/vscode-jest by connectdotz 2 years ago
- fix: upgrade setup-node version to fix cache issue Ref: https://github.com/actions/setup-node/issues/1275 — committed to cofacts/rumors-site by MrOrz 2 years ago
- Update action dependencies (#4957) Summary: I suspect the current CI failures are related to https://github.com/actions/setup-node/issues/1275#issuecomment-2788204086 Pull Request resolved: https://... — committed to facebook/relay by captbaritone 2 years ago
- debugging github workflow https://github.com/actions/setup-node/issues/1275#issuecomment-2808630427 — committed to scicloj/scicloj.github.io by daslu 2 years ago
- Updated node actions/setup-node from v2 to v4 Refer to the following links for discussion the issue https://github.com/actions/setup-node/issues/1275 — committed to logistimo/git-workflows by ranjeetsingh-logistimo 2 years ago
- Upgrade `setup-node` to fix CI failure https://github.com/actions/setup-node/issues/1275#issuecomment-278820408 — committed to conversejs/converse.js by jcbrand 2 years ago
- Upgrade `setup-node` to fix CI failure https://github.com/actions/setup-node/issues/1275#issuecomment-278820408 — committed to conversejs/converse.js by jcbrand 2 years ago
- Upgrade seutp-node from v2 to v4 I've seen some build failures like Run actions/setup-node@v2 Found in cache @ /opt/hostedtoolcache/node/22.14.0/x64 /opt/hostedtoolcache/node/22.14.0/x64... — committed to lune-climate/ts-results-es by jstasiak 2 years ago
- Upgrade seutp-node from v2 to v4 (#213) I've seen some build failures like Run actions/setup-node@v2 Found in cache @ /opt/hostedtoolcache/node/22.14.0/x64 /opt/hostedtoolcache/node/22.1... — committed to lune-climate/ts-results-es by jstasiak 2 years ago
- use setup-node@v4 (https://github.com/actions/setup-node/issues/1275) — committed to isographlabs/isograph by rbalicki2 2 years ago
- :arrow_up: chore(ci.yml): Bump checkout and setup-node actions to v4 https://github.com/actions/setup-node/issues/1275 — committed to Spiderpig86/Cirrus by Spiderpig86 2 years ago
Hi @bhaugeea, thanks for reporting this issue!
The error is occurring because
setup-node@v2relies on a deprecated version of@actions/cache. Upgrading tosetup-node@v4should resolve this issue, as it uses the updated version of the cache service.To fix this and prevent any further caching problems, please update your workflows to use
actions/setup-node@v4.For more details, you can refer to the discussion here: GitHub Actions Toolkit Discussion.
Feel free to reach out if you need further assistance or clarification!
I’m the guy showing up right on April 15th! 😅
Thanks for the information!
Hi @bhaugeea, Thank you for the update! The behavior you’re seeing is likely due to a recent brownout event affecting
actions/cache, which temporarily disrupted the deprecated cache service.While
actions/setup-node@v2may continue to function for now, it relies on an outdated version ofactions/cache, which is scheduled for permanent shutdown on April 15th.To avoid any interruptions and ensure ongoing reliability, we strongly recommend migrating to
actions/setup-node@v4, which is fully compatible with the updated and supported cache service.If you encounter any challenges during the migration or need further assistance, please feel free to reach out.
We’re on setup-node@v4.0.4 and still hitting this as a warning with
cache: yarn:During the Post job cleanup, it is failing out pipeline with an error:
which I’m currently suspecting is due to the cache miss.
I still encounter the warning after upgrading to v4: Warning: Failed to restore: Cache service responded with 422.
Hi everyone, As mentioned earlier, the root cause stems from
actions/setup-node@v2relying on a deprecated version of@actions/cache. Upgrading toactions/setup-node@v4, which uses the latest cache service, resolves the problem.To prevent similar errors and take advantage of the latest improvements, we strongly recommend updating your workflows to use
actions/setup-node@v4.Since the root cause has been identified and a recommended solution is available, we are proceeding to close this issue. If you run into related problems after upgrading or have any further questions, please feel free to follow up here or open a new issue. Appreciate everyone’s input and collaboration!
I use the v4 but still get the same error
Hi @leoskyrocker 👋, Since you’re using
setup-node@v4.0.4, which relies on an older version ofactions/cache, and this can lead to caching problems or compatibility issues. To resolve this, please upgrade to the latest version ofactions/setup-node, either by specifyingsetup-node@v4.4.0or by using thev4tag. Thev4tag will always point to the most up-to-date version, including the latest fixes and improvements for caching. Here’s how you can update your workflows:Let us know if that works or if you run into any further issue.