Skip to content

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

Description

@acuntex

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions