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

No traceback for: EACCES: permission denied, unlink #6058

Closed
domenkozar opened this issue Jul 2, 2018 · 10 comments
Closed

No traceback for: EACCES: permission denied, unlink #6058

domenkozar opened this issue Jul 2, 2018 · 10 comments
Assignees
Labels

Comments

@domenkozar
Copy link

Yarn throw an error without a trace, making it really hard to know where it's coming from.

yarn install v1.8.0
[1/4] Resolving packages...
[2/4] Fetching packages...
error An unexpected error occurred: "EACCES: permission denied, unlink '/nix/store/j0xn98mmavzazn7q0md8jc9jmfkkrmlp-offline/semver-5.5.0.tgz'".
@CreativeNative
Copy link

Is there any progress here? I have a virtual machine with Ubuntu Server (Linux), but the files come from a shared folder of a Windows OS. Possible?

@rustdevbtw
Copy link

@CreativeNative The Error might be due to Linux's File System Permission issue. Please try to use the command with sudo

@CreativeNative
Copy link

Thanks for your response. It's indeed a problem with the Linux file system permissions. I use this option now, and it works for me.

yarn upgrade --no-bin-links

@rustdevbtw
Copy link

@CreativeNative Then you should close this issue!

@CreativeNative
Copy link

@Rajdeep-TG I didn't create the issue, so I can't close it. -_-

@rustdevbtw
Copy link

@domenkozar It seems that you're using Linux or macOS (as per the file includes /).
If its Linux then it can be due to Linux File system issues please try again with sudo.

@merceyz
Copy link
Member

merceyz commented Sep 2, 2021

Not much to go off here so I'll close this

@merceyz merceyz closed this as completed Sep 2, 2021
@jtojnar
Copy link

jtojnar commented May 23, 2022

Running random commands as root just to fix permission issue is not really acceptable. It only takes one bad script to mess up your system.

This issue is about the fact that the error message does not really provide any hints as to what could be causing the permission issue in the first place.

@rustdevbtw
Copy link

@jtojnar The error message shows EACCES: permission denied which means yarn is unable to unlink that file due to permission issue and that's because the file is in /nix/store/j0xn98mmavzazn7q0md8jc9jmfkkrmlp-offline/semver-5.5.0.tgz and it's owned by root (so the user does only have read permission and no write permission). And in Linux, they're ways to fix it (both needs sudo):

  1. Change Permissions for that specific file: sudo chmod 777 /nix/store/j0xn98mmavzazn7q0md8jc9jmfkkrmlp-offline/semver-5.5.0.tgz. If you do it, it may show the error again but for some other module which it needs to unlink too.
  2. Run the same command with sudo. This way, everything is run as root and it's not recommended if you don't know what you're actually doing (the OP didn't tell which command he actually ran).

@jtojnar
Copy link

jtojnar commented May 24, 2022

/nix/store is mounted as read only so the error is not surprising, and changing permissions is not possible.

What I wonder about is why the file is being deleted in the first place. /nix/store/j0xn98mmavzazn7q0md8jc9jmfkkrmlp-offline is a read-only directory that contains the dependency tarballs listed in the lockfile and we point yarn-offline-mirror to it.

Looking at the source code, it should actually points us to a yarn-error.log file that contains the trace, and looking at the full log, it does:

gw2_stats-modules> yarn config v1.22.18
gw2_stats-modules> success Set "yarn-offline-mirror" to "/nix/store/y57xf6nfhhdp80482izrzzsvnydz5yzy-offline".
gw2_stats-modules> Done in 0.02s.
gw2_stats-modules> yarn install v1.22.18
gw2_stats-modules> verbose 0.133278986 Checking for configuration file "/build/.npmrc".
gw2_stats-modules> verbose 0.133617321 Checking for configuration file "/build/yarn_home/.npmrc".
gw2_stats-modules> verbose 0.133835363 Checking for configuration file "/nix/store/i9x1ajwr756r2z9jnb2nhip50a3xms51-nodejs-16.15.0/etc/npmrc".
gw2_stats-modules> verbose 0.134007182 Checking for configuration file "/build/.npmrc".
gw2_stats-modules> verbose 0.134665218 Checking for configuration file "/build/.yarnrc".
gw2_stats-modules> verbose 0.13500649 Checking for configuration file "/build/yarn_home/.yarnrc".
gw2_stats-modules> verbose 0.135284747 Found configuration file "/build/yarn_home/.yarnrc".
gw2_stats-modules> verbose 0.135605081 Checking for configuration file "/nix/store/i9x1ajwr756r2z9jnb2nhip50a3xms51-nodejs-16.15.0/etc/yarnrc".
gw2_stats-modules> verbose 0.135846277 Checking for configuration file "/build/.yarnrc".
gw2_stats-modules> verbose 0.138697808 current time: 2022-05-24T08:23:42.303Z
gw2_stats-modules> [1/4] Resolving packages...
gw2_stats-modules> [2/4] Fetching packages...
gw2_stats-modules> [] 0/1535verbose 0.742112291 Error: EACCES: permission denied, unlink '/nix/store/y57xf6nfhhdp80482izrzzsvnydz5yzy-offline/gw2e_tradingpost_fees___gw2e_tradingpost_fees_1.1.1.tgz'
gw2_stats-modules> error An unexpected error occurred: "EACCES: permission denied, unlink '/nix/store/y57xf6nfhhdp80482izrzzsvnydz5yzy-offline/gw2e_tradingpost_fees___gw2e_tradingpost_fees_1.1.1.tgz'".
gw2_stats-modules> info If you think this is a bug, please open a bug report with the information provided in "/build/yarn-error.log".
gw2_stats-modules> info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

But unfortunately, the “trace” in the yarn-error.log offers no more context:

Trace: 
  Error: EACCES: permission denied, unlink '/nix/store/y57xf6nfhhdp80482izrzzsvnydz5yzy-offline/gw2e_tradingpost_fees___gw2e_tradingpost_fees_1.1.1.tgz'

So this issue is really about improving the debugging information by providing full stack trace in the error message.

Edit: Searching for yarn-offline-mirror, I found the blog post introducing it, which mentions a suspicious yarn-offline-mirror-pruning configuration key. But that should be disabled by default according to the blog post and setting that to false explicitly does not help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants