Skip to content

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

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

Open
2 of 5 tasks
bhaugeea opened this issue Apr 8, 2025 · 12 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 · 12 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.

@huan
Copy link

huan commented Apr 15, 2025

I’m the guy showing up right on April 15th! 😅

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.

Thanks for the information!

@leoskyrocker
Copy link

leoskyrocker commented Apr 16, 2025

We're on setup-node@v4.0.4 and still hitting this as a warning with cache: yarn:

All dependencies are managed locally by yarn3, the previous cache can be used
Warning: Failed to restore: Cache service responded with 422

During the Post job cleanup, it is failing out pipeline with an error:

Path Validation Error: Path(s) specified in the action for caching does not exist

which I'm currently suspecting is due to the cache miss.

@liangxiwei
Copy link

Image it will be ok when change the version.

@priyagupta108
Copy link
Contributor

Hi @leoskyrocker 👋,
Since you're using setup-node@v4.0.4, which relies on an older version of actions/cache, and this can lead to caching problems or compatibility issues.
To resolve this, please upgrade to the latest version of actions/setup-node, either by specifying setup-node@v4.4.0 or by using the v4 tag. The v4 tag 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:

uses: actions/setup-node@v4  # Or actions/setup-node@v4.4.0

Let us know if that works or if you run into any further issue.

@OgDev-01
Copy link

OgDev-01 commented Apr 16, 2025

Hi @leoskyrocker 👋, Since you're using setup-node@v4.0.4, which relies on an older version of actions/cache, and this can lead to caching problems or compatibility issues. To resolve this, please upgrade to the latest version of actions/setup-node, either by specifying setup-node@v4.4.0 or by using the v4 tag. The v4 tag 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:

uses: actions/setup-node@v4 # Or actions/setup-node@v4.4.0
Let us know if that works or if you run into any further issue.

I use the v4 but still get the same error

Image

Image

@priyagupta108
Copy link
Contributor

Hi @OgDev-01 👋,
We tested actions/setup-node@v4 on our end and everything is working as expected. Caching is functioning properly with no errors.
Here’s a screenshot for reference:

Image

Could you please share your workflow or a minimal repository link that demonstrates the issue. That would help us investigate further and figure out what's going wrong in your case.

@OgDev-01
Copy link

OgDev-01 commented Apr 16, 2025

Hello @priyagupta108 👋
This is a minimal setup i have

  steps:
      - name: "☁️ checkout repository"
        uses: actions/checkout@v4

      - name: "🔧 setup node"
        uses: actions/setup-node@v4
        with:
          node-version: 21

      - name: "🔧 install npm@latest"
        run: npm i -g npm@10.5.0

      - name: "📦 install dependencies"
        uses: bahmutov/npm-install@v1.8.15

Install dependencies step throws this error

Image

dragonofdeath added a commit to wix-incubator/pro-gallery that referenced this issue Apr 16, 2025
@OgDev-01
Copy link

Hello @priyagupta108 👋 This is a minimal setup i have

steps:
- name: "☁️ checkout repository"
uses: actions/checkout@v4

  - name: "🔧 setup node"
    uses: actions/setup-node@v4
    with:
      node-version: 21

  - name: "🔧 install npm@latest"
    run: npm i -g npm@10.5.0

  - name: "📦 install dependencies"
    uses: bahmutov/npm-install@v1.8.15

Install dependencies step throws this error

Image

I was able to fix the error by changing uses: bahmutov/npm-install@v1.8.15 to use uses: bahmutov/npm-install@v1

copybara-service bot pushed a commit to openxla/shardy that referenced this issue Apr 16, 2025
copybara-service bot pushed a commit to openxla/shardy that referenced this issue Apr 16, 2025
* bazelbuild/setup-bazelisk: v2 -> v3
* actions/cache: v3 -> v4

Reference: actions/setup-node#1275
PiperOrigin-RevId: 748399822
copybara-service bot pushed a commit to openxla/shardy that referenced this issue Apr 16, 2025
* bazelbuild/setup-bazelisk: v2 -> v3
* actions/cache: v3 -> v4

Reference: actions/setup-node#1275
PiperOrigin-RevId: 748399822
copybara-service bot pushed a commit to openxla/shardy that referenced this issue Apr 16, 2025
* bazelbuild/setup-bazelisk: v2 -> v3
* actions/cache: v3 -> v4

Reference: actions/setup-node#1275
PiperOrigin-RevId: 748431777
connectdotz added a commit to jest-community/vscode-jest that referenced this issue Apr 16, 2025
setup-node@v2 will not work after 4/15/2025. See actions/setup-node#1275 for more info.
connectdotz added a commit to jest-community/vscode-jest that referenced this issue Apr 17, 2025
setup-node@v2 will not work after 4/15/2025. See actions/setup-node#1275 for more info.
MrOrz added a commit to cofacts/rumors-site that referenced this issue Apr 17, 2025
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

7 participants