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 validation for symblic-linked path failed since v3.7.0 #806

Closed
2 of 5 tasks
kyontan opened this issue Jul 10, 2023 · 4 comments · Fixed by #809
Closed
2 of 5 tasks

Cache validation for symblic-linked path failed since v3.7.0 #806

kyontan opened this issue Jul 10, 2023 · 4 comments · Fixed by #809
Assignees
Labels
bug Something isn't working

Comments

@kyontan
Copy link

kyontan commented Jul 10, 2023

Description:

Since v3.7.0, the workflow using actions/setup-node started failing for the error described below.
Our repository uses symblic link for some reason, and v3.7.0 had revised cache resolution logic so that I think this is a kind of regression for the change around:

const existingDirectories: string[] = cacheDependenciesPaths
.map(path.dirname)
.filter(unique())
.filter(directory => fs.lstatSync(directory).isDirectory());
if (!existingDirectories.length)
core.warning(
`No existing directories found containing cache-dependency-path="${cacheDependencyPath}"`
);

I've not confirmed the cause, but I expect that the line .filter(directory => fs.lstatSync(directory).isDirectory()); drops symblic linked.

Action version:

v3.7.0

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:

  • node: v12.13.0
  • npm: 612.0
  • yarn: 1.22.19

Repro steps:
A description with steps to reproduce the issue. If you have a public example or repo to share, please provide the link.

Setup repository like following structure:

- app (symbolic link -> app-actual)
- app-actual
  - .node-version
  - package.json
  - yarn.lock
  - ...

workflow file:

name: test

on:
  pull_request:
  push:
    branches:
      - develop

defaults:
  run:
    working-directory: app

jobs:
  test:
    runs-on: monorepo-global-amd64
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version-file: "app/.node-version"
      - run: npm install -g yarn@1
      - uses: actions/setup-node@v3
        with:
          node-version-file: "app/.node-version"
          cache: "yarn"
          cache-dependency-path: |
            app/yarn.lock

Expected behavior:
A description of what you expected to happen.

The 2nd actions/setup-node@v3 step succeeds.

Actual behavior:

The 2nd actions/setup-node@v3 step fails for the error:

image
Run actions/setup-node@v3
  with:
    node-version-file: (snip)
    cache: yarn
    cache-dependency-path: .../yarn.lock
  
    token: ***
    always-auth: false
    check-latest: false
Node version file is not JSON file
Resolved .../... (snip)
Found in cache @ /home/runner/_work/_tool/node/12.13.0/... (snip)
Environment details
  node: v12.13.0
  npm: 612.0
  yarn: 1.22.19
Warning: No existing directories found containing cache-dependency-path="(snip)"
All dependencies are managed locally by yarn3, the previous cache can be used
Error: Path Validation Error: At least one directory or file path is required
@kyontan kyontan added bug Something isn't working needs triage labels Jul 10, 2023
@dusan-trickovic
Copy link

Hello @kyontan ! Thank you for reporting the issue, we will take a closer look and see what can be done :)

@dusan-trickovic dusan-trickovic self-assigned this Jul 11, 2023
@IvanZosimov IvanZosimov linked a pull request Jul 12, 2023 that will close this issue
2 tasks
@dmitry-shibanov
Copy link
Contributor

Hello @kyontan. We've merged the pull request with possible fix. Could you please try to use actions/setup-node@main to confirm that it works as expected.

For now I'm going to reopen the issue.

@dmitry-shibanov dmitry-shibanov self-assigned this Jul 13, 2023
@kyontan
Copy link
Author

kyontan commented Jul 14, 2023

Hi @dmitry-shibanov,

Our team confirmed that the fix in actions/setup-node@main solved the issue and now our CI is working fine.
Thanks for your quick help!

@dmitry-shibanov
Copy link
Contributor

dmitry-shibanov commented Aug 15, 2023

Hello @kyontan. The new version of setup-node was released. For now I'm going to close the issue. If you have any concerns feel free to ping us.

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

Successfully merging a pull request may close this issue.

3 participants