for-mac icon indicating copy to clipboard operation
for-mac copied to clipboard

Docker never moves out of "Starting...." status, Beta34

Open john3exonets opened this issue 9 years ago • 9 comments

Expected behavior

Docker to start and run auto-start containers

Actual behavior

Docker never moves from "Starting" and now gives fatal error window.

Information

  • Full output of the diagnostics from "Diagnose & Feedback" in the menu Docker for Mac: version: 1.13.0-rc4-beta34 (264590153) OS X: version 10.10.5 (build: 14F2109) logs: /tmp/D38D290F-6C5C-4B85-A50A-7B0323B83C60/20161220-123123.tar.gz failure: com.docker.slirp is not running [OK] vmnetd [OK] dns [ERROR] driver.amd64-linux com.docker.driver.amd64-linux -db is not running [OK] virtualization VT-X [OK] app [ERROR] moby /Users/joallen/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/console-ring does not exist [OK] system [OK] moby-syslog [ERROR] db Connection refused (ECONNREFUSED) connecting to /Users/joallen/Library/Containers/com.docker.docker/Data/s40: check if service is running com.docker.db is not running [OK] env [OK] virtualization kern.hv_support [ERROR] slirp Unexpected error ((Failure "Error connecting socket to 9p endpoint unix:/Users/joallen/Library/Containers/com.docker.docker/Data/s51: Unix.Unix_error(Unix.ECONNREFUSED, "connect", "")")) connecting to /Users/joallen/Library/Containers/com.docker.docker/Data/s51 com.docker.slirp is not running slirp check failed with: (Failure "Error connecting socket to 9p endpoint unix:/Users/joallen/Library/Containers/com.docker.docker/Data/s52: Unix.Unix_error(Unix.ECONNREFUSED, "connect", "")") [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/joallen/Library/Containers/com.docker.docker/Data/s60: check if service is running docker ps failed [OK] menubar [OK] disk

This is now worse with Beta34 than it was with Beta33 -- Please see issue #1029

  • A reproducible case if this is a bug, Dockerfiles FTW
  • Page URL if this is a docs issue or the name of a man page

Steps to reproduce the behavior

  1. Start Docker for Mac
  2. ...

john3exonets avatar Dec 20 '16 18:12 john3exonets

I see the same issue, and now i am stuck. I can't access any of my images, and if i try to install an older stable version, all my existing containers and images would be lost.

afulay avatar Dec 21 '16 01:12 afulay

Did you try this one? https://github.com/docker/for-mac/issues/467#issuecomment-243479904

jakubknejzlik avatar Dec 21 '16 01:12 jakubknejzlik

Makes you lose all containers and images. Need a better solution.

afulay avatar Dec 21 '16 01:12 afulay

@john3exonets in beta 34 we added extra integrity checks to look for problems in the Docker.qcow2 before starting the VM. I see in your logs:

block device raised exception: (Failure "Found two references to cluster 48610: 44406.20864 and 25932.17544")

This means that two 64KiB regions of the disk (clusters) are mapped to the same physical part of the file, so that one write will also overwrite the other. It would be unsafe to write to the disk in this state. It's possible this happened in the past and has only been noticed after the beta 34 upgrade.

I recommend that you make a backup of your Docker.qcow2 by:

mv ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2 Docker.qcow2.backup

and then restart the app. I recommend not importing any old containers from toolbox, just in case the problem is caused by the import. Unfortunately your containers and images will need to be rebuilt.

If you wish to try to recover the contents from the backed up Docker.qcow2, try this:

/Applications/Docker.app/Contents/MacOS/qemu-img check -r all Docker.qcow2

Note it's expected to print a lot of lines of the form

ERROR cluster 152878 refcount=0 reference=1

to reflect the fact that we use lazy refcounting and hence the refcounts are all 0-- these errors can be ignored. Once repaired, the file can be moved back and the app started again.

If you try any of that and it doesn't work, please let me know. After the swap file problem with beta 33.1, did you reset to factory defaults? Did you re-import from toolbox? I'd like to understand the lifecycle of this disk. Do you have any ideas how I could reproduce this?

Sorry for the inconvenience!

djs55 avatar Dec 21 '16 12:12 djs55

@afulay please do open a separate ticket with fresh diagnostics to describe your problem. Many different problems can have similar looking symptoms.

djs55 avatar Dec 21 '16 12:12 djs55

I moved the Docker.qcow2 file to the different directory, restarted Docker for Mac, and it startup up just fine (with no containers, of course). Ran the qemu-img check and it error’d like you said it would:

… ERROR cluster 48659 refcount=0 reference=1 ERROR cluster 48660 refcount=0 reference=1 ERROR cluster 48661 refcount=0 reference=1 ERROR cluster 48662 refcount=0 reference=1 ERROR cluster 48663 refcount=0 reference=1 Rebuilding refcount structure Repairing cluster 1 refcount=1 reference=0 Repairing cluster 3 refcount=1 reference=0 Repairing OFLAG_COPIED data cluster: l2_entry=80000000bde20000 refcount=2 Repairing OFLAG_COPIED data cluster: l2_entry=80000000bde20000 refcount=2 The following inconsistencies were found and repaired:

0 leaked clusters
20707 corruptions

Double checking the fixed image now... No errors were found on the image. 48610/1048576 = 4.64% allocated, 2.06% fragmented, 0.00% compressed clusters Image end offset: 3189440512

Shutdown Docker again, moved the just created Docker.qcow2 file out, and put the old, “corrected” Docker.qcow2 file back. Restarted Docker and got all the same errors again….diags were uploaded again if you want to compare. Seems like the Docker image itself is corrupted somehow, somewhere.

I’m going to take out the “bad” Docker.qcow2 and just start over. I knew it was beta and was prepared to loose all my containers, if need be. Quite frankly, if your using containers for stuff you can’t afford to loose, then your not using containers correctly anyway :) I still have the “bad” Docker.qcow2 if you want to look at it.

John

On Dec 21, 2016, at 6:21 AM, Dave Scott <[email protected]mailto:[email protected]> wrote:

@john3exonetshttps://github.com/john3exonets in beta 34 we added extra integrity checks to look for problems in the Docker.qcow2 before starting the VM. I see in your logs:

block device raised exception: (Failure "Found two references to cluster 48610: 44406.20864 and 25932.17544")

This means that two 64KiB regions of the disk (clusters) are mapped to the same physical part of the file, so that one write will also overwrite the other. It would be unsafe to write to the disk in this state. It's possible this happened in the past and has only been noticed after the beta 34 upgrade.

I recommend that you make a backup of your Docker.qcow2 by:

mv ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2 Docker.qcow2.backup

and then restart the app. I recommend not importing any old containers from toolbox, just in case the problem is caused by the import. Unfortunately your containers and images will need to be rebuilt.

If you wish to try to recover the contents from the backed up Docker.qcow2, try this:

/Applications/Docker.app/Contents/MacOS/qemu-img check -r all Docker.qcow2

Note it's expected to print a lot of lines of the form

ERROR cluster 152878 refcount=0 reference=1

to reflect the fact that we use lazy refcounting and hence the refcounts are all 0-- these errors can be ignored. Once repaired, the file can be moved back and the app started again.

If you try any of that and it doesn't work, please let me know. After the swap file problem with beta 33.1, did you reset to factory defaults? Did you re-import from toolbox? I'd like to understand the lifecycle of this disk. Do you have any ideas how I could reproduce this?

Sorry for the inconvenience!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/docker/for-mac/issues/1062#issuecomment-268510114, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAUZowMDI2du-1HrNmnOqSU8XTocCEgwks5rKRnfgaJpZM4LSJ2A.

john3exonets avatar Dec 22 '16 03:12 john3exonets

@john3exonets thanks for being so understanding! We've just released a hotfix beta 34.1 which fixes a corruption bug which is triggered by having a disk imported from toolbox and then later freeing some space and compacting it. Unfortunately the imported disk lacks a qcow feature called "lazy_refcounts" which interacts badly with the compact code.

It may be that the damaged qcow2 is beyond repair now -- I think the best thing to do is continue on with a fresh install and let me know if anything else bad happens.

Sorry for the inconvenience this has caused but thanks a lot for your feedback.

djs55 avatar Dec 22 '16 16:12 djs55

I hope that things are working better now with beta 34.1 and beta 35 ... let me know if not! In the meantime I'll close the ticket but feel free to re-open.

djs55 avatar Jan 10 '17 15:01 djs55

Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.

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

docker-robott avatar Jun 21 '20 03:06 docker-robott