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

v3.8.0 - "Cache folder paths are not retrieved for..." #828

Closed
2 of 5 tasks
sammarks opened this issue Aug 14, 2023 · 20 comments
Closed
2 of 5 tasks

v3.8.0 - "Cache folder paths are not retrieved for..." #828

sammarks opened this issue Aug 14, 2023 · 20 comments
Assignees
Labels
bug Something isn't working

Comments

@sammarks
Copy link

Description:
It looks like there might have been a breaking change in the latest version of the action. With the following configuration:

- uses: actions/setup-node@v3
  with:
    node-version: 18
    cache: 'pnpm'

I'm getting during the cleanup step:

Cache folder paths are not retrieved for pnpm with cache-dependency-path = 

Action version:
v3.8.0 - This only started happening within the last 2 hours, and 3.8.0 was released 2 hours ago so that makes me believe there's an issue with the latest release.

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
Node 18, PNPM 7.9.0

Repro steps:
Create a workflow with the following step:

- uses: actions/setup-node@v3
  with:
    node-version: 18
    cache: 'pnpm'

Expected behavior:
I expect the post-setup step to succeed.

Actual behavior:
It fails with an error message instead.

@sammarks sammarks added bug Something isn't working needs triage labels Aug 14, 2023
@sammarks
Copy link
Author

Confirming it works fine if I downgrade to 3.7.0 inside my workflow.

@urbanisierung
Copy link

Can confirm. Getting the same error with the latest version (3.8.0) - works again by downgrading to version 3.7.0.

@dmitry-shibanov
Copy link
Contributor

Hello everyone. Could you please provide a public repository to take a look at the build?

@dmitry-shibanov
Copy link
Contributor

Hello everyone. It looks like the pnpm store path --silent command produces the warning regarding to workspaces. Could you please try to add pnpm-workspace.yaml or remove workspaces section from package.json ?

@sammarks
Copy link
Author

sammarks commented Aug 14, 2023

Ah, could it be warnings output by pnpm store path before outputting the store path? I have an NPM_TOKEN variable in my .npmrc file. Since I do installation in another step, that variable isn't set during the Node setup step. PNPM throws a warning at the beginning of execution saying that variable isn't set, but then it outputs properly.

In the past, I believe the node setup action has just ignored the warnings and used the last line of output. Perhaps something was changed with the 3.8 release that made it try and interpret the first line as the result instead?

Yep; this is the output I get when running pnpm store path --silent with a bogus environment variable:

 WARN  Issue while reading "/Users/sammarks/Code/xxxx/.npmrc". Failed to replace env in config: ${GITHUB_TOKENN}
 WARN  Issue while reading "/Users/sammarks/Code/xxxx/.npmrc". Failed to replace env in config: ${GITHUB_TOKENN}
/Users/sammarks/Library/pnpm/store/v3

I've kept the version of PNPM constant this whole time so this warning can't be new on PNPM's part.

@bryanspears
Copy link

Whatever it was, it was a breaking change with a minor version bump. Affected Actions for us as well. 😄

@dmitry-shibanov dmitry-shibanov self-assigned this Aug 15, 2023
@dmitry-shibanov
Copy link
Contributor

Hello everyone. Could you please try to use actions/setup-node@main to confirm that it works for you?

@t-jimbo
Copy link

t-jimbo commented Aug 15, 2023

The error above-mentioned is resolved, but it does not works for me.
It still fails during the post job cleanup while message is different as follows:

Error: Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.

I tried with the following step:

- uses: actions/setup-node@main
  with:
    node-version: 18
    cache: 'pnpm'

@dmitry-shibanov
Copy link
Contributor

dmitry-shibanov commented Aug 15, 2023

Hello @t-jimbo. Could you please send the build ? If it is not possible to provide a public build could you please provide logs with enabled debug step ?

@t-jimbo
Copy link

t-jimbo commented Aug 15, 2023

Hi @dmitry-shibanov. Here you are.

I assume it relates to #801

Logs - Post Run actions/setup-node@main
##[debug]Evaluating condition for step: 'Post Run actions/setup-node@main'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Post Run actions/setup-node@main
##[debug]Loading inputs
##[debug]Evaluating: (((github.server_url == 'https://github.com') && github.token) || '')
##[debug]Evaluating Or:
##[debug]..Evaluating And:
##[debug]....Evaluating Equal:
##[debug]......Evaluating Index:
##[debug]........Evaluating github:
##[debug]........=> Object
##[debug]........Evaluating String:
##[debug]........=> 'server_url'
##[debug]......=> 'https://github.com'
##[debug]......Evaluating String:
##[debug]......=> 'https://github.com'
##[debug]....=> true
##[debug]....Evaluating Index:
##[debug]......Evaluating github:
##[debug]......=> Object
##[debug]......Evaluating String:
##[debug]......=> 'token'
##[debug]....=> '***'
##[debug]..=> '***'
##[debug]=> '***'
##[debug]Expanded: ((('https://github.com' == 'https://github.com') && '***') || '')
##[debug]Result: '***'
##[debug]Loading env
Post job cleanup.
##[debug]Checking zstd --quiet --version
##[debug]1.5.5
##[debug]zstd version: 1.5.5
##[debug]implicitDescendants 'false'
##[debug]followSymbolicLinks 'true'
##[debug]implicitDescendants 'false'
##[debug]omitBrokenSymbolicLinks 'true'
##[debug]Search path '/home/runner/setup-pnpm/node_modules/.bin/store/v3'
##[debug]Cache Paths:
##[debug][]
Error: Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Post Run actions/setup-node@main

@dmitry-shibanov
Copy link
Contributor

@t-jimbo. Which versions of Nodejs and Pnpm do you use? Do you use composite action? Could you please add a step before cleanups to check that path: /home/runner/setup-pnpm/node_modules/.bin/store/v3 exists ?

@chrisadubois
Copy link

bumping back to 3.7.0 for us also worked

@plato-juan
Copy link

Hello everyone. Could you please try to use actions/setup-node@main to confirm that it works for you?

It worked for me after updating it to actions/setup-node@main

@dmitry-shibanov
Copy link
Contributor

Hello @chrisadubois. If the repository is public could you please provide a build ?

@t-jimbo
Copy link

t-jimbo commented Aug 16, 2023

Which versions of Nodejs and Pnpm do you use? Do you use composite action? Could you please add a step before cleanups to check that path: /home/runner/setup-pnpm/node_modules/.bin/store/v3 exists ?

Ah, sorry. It was my fault.
It worked after changing path provided for actions/cache from node_modules to '**/node_modules'.
It seems cache path is no longer resolved with just node_modules.

[FYI] worked with following:
- uses: actions/checkout@v3 
- uses: pnpm/action-setup@v2
  with:
    version: 8
  
- uses: actions/setup-node@main
  with:
    node-version: 18
    cache: 'pnpm'

- uses: actions/cache@v3
  id: pnpm-cache
  with:
    path: '**/node_modules'
    key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
    restore-keys: |
      ${{ runner.os }}-pnpm-store-
  
- name: Install dependencies
  if: steps.pnpm-cache.outputs.cache-hit != 'true'
  run: pnpm install --frozen-lockfile
  env:
    NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

@jimjasson
Copy link

Hello everyone. Could you please try to use actions/setup-node@main to confirm that it works for you?

@dmitry-shibanov Thanks for the quick fix here -- do you have an ETA for when this will be released?

@dmitry-shibanov
Copy link
Contributor

Hello everyone. We released a new version of setup-node (3.8.1). For now I'm going to close the issue.

@decline
Copy link

decline commented Aug 21, 2023

Still not working for me, using actions/setup-node@v3 (5e21ff4). Getting the following error:

Error: Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.

I'm using the action like this:

    - name: Setup node
      uses: actions/setup-node@v3
      with:
        cache: pnpm

@dmitry-shibanov
Copy link
Contributor

Hello @decline. Could you please send the public build ?

@netroy
Copy link

netroy commented Aug 21, 2023

We are also affected by this issue. I just tried downgrading to 3.7.0, but still got the error. Here is the last failed job.

Looking at the logs, pnpm says that the store is located at /home/runner/.pnpm-store/.
But, actions/setup-node says that the store is located at /home/runner/setup-pnpm/node_modules/.bin/store/v3.

I'm guessing this is some kind of a path conflict with pnpm/action-setup, and there might be two pnpm binaries.

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

10 participants