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

Docker for Desktop Preview M1 on Mac - hang during startup

Open ktaraszk opened this issue 5 years ago • 32 comments

  • [x] I have tried with the latest version of my channel (Stable or Edge)
  • [ ] I have uploaded Diagnostics
  • Diagnostics ID:

Expected behavior

Docker Desktop for Mac should up and run

Actual behavior

Hangs on startup

Information

  • macOS Version: macOS 11.1 (20C69)

Diagnostic logs

INFO[0542] cannot set up multiplexer, will retry in 2s: dial tcp 192.168.64.1:1999: connect: connection timed out
INFO[0544] connecting to tcp+connect://192.168.64.1:1999...
INFO[0576] cannot set up multiplexer, will retry in 2s: dial tcp 192.168.64.1:1999: connect: connection timed out
INFO[0578] connecting to tcp+connect://192.168.64.1:1999...
INFO[0610] cannot set up multiplexer, will retry in 2s: dial tcp 192.168.64.1:1999: connect: connection timed out
INFO[0612] connecting to tcp+connect://192.168.64.1:1999...
INFO[0643] cannot set up multiplexer, will retry in 2s: dial tcp 192.168.64.1:1999: connect: connection timed out
INFO[0645] connecting to tcp+connect://192.168.64.1:1999...
INFO[0677] cannot set up multiplexer, will retry in 2s: dial tcp 192.168.64.1:1999: connect: connection timed out
INFO[0679] connecting to tcp+connect://192.168.64.1:1999...
Docker for Mac: Preview 5

Steps to reproduce the behavior

Reset Docker to defaults / factory defaults or uninstall it When docker for Desktop starts it want to talk to vpnkit-bridge at 192.168.64.1: 1999

The VPNKit Bridge itself start and binds to 0.0.0.0:1999:

/Data/log/host/vpnkit-bridge.log:2:time="2020-12-14T21:38:57+01:00" level=info msg="waiting for connection on tcp+listen://0.0.0.0:1999..."

But the bridge100 have different IP address:

 ifconfig bridge100
bridge100: flags=8a63<UP,BROADCAST,SMART,RUNNING,ALLMULTI,SIMPLEX,MULTICAST> mtu 1500
	options=3<RXCSUM,TXCSUM>
	ether 1a:3e:ef:0d:be:64
	inet6 fe80::14a4:ac58:32cb:3b03%bridge100 prefixlen 64 secured scopeid 0x15
	inet 192.168.65.1 netmask 0xffffff00 broadcast 192.168.64.255
	Configuration:
		id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
		maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
		root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
		ipfilter disabled flags 0x0
	member: en6 flags=803<LEARNING,DISCOVER,PRIVATE>
	        ifmaxaddr 0 port 20 priority 0 path cost 0
	Address cache:
		3a:20:b5:c6:f2:ca Vlan1 en6 1200 flags=0<>
	nd6 options=201<PERFORMNUD,DAD>
	media: autoselect
	status: active

When I added correct IP address to the bridge interface, VM started, Docker for Desktop reported that Docker is running fine.

INFO[0679] connecting to tcp+connect://192.168.64.1:1999...
INFO[0679] connected!
INFO[0679] Proxy gui: waiting for remote service to be available
INFO[0679] Proxy vpnkit-data: waiting for remote service to be available
INFO[0679] Proxy docker-proxy: waiting for remote service to be available
INFO[0679] Proxy ssh-auth: waiting for remote service to be available
INFO[0679] Proxy vpnkit: waiting for remote service to be available
INFO[0679] Proxy backend: waiting for remote service to be available
INFO[0679] Proxy filesystem: waiting for remote service to be available
INFO[0679] received ack for service gui, publishing locally
INFO[0679] received ack for service docker-proxy, publishing locally
INFO[0679] received ack for service vpnkit-data, publishing locally
(...)
INFO[1970-01-01T00:11:26.588751285Z] loading plugin "io.containerd.grpc.v1.introspection"...  type=io.containerd.grpc.v1
INFO[1970-01-01T00:11:26.588953494Z] serving...                                    address=/run/containerd/debug.sock
INFO[1970-01-01T00:11:26.589022244Z] serving...                                    address=/run/containerd/containerd.sock.ttrpc
INFO[1970-01-01T00:11:26.589068285Z] serving...                                    address=/run/containerd/containerd.sock
INFO[1970-01-01T00:11:26.589120077Z] containerd successfully booted in 0.189638s

ktaraszk avatar Dec 14 '20 21:12 ktaraszk

So, Docker started. But, VM is at 192.168.64.* network, where the rest of the stack is expecting to have some services available at 192.168.65.* network:

$ docker build -f Dockerfile.arm64 .
[+] Building 11.4s (3/3) FINISHED
 => [internal] load build definition from Dockerfile.arm64                                                                                                                   1.2s
 => => transferring dockerfile: 2.27kB                                                                                                                                       0.0s
 => [internal] load .dockerignore                                                                                                                                            1.0s
 => => transferring context: 2B                                                                                                                                              0.0s
 => ERROR [internal] load metadata for docker.io/library/alpine:latest                                                                                                      10.0s
------
 > [internal] load metadata for docker.io/library/alpine:latest:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to do request: Head https://registry-1.docker.io/v2/library/alpine/manifests/latest: dial tcp: lookup registry-1.docker.io on 192.168.65.1:53: read udp 192.168.65.9:57078->192.168.65.1:53: i/o timeout

ktaraszk avatar Dec 14 '20 21:12 ktaraszk

Ok, I think I have it. Docker VM seems has wrong clock/time set or it simply ignore that host hardware clock/date or because of the missing network, the network time isn't set correctly inside the VM, please have a look at the fragment of the log:

Cleaning up stale service: "vpnkit-forwarder"
time="1970-01-01T00:01:13.583167785Z" level=info msg="starting signal loop" namespace=services.linuxkit path=/run/containerd/io.containerd.runtime.v2.task/services.linuxkit/acpid pid=735
time="1970-01-01T00:01:13.790444326Z" level=info msg="starting signal loop" namespace=services.linuxkit path=/run/containerd/io.containerd.runtime.v2.task/services.linuxkit/binfmt pid=790
time="1970-01-01T00:01:13.981708243Z" level=info msg="starting signal loop" namespace=services.linuxkit path=/run/containerd/io.containerd.runtime.v2.task/services.linuxkit/dhcpcd pid=841
time="1970-01-01T00:01:14.148744577Z" level=info msg="starting signal loop" namespace=services.linuxkit path=/run/containerd/io.containerd.runtime.v2.task/services.linuxkit/diagnose pid=894
time="1970-01-01T00:01:14.328368952Z" level=info msg="starting signal loop" namespace=services.linuxkit path=/run/containerd/io.containerd.runtime.v2.task/services.linuxkit/docker pid=961
time="1970-01-01T00:01:14.519149285Z" level=info msg="starting signal loop" namespace=services.linuxkit path=/run/containerd/io.containerd.runtime.v2.task/services.linuxkit/kmsg pid=1020
time="1970-01-01T00:01:14.720843868Z" level=info msg="starting signal loop" namespace=services.linuxkit path=/run/containerd/io.containerd.runtime.v2.task/services.linuxkit/sntpc pid=1108
time="1970-01-01T00:01:14.920503869Z" level=info msg="starting signal loop" namespace=services.linuxkit path=/run/containerd/io.containerd.runtime.v2.task/services.linuxkit/socks pid=1161
time="1970-01-01T00:01:15.126930535Z" level=info msg="starting signal loop" namespace=services.linuxkit path=/run/containerd/io.containerd.runtime.v2.task/services.linuxkit/trim-after-delete pid=1218
time="1970-01-01T00:01:15.368426244Z" level=info msg="starting signal loop" namespace=services.linuxkit path=/run/containerd/io.containerd.runtime.v2.task/services.linuxkit/vpnkit-forwarder pid=1286
[   75.702343] bpfilter: Loaded bpfilter_umh pid 1341

Thanks.

ktaraszk avatar Dec 14 '20 21:12 ktaraszk

Thanks @taraszka , I'm facing the same issue on the Preview7 build. As you explained, docker was able to start after resetting the ip for bridge100 to 192.168.64.1.

sudo ifconfig bridge100 inet 192.168.64.1 netmask 255.255.255.0

BhavyaSree avatar Dec 23 '20 04:12 BhavyaSree

I had the same issue with Preview7 and after running your command, Docker is finally starting.

Thanks, @BhavyaSree & @taraszka 👍

alexmartinfr avatar Dec 29 '20 15:12 alexmartinfr

up Does someone have a solution?

guglen avatar Dec 29 '20 23:12 guglen

the problem of IP 192.168.65.1 of the bridge card "seems" to have been solved by modifying the file

/Library/preferences/SystemConfiguration/com.apple.vmnet.plist

by editing the final part of the file:

     <key> Shared_Net_Address </key>
     <string> 192.168.64.1 </string>
     <key> Shared_Net_Mask </key>
     <string> 255.255.255.0 </string>

guglen avatar Jan 01 '21 17:01 guglen

None of the solution above works for me. Still get the same error.

pencilcheck avatar Jan 02 '21 04:01 pencilcheck

@pencilcheck do you have the same scenario?

do you have the virtual card on IP 192.168.65.1?

read on the "console.log":

INFO[0542] cannot set up multiplexer, will retry in 2s: dial tcp 192.168.64.1:1999: connect: connection timed out INFO[0544] connecting to tcp+connect://192.168.64.1:1999... INFO[0576] cannot set up multiplexer, will retry in 2s: dial tcp 192.168.64.1:1999: connect: connection timed out INFO[0578] connecting to tcp+connect://192.168.64.1:1999... INFO[0610] cannot set up multiplexer, will retry in 2s: dial tcp 192.168.64.1:1999: connect: connection timed out INFO[0612] connecting to tcp+connect://192.168.64.1:1999... INFO[0643] cannot set up multiplexer, will retry in 2s: dial tcp 192.168.64.1:1999: connect: connection timed out INFO[0645] connecting to tcp+connect://192.168.64.1:1999... INFO[0677] cannot set up multiplexer, will retry in 2s: dial tcp 192.168.64.1:1999: connect: connection timed out INFO[0679] connecting to tcp+connect://192.168.64.1:1999...

what do you read in the /Library/preferences/SystemConfiguration/com.apple.vmnet.plist file?

guglen avatar Jan 02 '21 12:01 guglen

@guglen thanks a lot for your suggestion, it works perfectly here. I'm just wondering why I do have something like 172.16.214.1/24 in my original config file. Anyway, with your trick, my docker is running and I can start some serious testing

cmorgia avatar Jan 03 '21 22:01 cmorgia

@pencilcheck do you have the same scenario?

do you have the virtual card on IP 192.168.65.1?

read on the "console.log":

INFO[0542] cannot set up multiplexer, will retry in 2s: dial tcp 192.168.64.1:1999: connect: connection timed out INFO[0544] connecting to tcp+connect://192.168.64.1:1999... INFO[0576] cannot set up multiplexer, will retry in 2s: dial tcp 192.168.64.1:1999: connect: connection timed out INFO[0578] connecting to tcp+connect://192.168.64.1:1999... INFO[0610] cannot set up multiplexer, will retry in 2s: dial tcp 192.168.64.1:1999: connect: connection timed out INFO[0612] connecting to tcp+connect://192.168.64.1:1999... INFO[0643] cannot set up multiplexer, will retry in 2s: dial tcp 192.168.64.1:1999: connect: connection timed out INFO[0645] connecting to tcp+connect://192.168.64.1:1999... INFO[0677] cannot set up multiplexer, will retry in 2s: dial tcp 192.168.64.1:1999: connect: connection timed out INFO[0679] connecting to tcp+connect://192.168.64.1:1999...

what do you read in the /Library/preferences/SystemConfiguration/com.apple.vmnet.plist file?

@guglen It is on 192.168.64.1. I already did what was stated here to make sure it is on the IP but it still timeout.

pencilcheck avatar Jan 04 '21 00:01 pencilcheck

I have the same issue as @pencilcheck. Error being reported is:

INFO[0190] cannot set up multiplexer, will retry in 2s: dial tcp 192.168.64.1:1999: connect: network is unreachable
INFO[0192] connecting to tcp+connect://192.168.64.1:1999...

But the bridge is already showing the correct ip:

% ifconfig bridge100

bridge100: flags=8a63<UP,BROADCAST,SMART,RUNNING,ALLMULTI,SIMPLEX,MULTICAST> mtu 1500
	options=3<RXCSUM,TXCSUM>
	ether 4e:20:b8:ae:5f:64
	inet 192.168.64.1 netmask 0xffffff00 broadcast 192.168.64.255
	inet6 fe80::8cf:cd47:aff5:3ce1%bridge100 prefixlen 64 secured scopeid 0x13
	Configuration:
		id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
		maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
		root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
		ipfilter disabled flags 0x0
	member: en7 flags=803<LEARNING,DISCOVER,PRIVATE>
	        ifmaxaddr 0 port 18 priority 0 path cost 0
	Address cache:
		d2:ff:2c:2:3f:dc Vlan1 en7 1199 flags=0<>
	nd6 options=201<PERFORMNUD,DAD>
	media: autoselect
	status: active

boardthatpowder avatar Jan 09 '21 17:01 boardthatpowder

I realized immediately after posting it what my issue may had been..... had the MacOS Firewall turned on. Turned it off and docker works again.

boardthatpowder avatar Jan 09 '21 17:01 boardthatpowder

sudo ifconfig bridge100 inet 192.168.64.1 netmask 255.255.255.0

@BhavyaSree How do you make these changes persistent. After changing the network on this bridge100 and restarting the docker desktop process, it's again on the net 192.168.66.1. The bridge100 device seems to be visible only when docker is running. After a restart it resets it's network config again.

totherush avatar Jan 15 '21 08:01 totherush

sudo ifconfig bridge100 inet 192.168.64.1 netmask 255.255.255.0

I got the error when I pulled the image after doing the above command.

$ docker pull php:7.4-fpm
Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 192.168.64.1:53: read udp 192.168.64.2:50038->192.168.64.1:53: read: connection refused

riouruma avatar Jan 17 '21 05:01 riouruma

sudo ifconfig bridge100 inet 192.168.64.1 netmask 255.255.255.0

I got the error when I pulled the image after doing the above command.

$ docker pull php:7.4-fpm
Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 192.168.64.1:53: read udp 192.168.64.2:50038->192.168.64.1:53: read: connection refused

you don't have to execute that command, you have to find the file

/Library/preferences/SystemConfiguration/com.apple.vmnet.plist

and edit it

guglen avatar Jan 18 '21 11:01 guglen

@guglen This is near the end of com.apple.vmnet.plist.

<key>Shared_Net_Address</key>
<string>192.168.64.1</string>
<key>Shared_Net_Mask</key>
<string>255.255.255.0</string>

What should I do?

riouruma avatar Jan 18 '21 15:01 riouruma

Deactivating Little Snitch seems also solve the startup problem.

loyoan1 avatar Jan 18 '21 20:01 loyoan1

@guglen This is near the end of com.apple.vmnet.plist.

<key>Shared_Net_Address</key>
<string>192.168.64.1</string>
<key>Shared_Net_Mask</key>
<string>255.255.255.0</string>

What should I do?

when docker starts what is the bridge100 IP?

guglen avatar Jan 19 '21 08:01 guglen

I see this issue intermittently and what helps me is to turn off the firewall, restart docker, then turn on the firewall.

klement avatar Jan 21 '21 20:01 klement

I have the issue on my machine when using ip 192.168.65.1

llauderesv avatar Jan 23 '21 02:01 llauderesv