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

Frequent failure with volta-cli//action #80

Open
BioCarmen opened this issue Apr 13, 2023 · 9 comments
Open

Frequent failure with volta-cli//action #80

BioCarmen opened this issue Apr 13, 2023 · 9 comments
Assignees

Comments

@BioCarmen
Copy link

The error of using Volta to install Node.js 16.18.1 failed quite often and it is quite disruptive to our pipelines. Happens 1-2 times everyday
Do you have any suggestions on how I can improve this?

Run volta-cli/action@v4
  with:
    node-version: 16.18.1
    npm-version: 8.19.[2](https://github.com/***/****/actions/runs/)
    token: ***
    always-auth: false
  env:
    NX_CLOUD_DISTRIBUTED_EXECUTION: true
    NX_BRANCH: develop
    NX_CLOUD_ACCESS_TOKEN: 
    NX_CLOUD_AUTH_TOKEN: 
    NPM_TOKEN: 
looking up latest volta version
downloading volta@1.1.1
/usr/bin/tar xz --warning=no-unknown-keyword --overwrite -C /home/runner/work/_temp/118[3](https://github.com//actions/runs/4692165290/jobs/8317540378#step:4:3)303d-b7a6-[4](https://github.com//actions/runs/4692165290/jobs/8317540378#step:4:4)af9-88cc-1b79993d1[5](https://github.com//actions/runs/4692165290/jobs/8317540378#step:4:5)9c/bin -f /home/runner/work/_temp/0522f090-57c9-480f-b553-83[6](https://github.com//actions/runs/4692165290/jobs/8317540378#step:4:6)3bbdef8cd
/opt/hostedtoolcache/volta/1.1.1/x64/bin/volta setup
caching volta@1.1.1 into /opt/hostedtoolcache/volta/1.1.1/x64
adding /opt/hostedtoolcache/volta/1.1.1/x64/bin to $PATH
installing Node 16.18.1
/opt/hostedtoolcache/volta/1.1.1/x64/bin/volta install node@16.18.1
error: Could not unpack Node v16.18.1

Please ensure the correct version is specified.
error: Error cause: failed to unpack `/opt/hostedtoolcache/volta/1.1.1/x64/tmp/.tmprsHt[7](https://github.com//actions/runs/4692165290/jobs/8317540378#step:4:7)a/node-v16.1[8](https://github.com//actions/runs/4692165290/jobs/8317540378#step:4:8).1-linux-x64/bin/node`

Error cause: failed to unpack `/opt/hostedtoolcache/volta/1.1.1/x64/tmp/.tmprsHt7a/node-v16.18.1-linux-x64/bin/node`

Error cause: failed to unpack `node-v16.18.1-linux-x64/bin/node` into `/opt/hostedtoolcache/volta/1.1.1/x64/tmp/.tmprsHt7a/node-v16.18.1-linux-x64/bin/node`

Error cause: Resource temporarily unavailable (os error [11](https://github.com//actions/runs/4692165290/jobs/8317540378#step:4:11))
Error: The process '/opt/hostedtoolcache/volta/1.1.1/x64/bin/volta' failed with exit code 1
@gremlin896
Copy link

gremlin896 commented Apr 18, 2023

I've had the same issue for a while now. Some of the comments on this issue and this issue seem to refer to a similar problem.

It seems the unofficial recommendation is to use the setup-node action instead, as it will also read from the volta config in package.json.

The Lerna repository (which is under the nx umbrella) made this change recently so it might be worthwhile for the same change to be made to the preconfigured workflows here.

@meeroslav meeroslav self-assigned this Apr 28, 2023
@meeroslav
Copy link
Collaborator

Unfortunately, the setup-node is not a full replacement as it doesn't handle the package manager versions.

But if this remains flaky, we will have to switch and sacrifice some functionality.

@g-cheishvili
Copy link

Unfortunately, the setup-node is not a full replacement as it doesn't handle the package manager versions.

But if this remains flaky, we will have to switch and sacrifice some functionality.

It is flacky, about 10% of all the CI run failures are related to this in my case

@BioCarmen
Copy link
Author

I took gremlin896 suggestions and use setup-node, it stabilized a lot.

@gremlin896
Copy link

Since I still wanted to use Volta locally, and have CI pull through the yarn version set in package.json I went with this:

name: "Prepare"
description: "Install node and yarn using specified volta versions, install deps"
runs:
  using: "composite"
  steps:
    - run: echo "YARN_VERSION=$(cat package.json | jq '.volta.yarn' -r)" >> $GITHUB_ENV
      shell: bash

    - name: Install Yarn
      run: |
        corepack enable
        corepack prepare yarn@$YARN_VERSION --activate
      shell: bash

    - uses: actions/setup-node@v3
      with:
        cache: 'yarn'
        node-version-file: 'package.json'

    - run: yarn --immutable
      shell: bash

@gestj
Copy link

gestj commented Aug 25, 2023

I am facing the same issue...

Let's add also the PR of sentry-javascript where they also switched to setup-node.

getsentry/sentry-javascript#7763

@meeroslav
Copy link
Collaborator

Volta has two issues:

  • it became unstable
  • it doesn't respect the package manager defined in package.json

So we will switch over to setup-node as well

@brianespinosa
Copy link
Contributor

@meeroslav be aware that there is an open issue with setup-node that will prevent it from running on any self-hosted runners that do not have corepack support enabled by default, which the GitHub runners have.

There are workarounds for these self-hosted runners with this action... which basically involve running the action with caching explicitly disabled, then enabling corepack, running the action again, then running the install step. Obviously this is less than ideal.

@meeroslav
Copy link
Collaborator

Thank you @brianespinosa for the info. The self-hosted runners are not supported by this reusable workflow, so we suggest folks with more specific needs to build their own workflows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants