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

fs.promises.copyFile and fs.copyFileSync fails on Node 22.12 and 23.4 with EPERM: operation not permitted when copying from local disk to a mounted cifs share on alpine #56248

Open
acuntex opened this issue Dec 13, 2024 · 2 comments
Assignees

Comments

@acuntex
Copy link

acuntex commented Dec 13, 2024

Version

22.12 and 23.4

Platform

Linux container 6.8.0-49-generic #49-Ubuntu SMP PREEMPT_DYNAMIC Mon Nov  4 02:06:24 UTC 2024 x86_64 Linux

Subsystem

No response

What steps will reproduce the bug?

  • Use node:22.12.0-alpine3.20 or node:23.4.0-alpine3.20 as container image.
  • Mount a cifs share.
  • Use fs.copyFileSync or fs.promises.copyFile to copy a file from the container file system to the mounted share

How often does it reproduce? Is there a required condition?

Every time

What is the expected behavior? Why is that the expected behavior?

The file get's copied.

What do you see instead?

Error: EPERM: operation not permitted, copyfile '/tmp/file.txt' -> '/share/file.txt'
    at Object.copyFile (node:internal/fs/promises:621:10)
    at test {
  errno: -1,
  code: 'EPERM',
  syscall: 'copyfile',
  path: '/tmp/file.txt',
  dest: '/share/test.txt'
}

Additional information

Rolling back to 22.11 fixes the issue.

@acuntex acuntex changed the title fs.promises.copyFile and fs.copyFileSync fails on Node 22.12 and 23.4 with EPERM: operation not permitted when copy from local disk to a mounted cifs share on alpine fs.promises.copyFile and fs.copyFileSync fails on Node 22.12 and 23.4 with EPERM: operation not permitted when copying from local disk to a mounted cifs share on alpine Dec 13, 2024
@cjihrig
Copy link
Contributor

cjihrig commented Dec 13, 2024

This is likely related to the libuv update in 22.12.0, which included changes for uv_fs_copyfile(). My guess would be libuv/libuv#4396 (cc @juanarbol)

@juanarbol
Copy link
Member

Whoops. Let me work on this one.

@juanarbol juanarbol self-assigned this Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants