Skip to content

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

Closed

Description

@kyontan

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

Activity

  1. dusan-trickovic commented on Jul 11, 2023

    @dusan-trickovic

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

  2. linked a pull request that will close this issueResolve SymbolicLink #809on Jul 12, 2023
  3. dmitry-shibanov commented on Jul 13, 2023

    @dmitry-shibanov
    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.

  4. kyontan commented on Jul 14, 2023

    @kyontan
    Author

    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!

  5. dmitry-shibanov commented on Aug 15, 2023

    @dmitry-shibanov
    Contributor

    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

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions