When copying a file from nfs mount to the same nfs mount, fs.copyFileSync fails with ENOTSUP error.
This was not replicated in Node 12.x, but is reproducible consistently in node v14.15.1
To reproduce using 2 line test file
Using node 14.15.1 on CentOS 7 X86_64
And make sure /mnt/nfs_assets/ is an nfs4 mount.
[root@local]# cat <<'EOF' > test.js
const fs = require('fs');
fs.copyFileSync('/mnt/nfs_assets/source.txt', '/mnt/nfs_assets/dest.txt');
EOF
[root@local]# cat <<'EOF' > /mnt/nfs_assets/source.txt
foorbar
EOF
[root@local]# node test.js
internal/fs/utils.js:308
throw err;
^
Error: ENOTSUP: operation not supported on socket, copyfile '/mnt/nfs_assets/source.txt' -> '/mnt/nfs_assets/dest.txt'
at Object.copyFileSync (fs.js:1991:3)
at Object.<anonymous> (/home/user/test.js:2:4)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47 {
errno: -95,
syscall: 'copyfile',
code: 'ENOTSUP',
path: '/mnt/nfs_assets/source.txt',
dest: '/mnt/nfs_assets/dest.txt'
}
I haven't researched this much, but the ifdef (linux) second was added recently and is now using the copyfile call but does not account for ENOTSUP being returned?
Relevant commit.
cf34854
Please let me know if you need any additional information.
When copying a file from nfs mount to the same nfs mount, fs.copyFileSync fails with ENOTSUP error.
This was not replicated in Node 12.x, but is reproducible consistently in node v14.15.1
To reproduce using 2 line test file
Using node 14.15.1 on CentOS 7 X86_64
And make sure /mnt/nfs_assets/ is an nfs4 mount.
I haven't researched this much, but the ifdef (linux) second was added recently and is now using the copyfile call but does not account for ENOTSUP being returned?
node/deps/uv/src/unix/fs.c
Line 904 in feab91a
Relevant commit.
cf34854
Please let me know if you need any additional information.