docker / for-mac

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

Docker still asks endlessly for admin password, will not complete setup #2934

Closed tla closed 6 years ago

tla commented 6 years ago

This is a follow-on from issue #2562.

Expected behavior

Docker should complete installation and start up.

Actual behavior

Docker asks endlessly for an administrator password, and never starts. If I exit, and try starting Docker from the command line with sudo, I get a "Fatal Error: Failed to register new version" and the following diagnostic. If I choose "reset to factory defaults" and restart, it asks repeatedly for an administrator password again, and there is no way to produce a diagnostic.

Information

Diagnostic logs

Docker for Mac: version: 18.03.1-ce-mac65 (dd2831d4b7421cf559a0881cc7a5fdebeb8c2b98)
macOS: version 10.13.4 (build: 17E202)
logs: /tmp/51F8A3EE-8A08-4BE7-A8F2-ECE3E304EBE8/20180523-102624.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:/var/root/Library/Containers/com.docker.docker/Data/s51: Unix.Unix_error(Unix.ENOENT, \"connect\", \"\")")) connecting to /var/root/Library/Containers/com.docker.docker/Data/s51
         com.docker.vpnkit is not running
         vpnkit check failed with: Unix.Unix_error(Unix.ENOENT, "connect", "")
[ERROR]  vmnetd
         /var/tmp/com.docker.vmnetd.socket does not exist
         Unexpected error (No such file or directory) connecting to /var/tmp/com.docker.vmnetd.socket
         /private/tmp/vmnetd/com.docker.vmnetd is not running
[OK]     dns
[ERROR]  driver.amd64-linux
         com.docker.driver.amd64-linux is not running
[OK]     virtualization VT-X
[OK]     app
[ERROR]  moby
         /var/root/Library/Containers/com.docker.docker/Data/vms/0/console-ring does not exist
[OK]     system
[OK]     moby-syslog
[OK]     kubernetes
[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
         cannot find docker
         /var/run/docker.sock does not exist
         Unexpected error (No such file or directory) connecting to /var/run/docker.sock
         /var/root/Library/Containers/com.docker.docker/Data/s60 does not exist
         Unexpected error (No such file or directory) connecting to /var/root/Library/Containers/com.docker.docker/Data/s60
         docker ps failed
[ERROR]  disk
         No Docker.qcow2 or Docker.raw found: the VM has never been started

Steps to reproduce the behavior

  1. Click on the Docker app
  2. Input admin user/password when prompted
akimd commented 6 years ago

Bummer... It already happened to me, and magically vanished. I never fully understood what was going wrong.

Could you try to remove by hand com.docker.vmnetd?

sudo rm /Library/PrivilegedHelperTools/com.docker.vmnetd

and try again?

akimd commented 6 years ago

Something is really weird in your case: it looks like $HOME is /var/root. Are you doing something fancy here?

tla commented 6 years ago

I tried removing com.docker.vmnetd by hand, with no joy. As for the weird $HOME setting I have no idea, as I am not doing anything fancy:

Taras-MacBook-Pro:~ tla$ echo $HOME
/Users/tla
Taras-MacBook-Pro:~ tla$ sudo !!
sudo echo $HOME
Password:
/Users/tla

Might the weird HOME setting have something to do with the fact that, in order to get to a state where I can generate the report, I have to run it from the command line under sudo? For that matter, should I be trying this with any particular different arguments?

sudo /Applications/Docker.app/Contents/MacOS/Docker

akimd commented 6 years ago

Yes, that's probably the problem. Instead, try

/Applications/Docker.app/Contents/Resources/bin/docker-diagnose -l 1d --upload

and report the full diagnostics ID (with the /DATE). TIA!

tla commented 6 years ago

OK - output below!

Taras-MacBook-Pro:~ tla$ sudo /Applications/Docker.app/Contents/Resources/bin/docker-diagnose -l 1d --upload
Password:
macOS: version 10.13.4 (build: 17E202)
Docker.app: version: 18.03.1-ce-mac65 (dd2831d4b7421cf559a0881cc7a5fdebeb8c2b98)
Local time: Fri May 25 12:25:44 CEST 2018
UTC:        Fri May 25 10:25:44 UTC 2018
Timestamp:  20180525-122544
Running diagnostic tests:
[OK]      Files
[ERROR]   Docker CLI       cannot find docker
[ERROR]   Docker CLI       /var/run/docker.sock does not exist
[ERROR]   Docker CLI       Unexpected error (No such file or directory) connecting to /var/run/docker.sock
[ERROR]   Docker CLI       /Users/tla/Library/Containers/com.docker.docker/Data/s60 does not exist
[ERROR]   Docker CLI       Unexpected error (No such file or directory) connecting to /Users/tla/Library/Containers/com.docker.docker/Data/s60
Error docker ps: timeout after 10.00s
[ERROR]   docker-cli       docker ps failed: (Failure "docker ps: timeout after 10.00s")
[ERROR]   Moby booted      /Users/tla/Library/Containers/com.docker.docker/Data/vms/0/console-ring does not exist
[ERROR]   driver.amd64-linux com.docker.driver.amd64-linux is not running
[ERROR]   vmnetd           /var/tmp/com.docker.vmnetd.socket does not exist
[ERROR]   vmnetd           Unexpected error (No such file or directory) connecting to /var/tmp/com.docker.vmnetd.socket
[ERROR]   vmnetd           /private/tmp/vmnetd/com.docker.vmnetd is not running
[ERROR]   osxfs            com.docker.osxfs is not running
[ERROR]   VPNKit           Unexpected error ((Failure
  "Error connecting socket to 9p endpoint unix:/Users/tla/Library/Containers/com.docker.docker/Data/s51: Unix.Unix_error(Unix.ENOENT, \"connect\", \"\")")) connecting to /Users/tla/Library/Containers/com.docker.docker/Data/s51
[ERROR]   VPNKit           com.docker.vpnkit is not running
Error docker ps: got timeout (docker ps: exit 127)
[ERROR]   disk             No Docker.qcow2 or Docker.raw found: the VM has never been started
[OK]      environment
[OK]      Docker
[OK]      VT-x
[OK]      kern.hv_support
Most specific failure is: No Docker.qcow2 or Docker.raw found: the VM has never been started
Docker logs are being collected into /tmp/68EF7C27-9E98-4C95-AC06-679E68C6A76A/20180525-122544.tar.gz
Your unique id is: 68EF7C27-9E98-4C95-AC06-679E68C6A76A
Please quote this in all correspondence.
akimd commented 6 years ago

You don't need to sudo. Why did you think you had to do that?

I still see nothing specific in your report. In particular in the logs I don't see the attempts to install vmnetd, which is the tool that needs special privileges.

tla commented 6 years ago

Concerning sudo: I originally got the idea to try on the command line from someone else's thread either here or on Stack Overflow, and assumed sudo was necessary since the original problem involved endlessly repeated requests for my system password.

Concerning vmnetd, at what point should its installation be attempted? As mentioned, if I try to run Docker normally through the Finder, I get asked for my password over and over until I give up. Is there a way to do the installation on the command line?

akimd commented 6 years ago

Hey @tla, could you try this Docker for Mac: https://download-stage.docker.com/mac/pr/24725/Docker.dmg? There's a small chance that it will help you fix your problem. Before running it, I'd like you to run launchctl print-disabled system, and include the result here.

Thanks in advance!

(There are good chances that your problems come from a mixture of sudo uses and non uses. You do not need sudo to install Docker. Except if you already did I guess :).

akimd commented 6 years ago

Concerning vmnetd, at what point should its installation be attempted?

When Docker is asking for your password, it's to grant the com.docker.vmnetd tool special rights. It's not directly part of the installation; let's that installation is "finished" at the first run.

And if you never saw the Groundhog Day, then you should do that soon.

tla commented 6 years ago

OK, that seems to have fixed it - the problem does appear to have to do with launchctl. Output you requested:

disabled services = {
    "com.docker.helper" => true
    "com.apple.ftpd" => true
    "com.apple.mdmclient.daemon.runatboot" => true
    "com.docker.vmnetd" => true
    "com.apple.mtmfs" => false
    "com.docker.docker" => true
    "org.ntp.ntpd" => false
    "com.apple.backupd-auto" => false
}

When I ran the Docker version you linked to, it instructed me to re-enable com.docker.vmnetd, which I did, and now everything seems to work. Thanks for your help!

akimd commented 6 years ago

🎉 !!!

Thanks to you for staying with me that long and try everything I suggested :)

anistark commented 5 years ago

Hi @akimd

I'm still facing the issue. I'm using docker for mac app and don't seem to have the file suggested above: /Applications/Docker.app/Contents/Resources/bin/docker-diagnose.

I've also removed this one as suggested above: sudo rm /Library/PrivilegedHelperTools/com.docker.vmnetd

Please help on how to resolve this.

avshyz commented 5 years ago

Hi @akimd I'm facing the exact same issue as @anistark (missing docker-diagnose) Please help us resolve the issue.

EDIT: tried downgrading, since the problem started only after the upgrade, and I encounter the same problem.

erickertz commented 5 years ago

Same here after upgrade

erickertz commented 5 years ago

The suggestion here fixed the issue for me:

https://github.com/docker/for-mac/issues/1316#issuecomment-281635918

bjarthur commented 4 years ago

rebooting worked for me

anistark commented 4 years ago

The suggestion here fixed the issue for me:

#1316 (comment)

Still didn't work for me. Did you do anything post this?

docker-robott commented 4 years ago

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