-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Node setup fails non-deterministically with Yarn starting on November 17th #899
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
Comments
Also seeing this issue. This seems to be due to some runners are using yarn 1.22.19 and others 1.22.21. The yarn release 1.22.20 notes state that a message saying that Corepack should be installed, but it appears to be erroring. |
I was stuck with the same problem. yarn set version latest --yarn-path |
Can confirm @kurone-kito solution works as a workaround for this 🎉 |
Committing the Yarn binary to the repo is a good workaround for now, thanks. However, note that doing this is discouraged in Yarn version 4, as the ecosystem should use corepack going forward. So I would love a solution to this |
I was able to work around this by enabling corepack before running setup-node at least |
How do you enable corepack before installing node, since corepack is part of node? |
I believe the action runner image contains a copy of node, as most actions are themselves written in JavaScript (including this one I think?) |
Thank you for creating pull request! We'll make sure to look into it and come back with the details. |
I have added yarn binaries to the repo too while a solution is found. Thanks! |
|
@will-path this worked for me, thanks 💜 |
As @Mause mentioned, this can be temporarily solved by enabling Corepack before running jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
+ - name: Enable Corepack before setting up Node
+ run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm test |
@felladrin Yea, that's better and actually caches my Yarn deps. Setting |
See actions/setup-node#899 When defining `packageManager` in package.json, github runners will now error about using the wrong yarn version. This change seems like it'll be a temp fix until either the setup-node action or github runner gets update (to what exactly, I'm not sure, but we should follow the issue).
Hello @Zamiell , Thank you for creating the issue and providing us with details! |
Hello @Zamiell , just a gentle ping! |
Why are you pinging me? |
Hey @Zamiell , as per my previous comment, we will consider this issue as an enhancement in future. |
If you have investigated the issue, can you explain why the error only happens sometimes, and not other times? Naively, I would expect that to indicate some kind of bug in either this GitHub action or the GitHub runner virtual machine. Furthermore, Yarn 4 was released on October 22nd, 2023, and this GitHub Actions issue started occurring on November 17th, 2023. Which means that Yarn 4 worked just fine with this action for 26 days. Thus, I find your classification of the race condition described in the OP as a "feature request" rather than an "bug" completely baffling. Can you explain further why it is a "feature request" to request that something that already worked continues to work in the same way? |
…node#899 Signed-off-by: cmoulliard <cmoulliard@redhat.com>
Signed-off-by: cmoulliard <cmoulliard@redhat.com> Set dry run to test the github flow Signed-off-by: cmoulliard <cmoulliard@redhat.com> Specify the packagemanager to be used Signed-off-by: cmoulliard <cmoulliard@redhat.com> Enable corepack as it is needed to use packageManager yarn > 1.x Signed-off-by: cmoulliard <cmoulliard@redhat.com> Moving corepack enable before calling setup-node. See: actions/setup-node#899 Signed-off-by: cmoulliard <cmoulliard@redhat.com> Removing the hack folder as non needed anymore. Creating an empty yarn.lock file to avoid error: Dependencies lock file is not found Signed-off-by: cmoulliard <cmoulliard@redhat.com> Fix indentation issue Signed-off-by: cmoulliard <cmoulliard@redhat.com> Remove the deprecated parameter to use --immutable Signed-off-by: cmoulliard <cmoulliard@redhat.com> Removing the yarn install strep as it raises a yarn YN0028 error with lockfile Signed-off-by: cmoulliard <cmoulliard@redhat.com> Trying again to install the packages before to tsc compile Signed-off-by: cmoulliard <cmoulliard@redhat.com> Fix proposed by plone/volto-addon-ci#11 concerning lockfile issue Signed-off-by: cmoulliard <cmoulliard@redhat.com> Deleting --immutable to try to fix issue of yarn YN0028 Signed-off-by: cmoulliard <cmoulliard@redhat.com> Using --no-immutable Signed-off-by: cmoulliard <cmoulliard@redhat.com> Adding needed dependency as tsc fails with: TS2688: Cannot find type definition file for 'jest, node' Signed-off-by: cmoulliard <cmoulliard@redhat.com> intall jest Signed-off-by: cmoulliard <cmoulliard@redhat.com> Run foreach to install missing node modules Signed-off-by: cmoulliard <cmoulliard@redhat.com> Let's use the backstage action instead ;-) Signed-off-by: cmoulliard <cmoulliard@redhat.com> Pusing yarn.lock Signed-off-by: cmoulliard <cmoulliard@redhat.com> Using same packageManager version as backstage Signed-off-by: cmoulliard <cmoulliard@redhat.com> Use same action defintion as backstage Signed-off-by: cmoulliard <cmoulliard@redhat.com> Updating yarn.lock file Signed-off-by: cmoulliard <cmoulliard@redhat.com> Removing spaces Signed-off-by: cmoulliard <cmoulliard@redhat.com> Adding .nmprc file Signed-off-by: cmoulliard <cmoulliard@redhat.com> Enabling again corepack as we will use yarn package manager > 1.x Signed-off-by: cmoulliard <cmoulliard@redhat.com> Let's try a build using node 18.x as 20.x fails on ci platform Signed-off-by: cmoulliard <cmoulliard@redhat.com> Switch from tsc:full to tsc Signed-off-by: cmoulliard <cmoulliard@redhat.com> adding to tsc --skipLibCheck false --incremental false Signed-off-by: cmoulliard <cmoulliard@redhat.com> adding to tsc --skipLibCheck false --incremental false Signed-off-by: cmoulliard <cmoulliard@redhat.com> Use workspaces foreach tsc Signed-off-by: cmoulliard <cmoulliard@redhat.com> Removing tsc:full as it do not exist Signed-off-by: cmoulliard <cmoulliard@redhat.com> Install the command supporting foreach subcommand Signed-off-by: cmoulliard <cmoulliard@redhat.com> List the plugin installed Signed-off-by: cmoulliard <cmoulliard@redhat.com> List the plugin installed Signed-off-by: cmoulliard <cmoulliard@redhat.com> Checking what we have as executable under node_modules/.bin Signed-off-by: cmoulliard <cmoulliard@redhat.com> Removing trailing , Signed-off-by: cmoulliard <cmoulliard@redhat.com> Refactor the workflow to use the action of janus-idp project Signed-off-by: cmoulliard <cmoulliard@redhat.com> Push the missing .nvmrc file Signed-off-by: cmoulliard <cmoulliard@redhat.com> Removing packageManager > 1.x Signed-off-by: cmoulliard <cmoulliard@redhat.com> Removing yarn.lock Signed-off-by: cmoulliard <cmoulliard@redhat.com> Set cache-dependency-path Signed-off-by: cmoulliard <cmoulliard@redhat.com> Generating the package-lock.json Signed-off-by: cmoulliard <cmoulliard@redhat.com> Split tsc and build steps Signed-off-by: cmoulliard <cmoulliard@redhat.com> Removing unknow parameter Signed-off-by: cmoulliard <cmoulliard@redhat.com> Removing unknow parameter Signed-off-by: cmoulliard <cmoulliard@redhat.com> Use turbo commands Signed-off-by: cmoulliard <cmoulliard@redhat.com> Add turbo.json config file Signed-off-by: cmoulliard <cmoulliard@redhat.com> Define the needed config files able to find the generated .d.ts Signed-off-by: cmoulliard <cmoulliard@redhat.com> Let's try using turbo ... Signed-off-by: cmoulliard <cmoulliard@redhat.com> Remove cache parameter Signed-off-by: cmoulliard <cmoulliard@redhat.com> Adding needed yarn.lock Signed-off-by: cmoulliard <cmoulliard@redhat.com> Check files generated Signed-off-by: cmoulliard <cmoulliard@redhat.com> Adding missing shell parameter Signed-off-by: cmoulliard <cmoulliard@redhat.com> Removing non accessible folder Signed-off-by: cmoulliard <cmoulliard@redhat.com> Moving step to ci.yaml file Signed-off-by: cmoulliard <cmoulliard@redhat.com> Add comments and test using node 20.x too Signed-off-by: cmoulliard <cmoulliard@redhat.com> Published the modules manually and updated project Signed-off-by: cmoulliard <cmoulliard@redhat.com> Fix wrong file to be used to publish: dist/index.cjs.js to dist/index.esm.js for the frontend Signed-off-by: cmoulliard <cmoulliard@redhat.com> Bump versions published Signed-off-by: cmoulliard <cmoulliard@redhat.com> Remove non needed dependency as we dont use yarn workspaces foreach Signed-off-by: cmoulliard <cmoulliard@redhat.com> Align with latest versions published Signed-off-by: cmoulliard <cmoulliard@redhat.com> Removing non needed file Signed-off-by: cmoulliard <cmoulliard@redhat.com> Removing non needed file Signed-off-by: cmoulliard <cmoulliard@redhat.com> Adding the needed scripts used to switch from src files to dist files when we pack or publish otherwise the package.json published will point to the src files and not the compiled ! Signed-off-by: cmoulliard <cmoulliard@redhat.com> Ignore this file package.json-prepack Signed-off-by: cmoulliard <cmoulliard@redhat.com> Passing the version of node to be used using an input parameter to the action Signed-off-by: cmoulliard <cmoulliard@redhat.com>
Signed-off-by: cmoulliard <cmoulliard@redhat.com> Set dry run to test the github flow Signed-off-by: cmoulliard <cmoulliard@redhat.com> Specify the packagemanager to be used Signed-off-by: cmoulliard <cmoulliard@redhat.com> Enable corepack as it is needed to use packageManager yarn > 1.x Signed-off-by: cmoulliard <cmoulliard@redhat.com> Moving corepack enable before calling setup-node. See: actions/setup-node#899 Signed-off-by: cmoulliard <cmoulliard@redhat.com> Removing the hack folder as non needed anymore. Creating an empty yarn.lock file to avoid error: Dependencies lock file is not found Signed-off-by: cmoulliard <cmoulliard@redhat.com> Fix indentation issue Signed-off-by: cmoulliard <cmoulliard@redhat.com> Remove the deprecated parameter to use --immutable Signed-off-by: cmoulliard <cmoulliard@redhat.com> Removing the yarn install strep as it raises a yarn YN0028 error with lockfile Signed-off-by: cmoulliard <cmoulliard@redhat.com> Trying again to install the packages before to tsc compile Signed-off-by: cmoulliard <cmoulliard@redhat.com> Fix proposed by plone/volto-addon-ci#11 concerning lockfile issue Signed-off-by: cmoulliard <cmoulliard@redhat.com> Deleting --immutable to try to fix issue of yarn YN0028 Signed-off-by: cmoulliard <cmoulliard@redhat.com> Using --no-immutable Signed-off-by: cmoulliard <cmoulliard@redhat.com> Adding needed dependency as tsc fails with: TS2688: Cannot find type definition file for 'jest, node' Signed-off-by: cmoulliard <cmoulliard@redhat.com> intall jest Signed-off-by: cmoulliard <cmoulliard@redhat.com> Run foreach to install missing node modules Signed-off-by: cmoulliard <cmoulliard@redhat.com> Let's use the backstage action instead ;-) Signed-off-by: cmoulliard <cmoulliard@redhat.com> Pusing yarn.lock Signed-off-by: cmoulliard <cmoulliard@redhat.com> Using same packageManager version as backstage Signed-off-by: cmoulliard <cmoulliard@redhat.com> Use same action defintion as backstage Signed-off-by: cmoulliard <cmoulliard@redhat.com> Updating yarn.lock file Signed-off-by: cmoulliard <cmoulliard@redhat.com> Removing spaces Signed-off-by: cmoulliard <cmoulliard@redhat.com> Adding .nmprc file Signed-off-by: cmoulliard <cmoulliard@redhat.com> Enabling again corepack as we will use yarn package manager > 1.x Signed-off-by: cmoulliard <cmoulliard@redhat.com> Let's try a build using node 18.x as 20.x fails on ci platform Signed-off-by: cmoulliard <cmoulliard@redhat.com> Switch from tsc:full to tsc Signed-off-by: cmoulliard <cmoulliard@redhat.com> adding to tsc --skipLibCheck false --incremental false Signed-off-by: cmoulliard <cmoulliard@redhat.com> adding to tsc --skipLibCheck false --incremental false Signed-off-by: cmoulliard <cmoulliard@redhat.com> Use workspaces foreach tsc Signed-off-by: cmoulliard <cmoulliard@redhat.com> Removing tsc:full as it do not exist Signed-off-by: cmoulliard <cmoulliard@redhat.com> Install the command supporting foreach subcommand Signed-off-by: cmoulliard <cmoulliard@redhat.com> List the plugin installed Signed-off-by: cmoulliard <cmoulliard@redhat.com> List the plugin installed Signed-off-by: cmoulliard <cmoulliard@redhat.com> Checking what we have as executable under node_modules/.bin Signed-off-by: cmoulliard <cmoulliard@redhat.com> Removing trailing , Signed-off-by: cmoulliard <cmoulliard@redhat.com> Refactor the workflow to use the action of janus-idp project Signed-off-by: cmoulliard <cmoulliard@redhat.com> Push the missing .nvmrc file Signed-off-by: cmoulliard <cmoulliard@redhat.com> Removing packageManager > 1.x Signed-off-by: cmoulliard <cmoulliard@redhat.com> Removing yarn.lock Signed-off-by: cmoulliard <cmoulliard@redhat.com> Set cache-dependency-path Signed-off-by: cmoulliard <cmoulliard@redhat.com> Generating the package-lock.json Signed-off-by: cmoulliard <cmoulliard@redhat.com> Split tsc and build steps Signed-off-by: cmoulliard <cmoulliard@redhat.com> Removing unknow parameter Signed-off-by: cmoulliard <cmoulliard@redhat.com> Removing unknow parameter Signed-off-by: cmoulliard <cmoulliard@redhat.com> Use turbo commands Signed-off-by: cmoulliard <cmoulliard@redhat.com> Add turbo.json config file Signed-off-by: cmoulliard <cmoulliard@redhat.com> Define the needed config files able to find the generated .d.ts Signed-off-by: cmoulliard <cmoulliard@redhat.com> Let's try using turbo ... Signed-off-by: cmoulliard <cmoulliard@redhat.com> Remove cache parameter Signed-off-by: cmoulliard <cmoulliard@redhat.com> Adding needed yarn.lock Signed-off-by: cmoulliard <cmoulliard@redhat.com> Check files generated Signed-off-by: cmoulliard <cmoulliard@redhat.com> Adding missing shell parameter Signed-off-by: cmoulliard <cmoulliard@redhat.com> Removing non accessible folder Signed-off-by: cmoulliard <cmoulliard@redhat.com> Moving step to ci.yaml file Signed-off-by: cmoulliard <cmoulliard@redhat.com> Add comments and test using node 20.x too Signed-off-by: cmoulliard <cmoulliard@redhat.com> Published the modules manually and updated project Signed-off-by: cmoulliard <cmoulliard@redhat.com> Fix wrong file to be used to publish: dist/index.cjs.js to dist/index.esm.js for the frontend Signed-off-by: cmoulliard <cmoulliard@redhat.com> Bump versions published Signed-off-by: cmoulliard <cmoulliard@redhat.com> Remove non needed dependency as we dont use yarn workspaces foreach Signed-off-by: cmoulliard <cmoulliard@redhat.com> Align with latest versions published Signed-off-by: cmoulliard <cmoulliard@redhat.com> Removing non needed file Signed-off-by: cmoulliard <cmoulliard@redhat.com> Removing non needed file Signed-off-by: cmoulliard <cmoulliard@redhat.com> Adding the needed scripts used to switch from src files to dist files when we pack or publish otherwise the package.json published will point to the src files and not the compiled ! Signed-off-by: cmoulliard <cmoulliard@redhat.com> Ignore this file package.json-prepack Signed-off-by: cmoulliard <cmoulliard@redhat.com> Passing the version of node to be used using an input parameter to the action Signed-off-by: cmoulliard <cmoulliard@redhat.com>
Hello @Zamiell , |
Signed-off-by: cmoulliard <cmoulliard@redhat.com>
* WIP. Refactor the backend to use the new backend system. #88 Signed-off-by: cmoulliard <cmoulliard@redhat.com> * The following property "private" has been remeoved by yarn 4.x. from phe plugins package.json Signed-off-by: cmoulliard <cmoulliard@redhat.com> * Fix issue reported within #88 such as violation error. Switch to a more recent version of yarn, add signin page which is needed to use guest auth provider Signed-off-by: cmoulliard <cmoulliard@redhat.com> * Enable corepack to allow to use yarn >= 1.x Signed-off-by: cmoulliard <cmoulliard@redhat.com> * Enable corepack to allow to use yarn >= 1.x within build-k8s-image job too Signed-off-by: cmoulliard <cmoulliard@redhat.com> * Use the command corepack enable before to install the packages Signed-off-by: cmoulliard <cmoulliard@redhat.com> * Move corepack enable task to the correct place Signed-off-by: cmoulliard <cmoulliard@redhat.com> * Use corepack prepare yarn@stable --activate to set the proper package manager as we still got job errors Signed-off-by: cmoulliard <cmoulliard@redhat.com> * Try to use the hack documented here: actions/setup-node#899 Signed-off-by: cmoulliard <cmoulliard@redhat.com> * Add missing yarn.lock file Signed-off-by: cmoulliard <cmoulliard@redhat.com> * Use --immutable-cache as --prefer-offline --frozen-lockfile are deprecated Signed-off-by: cmoulliard <cmoulliard@redhat.com> * Replace --immutable-cache with --immutable Signed-off-by: cmoulliard <cmoulliard@redhat.com> --------- Signed-off-by: cmoulliard <cmoulliard@redhat.com>
Downgrade to yarn@1.22.19 work for me, |
Description:
When using the "setup-node" action, CI non-deterministically fails, meaning that sometimes, I get no errors, and other times, I get errors.
Here is an example CI run where you can see the failures:
https://github.com/IsaacScript/isaacscript/actions/runs/6907352290/job/18794331354
Specifically, the output is as follows:
Thus, we can see that this GitHub Action is failing to install Yarn properly, since Yarn appears to be version 1 instead of version 4.
For more context, we can see that this repository has a GitHub Actions matrix set up where it spawns N jobs and all of the jobs use "setup-node". Thus, since there are some green checkmarks and some red checkmarks, we can see that it fails randomly, and the specific checkmarks that appear are randomized with every commit to the repository.
Action version:
4
Platform:
Runner type:
Tools version:
yarn v4.0.2
More info:
I started seeing this error today, with no other related CI code changes, so the problem is likely to come from this action (or the GitHub Action VM) and not my actual code-base.
The text was updated successfully, but these errors were encountered: