-
Notifications
You must be signed in to change notification settings - Fork 67
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
node.js scandir confuses files and directories in a bind mount in a Windows container #212
Comments
Thanks for the details, confirming this reproed for me as well on a WS2022 machine. It works fine if you run the container under process isolation, but with Hyper-V isolation, it threw the EISDIR error as you said. Acknowledging that process isolation is not a mitigation for you since you're on a 1909 host and are targeting a 2019 image. I've referred this issue to some engineers on my side and will get back to you when we have an update. |
Opened MSFT internal 38776845 to track. Not much to share yet. |
No updates, just bumping so that the bot doesn't close this. I can confirm that this is still an issue. |
This issue has been open for 30 days with no updates. |
No updates, just bumping so that the bot doesn't close this. I can confirm that this is still an issue. |
This issue has been open for 30 days with no updates. |
Definitely continues to repro. The impact for my workload is that I can't use bind mounts to run my node.js applications (or build scripts) in a Windows container. You can workaround this issue by making a local copy of the bind mount inside the container's filesystem. But that's unnecessary overhead. The same scenario works fine in Ubuntu or Centos containers using the Linux docker platform. This is a common pattern in continuous integration (CI) workloads. The CI server checks source out on an agent machine, then bind mounts the source directory into a container to run something. Examples: |
It totally blocks using volumes for builds directories, as it's advised - use volumes to not store data as layers in container. host:
inside container:
|
This issue has been open for 30 days with no updates. |
No updates, just bumping so that the bot doesn't close this. I can confirm that this is still an issue. |
This issue has been open for 30 days with no updates. |
No updates, just bumping so that the bot doesn't close this. I can confirm that this is still an issue. |
This issue has been open for 30 days with no updates. |
No updates, just bumping so that the bot doesn't close this. I can confirm that this is still an issue. |
No updates to share yet, still working on this issue. |
This issue has been open for 30 days with no updates. |
No updates, just bumping so that the bot doesn't close this. I can confirm that this is still an issue. |
This issue has been open for 30 days with no updates. |
1 similar comment
This issue has been open for 30 days with no updates. |
Any news? I hope this message prevents the bot from closing the issue. |
This issue has been open for 30 days with no updates. |
4 similar comments
This issue has been open for 30 days with no updates. |
This issue has been open for 30 days with no updates. |
This issue has been open for 30 days with no updates. |
This issue has been open for 30 days with no updates. |
This issue has been sitting idle for too long and deserves an update. Within Microsoft we've been looking into this issue. The root problem is related to differences between how mapped folders are exposed to Hyper-V containers. With process-isolated containers, we can do some straightforward namespace virtualization to expose the host folder into the container. Things are a bit more complicated with Hyper-V containers. We still leverage namespace virtualization, but we also need a way to expose the folder between machines. Therefore, with Hyper-V containers we use an SMB share from the host to share content with the container and then use namespace virtualization to make it appear properly within the container namespace. SMB, however, blocks certain operations for security reasons. For example, SMB blocks the creation of certain reparse points as that would potentially allow the requestor a way to escape the share and get access to other host content. With the issue described in this thread, node.js is trying to create a junction and it is being blocked by SMB. So, in a sense the behavior is by design for SMB. However, the use of SMB is just an implementation detail, and our desire is functional parity between container types. We are therefore investigating options for how we can maintain the required security but still allow this type of functionality within a container. As mentioned earlier in this thread, a work around for this problem is to copy content from the shared folder to the local volume for processing. We'll update the thread with more details as our internal investigation concludes. |
This issue has been open for 30 days with no updates. |
14 similar comments
This issue has been open for 30 days with no updates. |
This issue has been open for 30 days with no updates. |
This issue has been open for 30 days with no updates. |
This issue has been open for 30 days with no updates. |
This issue has been open for 30 days with no updates. |
This issue has been open for 30 days with no updates. |
This issue has been open for 30 days with no updates. |
This issue has been open for 30 days with no updates. |
This issue has been open for 30 days with no updates. |
This issue has been open for 30 days with no updates. |
This issue has been open for 30 days with no updates. |
This issue has been open for 30 days with no updates. |
This issue has been open for 30 days with no updates. |
This issue has been open for 30 days with no updates. |
Describe the bug
node.js scandir confuses files and directories in a bind mount in a Windows container.
See isaacs/node-glob#436. This is the same issue, but with more detailed repro steps.
To Reproduce
Dockerfile:
Create another folder for source files, outside of the docker context.
mkdir demo
Add this package.json file to
demo
Create a subfolder containing a yarn workspace
mkdir demo\subfolder
Add this package.json file to
demo\subfolder
docker build the Dockerfile
docker run -it -m4g -v c:\path\to\demo:c\mountpoint -w c:\mountpoint [image id from docker build]
Inside the container:
Expected behavior
Run the same command outside the container (assuming you have node.js and yarn installed), and it works without an error. Yarn is calling glob over the contents of the directory, and iterating the results based on the entry type. In the bind mount, it is getting confused by the files -- presumably because they are some sort of unexpected reparse point? I have no idea if this is an issue in hcsshim, or in the node.js libuv IO provider.
Configuration:
Additional context
The text was updated successfully, but these errors were encountered: