-
Notifications
You must be signed in to change notification settings - Fork 290
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
Re-using a path that was previously mounted as a folders to mount a file does not work #9823
Comments
Thanks for the information! I've been hitting this issue for a few time today as I was tuning my docker-compose config. You know, when I wanted to mount a file like In my case the leftover directory is located in Update: The hash algorithm is SHA256. Removing the leftover directory did workaround this issue. |
Issues go stale after 90 days of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
/remove-lifecycle stale |
Issue is still present in Windows Docker Desktop 3.3.1. rihendri ~/dev/git/master-blaster/linux-shortcuts (master) $ docker run --user=buildengineer --rm -i -t --mount type=bind,source=$HOME/dev/git,target=/dev/git,consistency=cached --mount type=bind,source=/home/rihendri/dev/git/master-blaster/linux-shortcuts/.bash_aliases,target=/home/buildengineer/.bash_aliases rail-dev:latest I had to delete the SHA directory in docker-desktop-bind-mounts to get it recognize, per above. rihendri /mnt/wsl/docker-desktop-bind-mounts/Ubuntu-20.04 $ sudo rmdir ac9c0412e6f10dba0c22c29eb2dc759b4aa2e094c9090e1ba928239edbc8aca4 rihendri ~ $ docker run --user=buildengineer --rm -i -t --mount type=bind,source=$HOME/dev/git,target=/dev/git,consistency=cached --mount type=bind,source=/home/rihendri/dev/git/master-blaster/linux-shortcuts/.bash_aliases,target=/home/buildengineer/.bash_aliases rail-dev:latest |
What is the hash calculated from? |
Wasted 2 hours on this crap! 😡 |
The hash is |
What was essential for me: My directory containing the file to be mounted was a symlinked directory (target on a windows drive in docker's mounted directory), so realpath yielded actually the correct path, but it seems docker expects another path. Symlink:
No corresponding hash for this path existed in Manually trying |
Issues go stale after 90 days of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
/remove-lifecycle stale |
Still getting this on 20.10.8 with the WSL2 backend. This fixed it:
Can this perhaps be set not to go stale? |
This needs a solution. I just spent hours trying to figure out why my NGINX config was failing until I found this issue that was my exact issue. I can't remove the folder as "it's currently in use" meaning I have to fully shut down Docker to even remove it. That's a pretty big pain. |
This should probably be addressed soon... |
Hi, A fix or a better message (maybe with a workaround) would be appreciated. |
Same problem is under Windows 11 / WSL Ubuntu 20.04.3 and Docker 4.3.1 (72247). Please, try to fix this. Thank you. |
This issue is almost 1.5 years old, is there any news on this? |
the same problem |
bump |
+1 for a fix. Add my 2 hours of life to the list that have been wasted on this issue. |
please close docker desktop and all terminals , reopen docker desktop and run docker-compose up :| it worked for me. |
Issues go stale after 90 days of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
/remove-lifecycle stale |
There hasn't been any activity on this issue for a long time. Prevent issues from auto-closing with a /lifecycle stale |
/remove-lifecycle stale |
1 similar comment
/remove-lifecycle stale |
same problem. @hoangtp165 any luck? |
Maybe it helps someone. I had the same issue:
When checking the bind mounts via ls -la /mnt/wsl/docker-desktop-bind-mounts/Ubuntu
Here's what i have done to resolve it:
get-process *docker* | Stop-Process -Force
sudo umount /mnt/wsl/docker-desktop-bind-mounts/Ubuntu/cb467e12876c1cc32cfb6e8646305b3bb9101e24116bf7529dab56dddc4f92f5
sudo rm -rf /mnt/wsl/docker-desktop-bind-mounts/Ubuntu/cb467e12876c1cc32cfb6e8646305b3bb9101e24116bf7529dab56dddc4f92f5
sudo umount /mnt/wsl/docker-desktop-bind-mounts/Ubuntu/44fc05c273fae58e9bedbfd57b270ea60f4b149c86f3b64f98360a6fc6b54625
sudo rm -rf /mnt/wsl/docker-desktop-bind-mounts/Ubuntu/44fc05c273fae58e9bedbfd57b270ea60f4b149c86f3b64f98360a6fc6b54625
Everything should be back to normal. I don't know what causes this. Please Microsoft, fix! |
I am having a similar problem, I am trying to create dev containers it creates some hashed file path and I cannot mount the workspace in vscode. Is there any fix yet? what is causing this issue? |
same problem |
So this seems to be a volume-mapping issue as per the above and comments like this, which I'm sure could be resolved via script somehow, but for a lack of traceable debug info. FWIW I seemed to resolve this on WSL as a side-effect of installing Lando, then updating it to a new version via |
same problem |
Same issue... Each time i get new path... When run |
Same issue on Windows 10, WSL 2, Ubuntu 20. Manifests itself as Laravel Sail PHP files not synced correctly and PHP not able to find files which definitely do exist. |
I am having the same issue in Windows11, WSL2, with Docker version 24.0.7, build afdd53b, directly installed to my Ubuntu 22.04.4 LTS. Please note, I am running WSL2, but I am not running docker-desktop; I am running docker directly in my Ubuntu from apt-get. I have a directory that I bind-mount to my docker container Directly after reboot, if I run the container before I have mounted the local directory, it gets cached somewhere and even if I mount the correct content to the local directory (using local directory as a mount-point) later, the container still sees the old empty mountpoint. This does not happen if I mount the data first thing, before running the container. |
Resetting my Ubuntu via Windows and a restart fixed this for me on Win 10, WSL 2 |
Yes, rebooting my Ubuntu works, but is less than ideal. |
Got this again today, and to confirm, it still works but I needed to umount the directory first. I'm guessing that's more likely to upset Docker? |
Expected behavior
If, using the WSL2 backend, I mount a directory at a local path, I can then at a later point mount a file from the same path.
Actual behavior
The container cannot start, because it gets confused about directory vs file mount. To reproduce:
It seems that this is because there is some stuff related to the bind mount left in
/mnt/host/wsl/docker-desktop-bind-mounts
, keyed by a hash of the path - which means after the firstdocker run
command above, there is a folder at/mnt/host/wsl/docker-desktop-bind-mounts/Ubuntu-20.04/0d1e47568a672c2207104a286da74d16833178614f8ef6fa7021553d27e443a1
(assumingUbuntu-20.04
is the WSL distro name), anddocker run
fails to mount this as a file, with the error message shown above.The text was updated successfully, but these errors were encountered: