Skip to content

Unknown error when copying files > 2GB using fs #30085

@mklnz

Description

@mklnz
  • Version: 10 through 13
  • Platform: Darwin Michaels-Mac-mini.local 19.0.0 Darwin Kernel Version 19.0.0: Wed Sep 25 20:18:50 PDT 2019; root:xnu-6153.11.26~2/RELEASE_X86_64 x86_64
  • Subsystem: fs
  • OS: macOS 10.15 Catalina

I'm having a very strange error on my Mac mini when using fs (both sync and async) copyFile to copy a file larger than 2GB. What's weird is on my MacBook Air with the same software setup there isn't any issues.

I created 2 files for testing using mkfile -n 1999m and mkfile -n 2g, then tried to copy them using node. the 1.999GB file worked fine and the 2GB file failed with unknown error. So there is a clear limit of 2GB here for some reason.

If this isn't a bug, how would one start to diagnose this further? The vague error certainly doesn't help. I've ruled out permission and drive space problems already, even reinstalled macOS from scratch but didn't help.

const fs = require('fs');
fs.copyFileSync('/Users/michael/Movies/wamp/1.mp4', '/Users/michael/Desktop/1.mp4');
internal/fs/utils.js:220
    throw err;
    ^

Error: UNKNOWN: unknown error, copyfile '/Users/michael/Movies/wamp/1.mp4' -> '/Users/michael/Desktop/1.mp4'
    at Object.copyFileSync (fs.js:1790:3)
    at Object.<anonymous> (/Users/michael/Development/homelab/meiti/copy-test.js:3:4)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)
    at internal/main/run_main_module.js:17:11 {   errno: -1429910540,   syscall: 'copyfile',   code: 'UNKNOWN',   path: '/Users/michael/Movies/wamp/1.mp4',   dest: '/Users/michael/Desktop/1.mp4' }

More info on Stackoverflow:
https://stackoverflow.com/questions/58500025/node-unknown-system-error-when-copying-large-files-over-2gb

Metadata

Metadata

Assignees

No one assigned

    Labels

    fsIssues and PRs related to the fs subsystem / file system.libuvIssues and PRs related to the libuv dependency or the uv binding.macosIssues and PRs related to the macOS platform / OSX.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions