-
Notifications
You must be signed in to change notification settings - Fork 286
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
Errror mkdir /host_mnt/c: file exists when restarting docker container with mount #1560
Comments
I had the same issue. I was able to resolve it by running: I tried these same steps without restarting my docker, but restarting my computer and that didn't resolve the issue. What resolved the issue for me was removing the volume with the error, restarting my docker, then doing a build again. |
I have the same issue, not even sure it's only after a container restart, seems like a "time-out" :-/ |
Got same error when trying to do Here are my specs: DockerClient: Server: Docker-composedocker-compose version 1.18.0, build 8dd22a96 OSWindows 10 Pro I was just working on a dev-custom image with some volumes when suddenly i got a weird behaviour so i restarted the container and when tried to run that container the error happened
After 5 minutes i just tried to run the containers again and it all worked well again |
Got the same on windows:
|
I was able to resolve it by running at Windows PowerShell (Admin). |
I do have a similar problem. Yesterday I created a container at D:\Users\myname\docker\test (Windows 10 Pro). When I try to restart the container using
I get:
I tried to start the container with the normal command shell and with Windows Power Shell, neither works. Any ideas? docker version: Client: Server: docker info: Containers: 9 |
Follow the instructions stated in the following page: |
We see this a few times a week on 17.12.0-ce-win47 (15139). Sometimes this is transient and the problem goes away after retrying running the container a few times. Other times, restarting Docker helps. Every week or two, we need to reset Docker back to factory defaults to get this working again. This doesn't appear to be a drive sharing security issue. The problem appears to be that the mount point already exists and Docker is trying to mount it again, and that's what's failing. |
@rfulwell's solution worked for me. Thanks! |
@rfulwell's solution works! But it's easier to use the Reset Credentials... button. |
I just rebuilt all images and it worked. |
Same happens to me. It occurs only after a while, or maybe after returning from sleep. But Reseting credentials solves this problem. For a while... |
This is obviously a bug which should be resolved. We are forced to reset docker (or credentials) all the time, it is not acceptable solution. This is introduced with the latest version as I was using previous versions for months and this was never happening before. |
None of the above solutions worked for me. The issue I had in this case was I had a separate user setup since I used a Microsoft account. That all worked fine and dandy but then Microsoft released an update which reset all those permissions on the folders leading up to my working/mount directory and I ended up with this issue. |
Why does it need C drive? store the .composer in the directory im running Ah maybe ~/.composer to ./.composer in the composer.yml. I actually just created a blank file and it seems like it worked. |
I solve it by simply run this safe command
|
FWIW - PHP Storm's Docker integration can contribute to this. Steps to reproduce:
Note I did not use any start/stop functionality in PHPS, I simply clicked 1 container to inspect the ENV & I probably left it 'focused' while stopping/starting. UDP connection probably remained intact, I did not look for this in logs. Log reports "SMB signature verification returned error = -13" |
I just encountered this. $ docker version
Client:
Version: 18.06.0-ce
API version: 1.38
Go version: go1.10.3
Git commit: 0ffa825
Built: Wed Jul 18 19:05:28 2018
OS/Arch: windows/amd64
Experimental: false
Server:
Engine:
Version: 18.06.0-ce
API version: 1.38 (minimum version 1.12)
Go version: go1.10.3
Git commit: 0ffa825
Built: Wed Jul 18 19:13:46 2018
OS/Arch: linux/amd64
Experimental: false Since I was sure I did not change my user password nor did modify permissions on the shared drives, I simply tried to restart the docker daemon and it solved the issue. I'll report back if it happens again (just to make sure my workaround remains consistent I guess...) |
In my case, docker has stopped supporting short windows filenames... I face it using the CLI tool written in Go that uses temp directory, https://golang.org/pkg/io/ioutil/#TempDir, as container mount. To put it more simply:
|
In my case I'm getting this error because I have a junction in the host path |
After upgrading to Docker Desktop 2.2 I had the same issue as above;
Below is a snippet from my failing compose file, the docker-compose.yaml file is located at c:/Users/XXXX/source/repos/MyProject/docker-compose.yaml on Windows 10. version: '3.7'
services:
redis:
container_name: redis
image: "redis:alpine"
ports:
- "6379:6379"
volumes:
- ./_DockerCompose/redis:/data #fails with docker desktop 2.2
#- c:/temp/_DockerCompose/redis:/data #this (obviously?) works with docker desktop 2.2.0.0, was working with previous versions
entrypoint: redis-server --appendonly yes
p3x:
container_name: redisui
image: "patrikx3/p3x-redis-ui"
ports:
- "7843:7843"
volumes:
- ./_DockerCompose/p3x-redis-ui-settings:/settings #fails with docker desktop 2.2.0.0, was working with previous versions
#- c:/temp/_DockerCompose/p3x-redis-ui-settings:/settings #this (obviously?) works with docker desktop 2.2
depends_on:
- redis When switching the volume mounts to point to c:/temp the problem goes away, so yes something fundamental has changed or there is a junction issue? |
Upgrading to Docker Desktop 2.2 resulted in the same error for me. I solved it by changing my relative paths in volumes to full paths. |
The apparently similar error you’re seeing in 2.2.0.0 has a different root cause, the related ticket is #5516 |
FYI I just installed 2.2 and encountered this same error when trying to run any container with a mounted volume. In my case it was because I had my host directory casing incorrect (c:\users\whatever instead of c:\Users\whatever). I'm just mentioning it in case it helps someone else in the same situation. |
Same here after the 2.2 update. |
I'm facing the same problem right now. Been trying latest Docker Desktop for Windows as well as the Docker Desktop from edge channel. My setup details:
When trying uncheck & check again shared drives in the Settings > Resources > File Sharing I'm being prompted to enter the user password all the time (I enter correct password). This happens only AFTER I face the #edit After several tries, restarts and running
To reproduce, simply clone and |
I had a lot of problems with volumes. I catalog some solutions about theses troubles. I hope taht thses solutions can help someone in this topic.
I hope that these tips help someone |
I can also confirm the issue, present after upgrade to 2.2.0.0 (42247),engine 19.03.5 on windows 10 Professional. |
Docker Desktop 2.1.7.0 (41536) on Windows 10 The error I get is as follows:
In
On the first run, the container creates the I would expect docker to re-create To mitigate this issue I can restart Docker Desktop from the task bar, and the container executes as expected. |
After upgrading to 2.2 I'm also getting the same error message, this time with a docker-compose file. I'm using relative paths to locate a configuration file and mount it. Original docker-compose.yaml that was working immediately prior to the update: volumes:
- "./nats-server.conf:/etc/nats/nats-server.conf:ro" "Fixed" configuration that is now working presently: volumes:
- "C:/Git/nats-cluster/spout/nats-server.conf:/etc/nats/nats-server.conf:ro" Observation: The "Git" folder is capitalized on my windows system. When I use the relative path, the error message has it lowercased:
When I explicitly uppercase it in the configuration it's fine. Are relative paths broken because Docker is tolower()'ing something it shouldn't be? |
Okay, just been through this, and the last comment triggered my solution. I had |
Just to add that this also helped in my case after getting these errors suddenly after upgrading Docker. There seems to have been a regression to case sensitive paths for Windows. |
Looks like the issue with version 2.2.0.0 is being tracked in #5516, we should probably not continue that discussion in this thread here. |
Setting the path explicitly worked out for me, thanks |
Simply lowercasing every folder in my driver that matches the volume path seems to solve this for me. I hope a fix for this is introduced that doesn't force me to change anything. |
I clone a project from Github using Visual Studio. The IDE automatically creates a directory under C:\Users\MyName\source\repo |
This is happening to me as well with the latest version. This has never happened to me before. |
I think this ticket has accumulated more than one bug. As far as we know, the original issue (and most or all of the later issues) are fixed in 2.2.0.3, so I'm going to close this ticket. If there are further issues in the latest version, please open a new ticket. Thank you. |
Login Docker again solved the issue. It worked for me ! |
Restarting docker after deleting the container and volume worked for me. |
This is still happening randomly on latest Docker for Windows running on Windows 10 x64. Simply un-sharing and re-sharing the C drive in Docker settings "fixes" the issue, without Docker restart. So the underlying issue seems to still be there. |
Closed issues are locked after 30 days of inactivity. If you have found a problem that seems similar to this, please open a new issue. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
Expected behavior
Container should start normally
Actual behavior
C:\Users\einom>docker start f96263b10996
Error response from daemon: error while creating mount source path '/host_mnt/c/Users/einom/Documents/projects/cap/src': mkdir /host_mnt/c: file exists
Error: failed to start containers: f96263b10996
Information
Docker version: 17.12.0-ce-win47 (15139)
Windows 10 Pro
Version: 1709
Build: 16299.192
Whole C drive is shared with docker VM
Steps to reproduce the behavior
docker run -d --name sonarqube -p 9000:9000 -p 9092:9092 -v c:/Users/einom/Documents/projects/cap/src:/src:rw sonarqube
Of cource it exists because if I understand correctly this /host_mnt/c should point to my whole C: drive ?
The text was updated successfully, but these errors were encountered: