setup-node: Path Validation Error on Cleanup
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:
- Ubuntu
- macOS
- Windows
Runner type:
- Hosted
- Self-hosted
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.
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 10
- Comments: 21 (4 by maintainers)
Commits related to this issue
- fix: version pinning for setup-node action See https://github.com/actions/setup-node/issues/801#issue-1793806107 for context. — committed to meese-os/meeseOS by ajmeese7 9 months ago
- 임시로 actions/setup-node의 cache 옵션을 사용하지 않도록 함 Related: https://github.com/actions/setup-node/issues/801 — committed to titicacadev/triple-frontend by jaehyeon48 9 months ago
- 임시로 actions/setup-node의 cache 옵션을 사용하지 않도록 함 Related: https://github.com/actions/setup-node/issues/801 — committed to titicacadev/triple-frontend by jaehyeon48 9 months ago
- Temporarily disabled the 'cache' option in actions/setup-node actions/setup-node#801 — committed to titicacadev/triple-frontend by zhsks528 8 months ago
- 임시로 actions/setup-node의 cache 옵션을 사용하지 않도록 함 Related: https://github.com/actions/setup-node/issues/801 — committed to titicacadev/triple-frontend by jaehyeon48 9 months ago
- 임시로 actions/setup-node의 cache 옵션을 사용하지 않도록 함 Related: https://github.com/actions/setup-node/issues/801 — committed to titicacadev/triple-frontend by jaehyeon48 9 months ago
- Temporarily disabled the 'cache' option in actions/setup-node actions/setup-node#801 — committed to titicacadev/triple-frontend by zhsks528 8 months ago
- 임시로 actions/setup-node의 cache 옵션을 사용하지 않도록 함 Related: https://github.com/actions/setup-node/issues/801 — committed to titicacadev/triple-frontend by jaehyeon48 9 months ago
I’m also running into the problem of
on Cleanup. Running on @main does not seem to do anything. Has there been any development on new ideas on this topic?
Please validate my account
The error is related to the caching layer, not
setup-node
itself.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.
Workaround
Running
gh cache delete -a
, or manually deletingnode-cache-
cache entries should fix the issue.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.
Important
Do 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
cache
andcache-dependency-path
on setup-node and let it cache the global packages that it’ll just work.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?
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
pnpm install
with so potentially the issue was that there was no cache created and that is why I was getting this error 🤷♂️ … in case someone else runs into the same scenario.Anyways, below is working for me now:
Hope this helps someone!
Hello, @NicholasLYang ! Thank you for creating the issue, we will take a closer look into it and see what can be done 😃