You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fs.copyFile not working with docker volumes #21329
Expected behaviour - it copies the file
Actual behaviour - it fails to copy but no error is reported. This is not a file permissions issue as the command line cp command works as the same user. Also if the destination exists, it gets deleted, but the overwriting file doesn't get written.
The above code works if the files are not on a docker volume. The old method using createReadStream and createWriteStream also works.
Are there any specific dependencies that copyFile would use, that I could check for inside the container (dynamic libs perhaps)?
I'm not sure where to go with this, if it's a heroku buildpack issues I could open something there, or it may be something I need add to herokuish. Perhaps knowing about missing dependencies would help.
@crisward I don't know if it's possible for you to run that code with strace (strace -f node script.js) and post the output somewhere. (You'll need to run the container with --cap-add SYS_PTRACE)
Activity
addaleax commentedon Jun 14, 2018
@nodejs/fs @nodejs/libuv
santigimeno commentedon Jun 14, 2018
@crisward it's working for me with the official node docker image (
v10.4.1).crisward commentedon Jun 14, 2018
@santigimeno Thanks for checking, I'll dig further and see what underlying docker image actually gets pulled.
crisward commentedon Jun 14, 2018
Are there any specific dependencies that copyFile would use, that I could check for inside the container (dynamic libs perhaps)?
I'm not sure where to go with this, if it's a heroku buildpack issues I could open something there, or it may be something I need add to herokuish. Perhaps knowing about missing dependencies would help.
santigimeno commentedon Jun 14, 2018
@crisward I don't know if it's possible for you to run that code with strace (
strace -f node script.js) and post the output somewhere. (You'll need to run the container with--cap-add SYS_PTRACE)crisward commentedon Jun 14, 2018
Hope this helps.
https://gist.github.com/crisward/254896e0df574217dc70b9479dfbea70
cjihrig commentedon Jun 14, 2018
It looks like
fchmod()is failing:fchmod(11, 0100666) = -1 EPERM (Operation not permitted)santigimeno commentedon Jun 14, 2018
Yeah, but from the original comment it seems the error is not reported
crisward commentedon Jun 14, 2018
That's correct, the error comes back null.
cjihrig commentedon Jun 14, 2018
Figured it out. PR for libuv coming...
unix: set errno in uv_fs_copyfile()
targos commentedon Jun 14, 2018
Reopening until we get a libuv update
deps: upgrade to libuv 1.21.0
unix: set errno in uv_fs_copyfile()