actions / cache

Cache dependencies and build outputs in GitHub Actions
MIT License
4.49k stars 1.2k forks source link

Cache breaking builds with "Your cache folder contains root-owned files" - but it doesn't #1171

Closed sammcj closed 10 months ago

sammcj commented 1 year ago

Actions/Cache is breaking a lot of our builds/deploys today with this error:

Run <redacted>/reusable-workflows-if/.github/actions/build-cdk@main
Run echo 'NODE_OPTIONS=--max-old-space-size=1536' >> $GITHUB_ENV
Run npm ci
npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
npm WARN deprecated superagent@7.1.2: Deprecated due to bug in CI build https://github.com/visionmedia/superagent/pull/1677\#issuecomment-1081361876
npm ERR! code EPERM
npm ERR! syscall open
npm ERR! path /home/ec2-user/.npm/_cacache/content-v2/sha512/c8/58/48a90033bb609ad88e1213602edebc557e6a2153d63bc2a191facefe1fb92b936e8d5e12110190e0a9deb1aa3084154a260c4037fc1a3fedf2a62245b590
npm ERR! errno -1
npm ERR! 
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR! 
npm ERR! To permanently fix this problem, please run:
npm ERR!   sudo chown -R 1000:1000 "/home/ec2-user/.npm"

However - this is incorrect, there are no files anywhere in /home/ec2-user/.* that are owned by any user other than ec2-user which is who the Agent is running as.

[root@ip-<redacted> .npm]# ls -laR| grep root
[root@ip-<redacted> .npm]#

Furthermore the file it's complaining about - doesn't even exist.

ls -la /home/ec2-user/.npm/_cacache/content-v2/sha512/c8/58/48a90033bb609ad88e1213602edebc557e6a2153d63bc2a191facefe1fb92b936e8d5e12110190e0a9deb1aa3084154a260c4037fc1a3fedf2a62245b590

ls: cannot access: /home/ec2-user/.npm/_cacache/content-v2/sha512/c8/58/48a90033bb609ad88e1213602edebc557e6a2153d63bc2a191facefe1fb92b936e8d5e12110190e0a9deb1aa3084154a260c4037fc1a3fedf2a62245b590: No such file or directory

Note that the complete log does not provide anything useful.


SCR-20230512-ncif-2

image

github-actions[bot] commented 10 months ago

This issue is stale because it has been open for 200 days with no activity. Leave a comment to avoid closing this issue in 5 days.

github-actions[bot] commented 10 months ago

This issue was closed because it has been inactive for 5 days since being marked as stale.