setup-node icon indicating copy to clipboard operation
setup-node copied to clipboard

node-version: 'latest' taking 20+ minuites

Open andyslack opened this issue 1 year ago • 22 comments

Description:

Node setup taking forever (20m+) when using latest

Exmaple:

screenshot

Code:

            -   name: Install Node.js
                uses: actions/setup-node@v3
                with:
                    node-version: 'latest'

Is the latest version not caches somewhere?

Action version: actions/setup-node@v3

Platform:

  • [ ] Ubuntu
  • [x] macOS
  • [ ] Windows

Runner type:

  • [x] Hosted
  • [ ] Self-hosted

andyslack avatar Oct 18 '23 09:10 andyslack

Example of this failing.

Screenshot 2023-10-18 at 11 03 09

andyslack avatar Oct 18 '23 09:10 andyslack

I'm getting it too. I'm use latest as the node version and the Log is:

❯ gh run view 6558471842 --log-failed
test    Node setup      2023-10-18T08:48:29.8829257Z ##[group]Run actions/setup-node@v3
test    Node setup      2023-10-18T08:48:29.8829747Z with:
test    Node setup      2023-10-18T08:48:29.8830054Z   node-version: latest
test    Node setup      2023-10-18T08:48:29.8830412Z   always-auth: false
test    Node setup      2023-10-18T08:48:29.8830776Z   check-latest: false
test    Node setup      2023-10-18T08:48:29.8831318Z   token: ***
test    Node setup      2023-10-18T08:48:29.8831613Z ##[endgroup]
test    Node setup      2023-10-18T08:48:30.3387908Z getting latest node version...
test    Node setup      2023-10-18T08:48:30.3411536Z getting latest node version...
test    Node setup      2023-10-18T08:48:30.3413660Z Attempting to download v21.0.0...
test    Node setup      2023-10-18T08:48:30.6240758Z Not found in manifest. Falling back to download directly from Node
test    Node setup      2023-10-18T08:48:30.6557915Z Acquiring 21.0.0 - x64 from https://nodejs.org/dist/v21.0.0/node-v21.0.0-linux-x64.tar.gz
test    Node setup      2023-10-18T08:53:10.8209480Z aborted
test    Node setup      2023-10-18T08:53:10.8209977Z Waiting 14 seconds before trying again
test    Node setup      2023-10-18T09:02:35.6053574Z aborted
test    Node setup      2023-10-18T09:02:35.6054014Z Waiting 16 seconds before trying again
test    Node setup      2023-10-18T09:05:51.9376210Z ##[error]aborted

daonb avatar Oct 18 '23 10:10 daonb

The same problem occurs when version 19.8.1 is specified. At least as of two days ago I had the same problem.

    runs-on: ubuntu-latest
    steps:
      - name: Set up Node
        uses: actions/setup-node@v3
        with:
          node-version: 19.8.1

スクリーンショット 2023-10-18 午後6 12 48

I can get the tar.gz file correctly with curl, so I wonder if there is a problem with the cache handling in the @actions/tool-cache library?

スクリーンショット 2023-10-18 午後7 33 51

tksx1227 avatar Oct 18 '23 10:10 tksx1227

Same issue here using

- name: Set up Node.js
  uses: actions/setup-node@v2
  with:
    node-version: '17.6.0'

The download speeds from nodejs.org do seem incredibly slow when manually downloading.

jordanerf avatar Oct 18 '23 13:10 jordanerf

Same with node-version: '19'

Screenshot 2023-10-18 at 15 32 30

andyslack avatar Oct 18 '23 13:10 andyslack

We are also seeing this issue. Anytime we try and install node v18, if Node's downloads are slow that day it always fails. We didn't have this issue on earlier node versions.

mrollinsiv avatar Oct 18 '23 19:10 mrollinsiv

Hello @andyslack Thank you for submitting this issue. We will investigate and come back to you as soon as possible 🚀

marko-zivic-93 avatar Oct 19 '23 04:10 marko-zivic-93

@marko-zivic-93 let me know if there is anything I can do to help!

andyslack avatar Oct 19 '23 11:10 andyslack

Same problem here too.

jobs:
  test_frontend:
    runs-on: ubuntu-20.04

    steps:
    - uses: actions/checkout@v3

    - name: Use Node.js
      uses: actions/setup-node@v3
      with:
        node-version: 19.x

    - name: Build
      run: |
        yarn install

    - name: Test
      run: |
        npm test

githubjonas avatar Oct 19 '23 12:10 githubjonas

I'm getting the same issue with 19.1 since yesterday Screenshot 2023-10-19 at 9 53 42 AM

juanmanjarres avatar Oct 19 '23 15:10 juanmanjarres

Same with node 21. The install or post-install steps fail almost every run

ert78gb avatar Oct 24 '23 08:10 ert78gb

Any update on this?

jonathanzopes avatar Oct 26 '23 14:10 jonathanzopes

Builds are failing for us as well. Downloads taking upwards of 7 hours.

ivan-barragan avatar Oct 26 '23 15:10 ivan-barragan

This is happening for us as well, using latest.

[edit] Using v4 of the action resolved this issue for us. v4 was released 4 days ago, and I was unaware of the update.

crespire avatar Oct 27 '23 15:10 crespire

Had the same problem with v3, but it only happens intermittently. Tried v4 out, same problem.

aaronklinker-st avatar Oct 31 '23 15:10 aaronklinker-st

I found some information that might help others. If you can upgrade your version of node to an LTS version found in the manifest , I believe the builds will use the cached version from actions/node-versions and skip the download step. This link has more information, specifically this part: "current/latest/node always resolve to the latest dist version. That version is then downloaded from actions/node-versions if possible, or directly from Node.js if not. Since it will not be cached always, there is possibility of hitting rate limit when downloading from dist"

bonniegrubbs avatar Oct 31 '23 19:10 bonniegrubbs

@bonniegrubbs I think you are correct here.

Might be a good idea to add options to the manifest for latest-cached and also root versions e.g. 18 19 rather than having to specify 18.18.2

Just an idea to make it more user friendly.

andyslack avatar Nov 01 '23 08:11 andyslack

Seeing this, too, with pinned versions of node. Sometimes the download fails and the ci failed. Is there some way to add more verbosity to try and see whats breaking down? Also, would it make sense to add a retry mechanism? Things generally work after re-running the workflow, so if we can just automate that it would allow ci to pass.

mbrevda avatar Jan 23 '24 14:01 mbrevda

What I'm seeing with setup-node@v4 is whether I use 'latest' or '>=21.2', for example, the "best" I get is v18.19.1 while the actual latest is v21.7.0 right now.

    strategy:
      matrix:
        node-version: ['>=21.2']
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Node ${{ matrix.node }}
        uses: actions/setup-node@v4
        with:
          node-version: ${{ matrix.node }}
          check-latest: true
          cache: npm

stefcameron avatar Mar 08 '24 22:03 stefcameron