-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Path Validation Error on Cleanup #801
Comments
Hello, @NicholasLYang ! Thank you for creating the issue, we will take a closer look into it and see what can be done :) |
Hello @NicholasLYang. We've merged the pull request with possible fix. Could you please try to use For now I'm going to reopen the issue. |
Hi, I'll try it out! Thanks so much for responding so quickly |
Getting a new error here |
Hello @NicholasLYang. Thank you for your response. Could you please enable debug for you job and add this step after integration tests: - run: |
cachedPath=$(pnpm store path --silent)
echo "cached path is $cachedPath"
[ -d "$cachedPath" ] && echo "Directory $cachedPath exists." |
Hello @NicholasLYang, just a gentle ping. |
I'm getting the same error
I wonder if it has to do with removing the optional part of this check 8170e22#diff-55f15e2366942ad15f71a41ac983f8ce9a9882b28b7fd9082f3a26c799783064L16 |
Hello @eddiemonge. Could you please attach a failed build? I think you can have the same issue as this. |
I was getting similar errors. Started with v3 and
https://github.com/movehq/Hub/actions/runs/5728412193 Which led me to #803 so I tried @main. (ca2d4e0) which then errored:
https://github.com/movehq/Hub/actions/runs/5728573485/job/15523437090 |
I'm also running into the problem of
on Cleanup. |
Whenever I tried pinning to Post job cleanup.
/home/runner/setup-pnpm/node_modules/.bin/pnpm store path --silent
/home/runner/setup-pnpm/node_modules/.bin/store/v[3](https://github.com/meese-os/meeseOS/actions/runs/6292934770/job/17082829140?pr=156#step:12:3)
Error: Cache folder path is retrieved for pnpm but doesn't exist on disk: /home/runner/setup-pnpm/node_modules/.bin/store/v3 Any ideas on how to proceed from here? |
Getting this after upgrading from yarn 1 to 3. Any solutions? |
Fyi I had this error when using node v16 and when I changed to v18 it now works with pnpm cache! Note the other thing I noticed is that it was failing in a workflow of mine that I actually did not run Anyways, below is working for me now: name: Test pnpm install and cache
on:
workflow_dispatch:
jobs:
test-pnpm-install-and-cache:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-latest]
steps:
- name: Checkout the code
uses: actions/checkout@v3
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Test pnpm list
run: pnpm list
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} Hope this helps someone! |
I am running into this issue with node 18.17 + yarn 4 once a while. Any debugging I can do to help resolve this issue? |
any updates on this one? (using node 18 + pnpm inside a composite action) |
name: Workflow de Pull Requests
on:
pull_request:
branches:
- main
- staging
jobs:
install_dependencies:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- uses: actions/cache@v3
name: Cache node_modules
id: cache-nodemodules
with:
path: node_modules
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
run: pnpm install
build:
runs-on: ubuntu-22.04
needs: install_dependencies
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'pnpm'
- uses: actions/cache@v3
name: Restore node_modules
with:
path: node_modules
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
- run: pnpm build What's wrong here? |
The error is related to the caching layer, not As it's a post-setup step, it should just show a warning instead of throwing an error, as this breaks actions that use multiple jobs. This error can occur if there's an apparently valid cache entry stored for the action and the repo suffered some change after the cache was made, like a folder rename. WorkaroundRunning Also, editing package-lock.json, yarn.lock or pnpm-lock.yaml by just updating some package will create a new cache key and ignore the older one. ImportantDo not try to be clever and cache node_modules. It uses symlinks/hard links to save space, but caching it can make debugging your actions a living hell, whence setup-node just don't cache it. Node will show weird errors that are hard to make sense, and the action can fail sometimes, but not always (depending on cache invalidation). Simply configure |
How to do this inside an action? 🤔
Does this need to be installed explicitly? |
This is the github cli. You run it locally on your machine. This specific command will interact with stored workflow caches, like the ones shown on this page. You shouldn't run this from the action. If you really think clearing the cache all the time is the solution, it's much simpler to just disable the caching entirely by removing |
I was having this issue when upgrading from v2 to v4 What helped me was to move Previously I would only do Here's my action with v2:
Here's my action with v4:
Hope this helps someone, cheers! |
Please validate my account |
Our solution (TLDR): remove the We were having the exact same error with |
In my project, I forgot to add a step to run |
I'm getting this with
but then during the cache save I see
So, something isn't properly detecting that the path is absolute, and is inappropriately prepending the working directory. That seems to maybe be a bug in @actions/cache? |
Hi @NicholasLYang, The "Path Validation Error" occurs because the specified path for caching does not exist, so no cache is being saved. This is expected behavior when the action has nothing to restore. To reslove this issue, ensure that dependencies are installed before the cleanup step by including an additional step to install them.
Adding this step to your workflow ensures that there is something to cache, which prevents the path validation error. Attached is a screenshot of the sucessful workflow after installing the dependencies. If you have any other issues or questions, please let us know. |
Hi @NicholasLYang, Just a gentle reminder regarding this issue, If you have any updates or need further assistance, Please let us know. |
1 similar comment
Hi @NicholasLYang, Just a gentle reminder regarding this issue, If you have any updates or need further assistance, Please let us know. |
Hi @NicholasLYang, Due to inactivity, I'm going to close this issue for now. Please feel free to reopen this issue or create a new one if necessary. Thank you. |
Description:
Getting
Error: Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.
on cleanup for action
Action version:
3.7.0
Platform:
Runner type:
Tools version:
Node 18, pnpm 7.12.1
Repro steps:
Example run
Expected behavior:
Clean up with no errors.
Actual behavior:
Path validation error on clean up.
This appears to be new to 3.7.0, because when we pinned the version to 3.6.0, it went away.
The text was updated successfully, but these errors were encountered: