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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors out on npm cache (no changes, worked fine until now) #1275

Open
2 of 5 tasks
bhaugeea opened this issue Apr 8, 2025 · 4 comments
Open
2 of 5 tasks

Errors out on npm cache (no changes, worked fine until now) #1275

bhaugeea opened this issue Apr 8, 2025 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@bhaugeea
Copy link

bhaugeea commented Apr 8, 2025

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.

@bhaugeea bhaugeea added bug Something isn't working needs triage labels Apr 8, 2025
@bhaack79
Copy link

bhaack79 commented Apr 8, 2025

Same!

@priyagupta108
Copy link
Contributor

Hi @bhaugeea, thanks for reporting this issue!

The error is occurring because setup-node@v2 relies on a deprecated version of @actions/cache. Upgrading to setup-node@v4 should 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!

@bhaugeea
Copy link
Author

bhaugeea commented Apr 9, 2025

For what it's worth, it appears that something was fixed so that v2's cache failure doesn't fail the action, it just presumably doesn't use the cache. Still deprecated but seems to be working again.

@priyagupta108
Copy link
Contributor

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@v2 may continue to function for now, it relies on an outdated version of actions/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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants