Skip to content

fs.copyFile not working with docker volumes #21329

Closed
@crisward

Description

@crisward
  • Version:v10.4.1 (but seems to apply to any version of node using copyFile, tried 8.11 too)
  • Platform: Linux 9c6e47477060 3.13.0-86-generic # 131-Ubuntu SMP Thu May 12 23:33:13 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux (inside docker container)
  • Subsystem: filesystem / fs
require("fs").copyFile("/somevolume/text.txt","/somevolume/text2.txt",(err)=>{console.log(err)})

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.

The docker image I am using is the heroku buildpack. https://github.com/heroku/heroku-buildpack-nodejs. (with dokku)

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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions