docker / for-mac

Bug reports for Docker Desktop for Mac
https://www.docker.com/products/docker#/mac
2.43k stars 117 forks source link

Docker failed to start after changing disk image location to a nfs mount #2886

Open sarjeet2013 opened 6 years ago

sarjeet2013 commented 6 years ago

Expected behavior

Docker for Mac changed disk image location successfully and newer and older images now resides in the new location

Actual behavior

Docker failed to start after disk image location changed and finished.

Information

Docker for Mac: version: 18.05.0-ce-rc1-mac63 (7e2bb492d35dc35ec0037d8024b7e7be57fc72a9)
macOS: version 10.13.2 (build: 17C88)
logs: /tmp/A30C0CFA-97F6-4382-9DEC-099632C92650/20180507-154012.tar.gz
failure: No Docker.qcow2 or Docker.raw found: the VM has never been started
[ERROR]  vpnkit
         Unexpected error ((Failure
  "Error connecting socket to 9p endpoint unix:/Users/ssingh/Library/Containers/com.docker.docker/Data/s51: Unix.Unix_error(Unix.ECONNREFUSED, \"connect\", \"\")")) connecting to /Users/ssingh/Library/Containers/com.docker.docker/Data/s51
         com.docker.vpnkit is not running
         vpnkit check failed with: Unix.Unix_error(Unix.ECONNREFUSED, "connect", "")
[OK]     virtualization hypervisor
[OK]     vmnetd
[OK]     dns
[ERROR]  driver.amd64-linux
         com.docker.driver.amd64-linux is not running
[OK]     virtualization VT-X
[OK]     app
[OK]     moby
[OK]     system
[OK]     moby-syslog
[ERROR]  kubernetes
         kubernetes check failed with: (Failure
   "exec: /usr/local/bin/kubectl  --context docker-for-desktop --namespace docker get pods -o go-template='{{range .items}}{{.metadata.name}}\
  \n{{end}}': exit 1")
[OK]     files
[OK]     env
[OK]     virtualization kern.hv_support
[ERROR]  osxfs
         com.docker.osxfs is not running
[OK]     moby-console
[OK]     logs
[ERROR]  docker-cli
         Connection refused (ECONNREFUSED) connecting to /var/run/docker.sock: check if service is running
         Connection refused (ECONNREFUSED) connecting to /Users/ssingh/Library/Containers/com.docker.docker/Data/s60: check if service is running
         docker ps failed
[ERROR]  disk
         No Docker.qcow2 or Docker.raw found: the VM has never been started

Docker for Mac: Version 18.05.0-ce-rc1-mac63 (24246)

Steps to reproduce the behavior

  1. Go to Preference -> Disk -> Disk image location and move disk image and change it to a different location (or nfs mount)
  2. Wait for the docker to copy all existing data to new location and once it finishes, is failed to restart docker.
YRM64 commented 6 years ago

Sarjeet2013, there's actually more to this subject and your dilemma. To reproduce the behavior, you indicated that you went to preferences, to disk, to disk image location, and move disk image and change it to a different location (or nfs mount). The data that I read indicated that: 1). An NFS client must be configured ~ which is very challenging. 2). There are other options to serving NFS to your Docker image: -v option for example to mount your volume. It makes it much easier to access NFS.

You can still mount inside your Docker container if you choose to do.

3). You may have to modify your Dockerfile. If I were running on clustered Data ONTAP 8.3 with a 1TB volume, I would even need to add a policy and rule, and apply that to my volume.

For most developers new to the industry, and I'm not referencing any particular individual, don't realize that there are NFS utilities that have to be installed prior to using NFS in your Docker container. And, to run certain NFS functions, one must be certain that all bases have been covered with ensuring that all ancillary processes are also running. The issues I've addressed by no means should be interpreted as small tasks; they are very detailed in specificity; tedious, and time consuming. However, the good news is, it's certainly possible to get it done. For details specific to your operation, visit Running systems within a Docker Container (NFS and Docker). I accessed the Wordpress at https://whyistheinternetbroken.wordpress.com/2015/05/12/tech using-nfs-with-Docker-where-does-it-fit-in/ (using NFS with Docker). The site is helpful with troubleshooting tips and helpful ideas, such as setting up an automounter to automatically mount the NFS mounts whenever needed, rather than mounting them yourself and being vulnerable to errors or a bug. Sample shell scripts are also available to make the process more efficient, and ultimately making the process run much smoother. I hope this helps.

Yvonne Administration Build and Develop (As the World Evolves)

sarjeet2013 commented 6 years ago

@YRM64 Thanks for the response. I believe what you suggested is for NFS issue in the container. BUT, I am not mounting or using nfs in the container.

The issue I am hitting is because of use NFS mount as a location to store all docker images. I have nfs mount working as expected and other filesystem backup also being going to same mount (different dirs) and working fine as well. I was wondering if the issue is related to the docker daemon not being able to recognize something after disk image location is changed and try to restart.

Let me know if you would like me to try few things to get idea about the root cause of the issue.

mitra-mapr commented 6 years ago

I am also hitting the same issue when I tried to move the image location on Mac to NFS mount. The docker daemon is hung. I went back and checked the nfs server location where it is not copying anything to the location specified in the docker preferences.

docker-robott commented 6 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale comment. Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

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. /lifecycle stale

aveiga commented 6 years ago

/lifecycle frozen

aveiga commented 6 years ago

I'm having the same issue where Docker hangs while (or after, it's hard to tell) moving the Disk Image

zhylninc commented 3 years ago
  1. Open Preferences
  2. Find Resources>ADVANCED>Disk image size
  3. Change 64 GB to 16 GB
  4. Apply & Restart
  5. Done
timmattison commented 2 years ago

It's 2022 and I'm still having this problem. Moving my disk image location to a new disk (not even NFS) just gives me a spinner forever.

Resizing to 8 GB without moving to a new location even with 0 bytes used took about 60 seconds.

But after that moving to a new location just fails again. And after that happens you need to nuke everything or you'll get end up with #6190 / #6527. Fun times.