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

Cache can't be used in workspaces #712

Open
2 of 5 tasks
ferferga opened this issue Mar 14, 2023 · 9 comments
Open
2 of 5 tasks

Cache can't be used in workspaces #712

ferferga opened this issue Mar 14, 2023 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@ferferga
Copy link

Description:
When using a repo with workspaces and the latest node versions (which also bundle more up-to-date npm versions), actions fail because it can't retrieve the cache path.

Updating the action version doesn't change anything. I'm sure this is the same thing as npm/cli#6099 but I'm opening this as I think it fits here too, so people affected by this can find this ticket. Maybe there's also some workaround or you can push a bit the npm team to get this fixed quickier :)

Sample failing job

Action version:
v3.5.1

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
node: v18.15.0
yarn: 1.22.19
npm: 9.5.0

Repro steps:

  • Create a repository with npm workspaces
  • Enable cache for the workflow
  • Set a workspace by default, like we did in our .npmrc

Expected behavior:
Cache works as expected and the action succeeds

Actual behavior:
The action halts completely

@ferferga ferferga added bug Something isn't working needs triage labels Mar 14, 2023
@MaksimZhukov
Copy link
Contributor

Hello @ferferga !
Thank you for reporting this! We will investigate the issue

@yandyestrada
Copy link

yandyestrada commented Mar 14, 2023 via email

@ferferga
Copy link
Author

@yandyestrada That's an interesting workaround, thank you!

@MaksimZhukov I think it might be a good idea to invoke the command with the flag, even after npm gets the issue fixed (as far as I understand from the issue at their repo, it's a regression and not an intended bheaviour). I guess it shouldn't harm? Some configs might be workspace-related, but I'm not aware that's the case with the cache path.

@yandyestrada
Copy link

yandyestrada commented Mar 14, 2023 via email

@ferferga
Copy link
Author

@yandyestrada I tried locally with the --ignore-workspaces argument and it doesn't work, so we can't even workaround this that way.

@yandyestrada
Copy link

yandyestrada commented Mar 16, 2023 via email

ferferga pushed a commit to aweebs/jellyfin-vue that referenced this issue Mar 28, 2023
Co-authored-by: Fernando Fernández <ferferga@hotmail.com>

Due to a regression in npm 9.3.0 (upgraded by Node.JS 18 LTS at 18.14.0,
see https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V18.md#2023-02-02-version-18140-hydrogen-lts-bethgriggs-prepared-by-juanarbol),
the `npm get config` command stopped working in workspaces. This made
our actions using actions/setup-node to fail.

Issues were opened in the relevant repositories since january
and february (check npm/cli#6099 and actions/setup-node#712)
but it looks like getting this fixed upstream it's going to take a long time.
We have been waiting for a really long time
for other fixes in npm, so I don't expect this situation will be solved really soon

We need a working CI before the Vue 3 merge, so applying this commit will
solve the issue in the meantime. In the future, it might be interesting
to revert this commit.
ferferga pushed a commit to aweebs/jellyfin-vue that referenced this issue Mar 28, 2023
Co-authored-by: Fernando Fernández <ferferga@hotmail.com>

Due to a regression in npm 9.3.0 (upgraded by Node.JS 18 LTS at 18.14.0,
see https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V18.md#2023-02-02-version-18140-hydrogen-lts-bethgriggs-prepared-by-juanarbol),
the `npm get config` command stopped working in workspaces. This made
our actions using actions/setup-node to fail.

Issues were opened in the relevant repositories since january
and february (check npm/cli#6099 and actions/setup-node#712)
but it looks like getting this fixed upstream it's going to take a long time.
We have been waiting for a really long time
for other fixes in npm, so I don't expect this situation will be solved really soon

We need a working CI before the Vue 3 merge, so applying this commit will
solve the issue in the meantime. In the future, it might be interesting
to revert this commit.

Also format the Gitrhub Actions workflows using the official VSCode GitHub extension
ferferga pushed a commit to aweebs/jellyfin-vue that referenced this issue Mar 28, 2023
Co-authored-by: ferferga <ferferga@hotmail.com>

Due to a regression in npm 9.3.0 (upgraded by Node.JS 18 LTS at 18.14.0,
see https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V18.md#2023-02-02-version-18140-hydrogen-lts-bethgriggs-prepared-by-juanarbol),
the `npm get config` command stopped working in workspaces. This made
our actions using actions/setup-node to fail.

Issues were opened in the relevant repositories since january
and february (check npm/cli#6099 and actions/setup-node#712)
but it looks like getting this fixed upstream it's going to take a long time.
We have been waiting for a really long time
for other fixes in npm, so I don't expect this situation will be solved really soon

We need a working CI before the Vue 3 merge, so applying this commit will
solve the issue in the meantime. In the future, it might be interesting
to revert this commit.

Also format the Gitrhub Actions workflows using the official VSCode GitHub extension
ferferga pushed a commit to aweebs/jellyfin-vue that referenced this issue Mar 28, 2023
Co-authored-by: aweebs <8809837+aweebs@users.noreply.github.com>

Due to a regression in npm 9.3.0 (upgraded by Node.JS 18 LTS at 18.14.0,
see https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V18.md#2023-02-02-version-18140-hydrogen-lts-bethgriggs-prepared-by-juanarbol),
the `npm get config` command stopped working in workspaces. This made
our actions using actions/setup-node to fail.

Issues were opened in the relevant repositories since january
and february (check npm/cli#6099 and actions/setup-node#712)
but it looks like getting this fixed upstream it's going to take a long time.
We have been waiting for a really long time
for other fixes in npm, so I don't expect this situation will be solved really soon

We need a working CI before the Vue 3 merge, so applying this commit will
solve the issue in the meantime. In the future, it might be interesting
to revert this commit.

Also format the Gitrhub Actions workflows using the official VSCode GitHub extension
ferferga added a commit to aweebs/jellyfin-vue that referenced this issue Mar 28, 2023
Co-authored-by: aweebs <8809837+aweebs@users.noreply.github.com>

Due to a regression in npm 9.3.0 (upgraded by Node.JS 18 LTS at 18.14.0,
see https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V18.md#2023-02-02-version-18140-hydrogen-lts-bethgriggs-prepared-by-juanarbol),
the `npm get config` command stopped working in workspaces. This made
our actions using actions/setup-node to fail.

Issues were opened in the relevant repositories since january
and february (check npm/cli#6099 and actions/setup-node#712)
but it looks like getting this fixed upstream it's going to take a long time.
We have been waiting for a really long time
for other fixes in npm, so I don't expect this situation will be solved really soon

We need a working CI before the Vue 3 merge, so applying this commit will
solve the issue in the meantime. In the future, it might be interesting
to revert this commit.

Also format the Gitrhub Actions workflows using the official VSCode GitHub extension
ferferga added a commit to jellyfin/jellyfin-vue that referenced this issue Mar 28, 2023
Co-authored-by: aweebs <8809837+aweebs@users.noreply.github.com>

Due to a regression in npm 9.3.0 (upgraded by Node.JS 18 LTS at 18.14.0,
see https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V18.md#2023-02-02-version-18140-hydrogen-lts-bethgriggs-prepared-by-juanarbol),
the `npm get config` command stopped working in workspaces. This made
our actions using actions/setup-node to fail.

Issues were opened in the relevant repositories since january
and february (check npm/cli#6099 and actions/setup-node#712)
but it looks like getting this fixed upstream it's going to take a long time.
We have been waiting for a really long time
for other fixes in npm, so I don't expect this situation will be solved really soon

We need a working CI before the Vue 3 merge, so applying this commit will
solve the issue in the meantime. In the future, it might be interesting
to revert this commit.

Also format the Gitrhub Actions workflows using the official VSCode GitHub extension
ferferga added a commit to jellyfin/jellyfin-vue that referenced this issue Mar 28, 2023
Co-authored-by: aweebs <8809837+aweebs@users.noreply.github.com>

Due to a regression in npm 9.3.0 (upgraded by Node.JS 18 LTS at 18.14.0,
see https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V18.md#2023-02-02-version-18140-hydrogen-lts-bethgriggs-prepared-by-juanarbol),
the `npm get config` command stopped working in workspaces. This made
our actions using actions/setup-node to fail.

Issues were opened in the relevant repositories since january
and february (check npm/cli#6099 and actions/setup-node#712)
but it looks like getting this fixed upstream it's going to take a long time.
We have been waiting for a really long time
for other fixes in npm, so I don't expect this situation will be solved really soon

We need a working CI before the Vue 3 merge, so applying this commit will
solve the issue in the meantime. In the future, it might be interesting
to revert this commit.

Also format the GitHub Actions workflows using the official VSCode GitHub extension
ferferga added a commit to jellyfin/jellyfin-vue that referenced this issue Mar 30, 2023
Co-authored-by: aweebs <8809837+aweebs@users.noreply.github.com>

Due to a regression in npm 9.3.0 (upgraded by Node.JS 18 LTS at 18.14.0,
see https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V18.md#2023-02-02-version-18140-hydrogen-lts-bethgriggs-prepared-by-juanarbol),
the `npm get config` command stopped working in workspaces. This made
our actions using actions/setup-node to fail.

Issues were opened in the relevant repositories since january
and february (check npm/cli#6099 and actions/setup-node#712)
but it looks like getting this fixed upstream it's going to take a long time.
We have been waiting for a really long time
for other fixes in npm, so I don't expect this situation will be solved really soon

We need a working CI before the Vue 3 merge, so applying this commit will
solve the issue in the meantime. In the future, it might be interesting
to revert this commit.

Also format the GitHub Actions workflows using the official VSCode GitHub extension
ferferga added a commit to jellyfin/jellyfin-vue that referenced this issue Apr 3, 2023
Co-authored-by: aweebs <8809837+aweebs@users.noreply.github.com>

Due to a regression in npm 9.3.0 (upgraded by Node.JS 18 LTS at 18.14.0,
see https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V18.md#2023-02-02-version-18140-hydrogen-lts-bethgriggs-prepared-by-juanarbol),
the `npm get config` command stopped working in workspaces. This made
our actions using actions/setup-node to fail.

Issues were opened in the relevant repositories since january
and february (check npm/cli#6099 and actions/setup-node#712)
but it looks like getting this fixed upstream it's going to take a long time.
We have been waiting for a really long time
for other fixes in npm, so I don't expect this situation will be solved really soon

We need a working CI before the Vue 3 merge, so applying this commit will
solve the issue in the meantime. In the future, it might be interesting
to revert this commit.

Also format the GitHub Actions workflows using the official VSCode GitHub extension
ferferga added a commit to jellyfin/jellyfin-vue that referenced this issue Apr 3, 2023
Co-authored-by: aweebs <8809837+aweebs@users.noreply.github.com>

Due to a regression in npm 9.3.0 (upgraded by Node.JS 18 LTS at 18.14.0,
see https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V18.md#2023-02-02-version-18140-hydrogen-lts-bethgriggs-prepared-by-juanarbol),
the `npm get config` command stopped working in workspaces. This made
our actions using actions/setup-node to fail.

Issues were opened in the relevant repositories since january
and february (check npm/cli#6099 and actions/setup-node#712)
but it looks like getting this fixed upstream it's going to take a long time.
We have been waiting for a really long time
for other fixes in npm, so I don't expect this situation will be solved really soon

We need a working CI before the Vue 3 merge, so applying this commit will
solve the issue in the meantime. In the future, it might be interesting
to revert this commit.

Also format the GitHub Actions workflows using the official VSCode GitHub extension
dvirtz added a commit to dvirtz/vscode-parquet-viewer that referenced this issue Sep 10, 2023
replace caching action due to
actions/setup-node#712
dvirtz added a commit to dvirtz/vscode-parquet-viewer that referenced this issue Sep 10, 2023
replace caching action due to
actions/setup-node#712
dvirtz added a commit to dvirtz/vscode-parquet-viewer that referenced this issue Sep 10, 2023
dvirtz added a commit to dvirtz/vscode-parquet-viewer that referenced this issue Sep 20, 2023
dvirtz added a commit to dvirtz/vscode-parquet-viewer that referenced this issue Sep 20, 2023
@dsame dsame self-assigned this Dec 20, 2023
@dsame
Copy link
Contributor

dsame commented Dec 21, 2023

Hello @ferferga,

I tried to reproduce the problem but the workflow does not fail:

1st run (create cache for /home/runner/.npm): https://github.com/akv-demo/setup-node-test/actions/runs/7285452258/job/19852384806#step:7:19
2nd run (use cache) https://github.com/akv-demo/setup-node-test/actions/runs/7285452258/job/19854946248#step:3:65

The mentioned issue npm/cli#6099 does not seem to relate to this issue because it appears if npm config get runs in the package's folder, but the action calls npm config get cache from within the project root and it does not produce the error: https://github.com/akv-demo/setup-node-test/actions/runs/7287031387/job/19856858523#step:4:15

Can you please help us with the reproducing the problem?

@dvirtz
Copy link

dvirtz commented Apr 8, 2024

@dsame you need to set workspaces=true in .npmrc to reproduce the error

dvirtz added a commit to dvirtz/vscode-parquet-viewer that referenced this issue Apr 8, 2024
bypass actions/setup-node#712 by turning of workspaces for the duration of the setup-node action
@dvirtz
Copy link

dvirtz commented Apr 8, 2024

I'm working around this by running setup-node with

env:
  npm_config_workspaces: false

dvirtz added a commit to dvirtz/vscode-parquet-viewer that referenced this issue Apr 8, 2024
bypass actions/setup-node#712 by turning of workspaces for the duration of the setup-node action
dvirtz added a commit to dvirtz/vscode-parquet-viewer that referenced this issue Apr 8, 2024
bypass actions/setup-node#712 by turning of workspaces for the duration of the setup-node action
dvirtz added a commit to dvirtz/vscode-parquet-viewer that referenced this issue Apr 8, 2024
this is problematic when a workspace calls npm run
as well as issues like actions/setup-node#712
dvirtz added a commit to dvirtz/vscode-parquet-viewer that referenced this issue Apr 8, 2024
this is problematic when a workspace calls npm run
as well as issues like actions/setup-node#712
dvirtz added a commit to dvirtz/vscode-parquet-viewer that referenced this issue Apr 8, 2024
this is problematic when a workspace calls npm run
as well as issues like actions/setup-node#712
dvirtz added a commit to dvirtz/vscode-parquet-viewer that referenced this issue Apr 8, 2024
this is problematic when a workspace calls npm run
as well as issues like actions/setup-node#712
dvirtz added a commit to dvirtz/vscode-parquet-viewer that referenced this issue Apr 8, 2024
this is problematic when a workspace calls npm run
as well as issues like actions/setup-node#712
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

5 participants