yarn icon indicating copy to clipboard operation
yarn copied to clipboard

"EFAULT: bad address in system call argument, copyfile

Open matt212 opened this issue 7 years ago • 12 comments

HI,

i am only installing "express": "^4.16.4", but still i am getting below error i tried running command yarn cache clean but error still persists

yarn-error.log

Arguments: 
  /usr/bin/node /usr/share/yarn/bin/yarn.js

PATH: 
  /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

Yarn version: 
  1.13.0

Node version: 
  10.14.0

Platform: 
  linux x64

Trace: 
  Error: EFAULT: bad address in system call argument, copyfile '/home/matt212/.cache/yarn/v4/npm-array-flatten-1.1.1-9a5f699051b1e7073328f2a008968b64ea2955d2/node_modules/array-flatten/package.json' -> '/media/rizwan/New Volume/projects/nodejs_postgres_jquery/node_modules/array-flatten/package.json'




matt212 avatar Mar 27 '19 13:03 matt212

Having the same issue. Have you found a solution for this?

Yarn version: 1.15.2 Node: 10.10.0 Linux x64

karlmosenbacher avatar Apr 25 '19 14:04 karlmosenbacher

Same here on a CI environment:

yarn install v1.15.2
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > [email protected]" has unmet peer dependency "cypress@^2.0.0".
warning " > [email protected]" has unmet peer dependency "webpack@^4.3.0".
warning "@vue/cli-plugin-unit-mocha > [email protected]" has unmet peer dependency "webpack@^4.0.0".
warning " > [email protected]" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0".
error An unexpected error occurred: "EFAULT: bad address in system call argument, copyfile '/usr/local/share/.cache/yarn/v4/npm-@babel-helpers-7.4.2-3bdfa46a552ca77ef5a0f8551be5f0845ae989be/node_modules/@babel/helpers/LICENSE' -> '/var/www/html/front/node_modules/@babel/helpers/LICENSE'".
info If you think this is a bug, please open a bug report with the information provided in "/var/www/html/front/yarn-error.log".

TwanoO67 avatar Apr 29 '19 08:04 TwanoO67

My temporary solution is just to downgrade node to version 8 (8.16.0). It's works fine on MacOS with node version 10, only on Linux machine I have this problem.

zackad avatar May 07 '19 03:05 zackad

I'm experiencing this as well, on Node v11.10.1 & Node v12.2.0 with yarn 1.12.3 inside of a Homestead (Linux Ubuntu 16.04)

error An unexpected error occurred: "EFAULT: bad address in system call argument, copyfile '/home/vagrant/.cache/yarn/v4/npm-@babel-code-frame-7.0.0-06e2ab19bdb535385559aabb5ba59729482800f8/node_modules/@babel/code-frame/LICENSE' -> '/home/vagrant/sites/devmode/node_modules/@babel/code-frame/LICENSE'".

I can manually copy this file just fine... which is odd.

khalwat avatar May 13 '19 15:05 khalwat

I had the same problem, solved it by clearing any 'space character' " " from the paths , and you have a space character in the target path "New volume", then clean yarn cache again, and it should work

bassemhermina avatar Jun 16 '19 14:06 bassemhermina

I also ran into the same problem. I did not have 'space characters' (" ") in a path. But my project was located in other hard drive volume. Yarn version: 1.16.0 Node: 10.9.0 Linux Mint 18.1

My temporary solution was moving project repository from "/media/user/hardDriveVolume" to /home directory. Now it works well. So in my case this issue happens with a repository located in other hard drive volume (in linux "/media" directory). Also maybe in my case this issue is connected with https://github.com/npm/cmd-shim/issues/21. At the same time "npm" worked well with other hard drive volume project path.

@matt212 , can I kindly ask you: Did you fix this issue and does yarn work with "/media" directory path in your case? Thank you in advance!

ajaxjsonjr avatar Jun 20 '19 15:06 ajaxjsonjr

Experiencing this in a Virtualbox/Vagrant environment. Ubuntu 16.04 x64, yarn 1.17.3.

Node 10, 11, and 12 all attempted. No spaces in any of the paths, so that "fix" is not an option.

If I manually copy the file it's struggling with, it just errors on the next one. Fix all the files from one package, and it will error on some other package.

It seems to almost exclusively be non-source code text files, eg. LICENSE, CHANGELOG.md, README.md, etc. I noticed someone else's error further up was for a LICENSE file, too.

brendonrapp avatar Jul 16 '19 21:07 brendonrapp

A quick and dirty hack I've used to get this working: first, locate the cli.js of your copy of yarn. For me, running Ubuntu, the location is /usr/local/lib/node_modules/yarn/lib/cli.js. Then, search for the following line:

    var ficloneFlag = (_fs2 || _load_fs2()).constants.COPYFILE_FICLONE || 0;

and change it to

    var ficloneFlag = 0;

I managed to trace this to the exact line of V8 which fails, wrote a small C program which exhibits the same behavior, and the issue is indeed copying files between different hard drives or partitions. This should be handled properly by V8, so the bug is actually on their side.

Also be aware that this hack only works until you decide to update yarn.

oamaok avatar Aug 20 '19 08:08 oamaok

Hi, This change was introduced in #5456 and updated in #6432, see also #7440, and I ran into that through jupyterlab/jupyterlab#6969. Setting ficloneFlag back to zero fixed it for me. Cheers.

st-bender avatar Aug 28 '19 16:08 st-bender

Hi, It's been a while, I think the problem was in libuv and should be fixed with the latest release (v1.33.0) of libuv. At least for me, could you check? It probably takes some time to propagate to the packagers, though. Cheers.

st-bender avatar Oct 16 '19 19:10 st-bender

Any movement on this?

brendonrapp avatar Feb 14 '20 21:02 brendonrapp

Any movement on this?

Hi, as I wrote above, the issue for me was fixed by the libuv update. But I don't know if that's the case for the OP here.

Cheers.

st-bender avatar Feb 16 '20 19:02 st-bender