Why does minikube start sometimes hang on mac os High Sierra 10.13.6?

11/1/2018

I upgraded my mac to version 10.13.6 yesterday, restarted my mac laptop. Now, minikube won't start. Docker Community Edition 18.06.1-ce is running. The logs are below. Can anyone spot what is wrong. How do I debug this more?

$ minikube version
minikube version: v0.30.0


$ minikube update-check
CurrentVersion: v0.30.0
LatestVersion: v0.30.0


$ minikube start --v=999 --logtostderr   --vm-driver=hyperkit
W1101 12:02:25.674822   24809 root.go:146] Error reading config file at /Users/user/.minikube/config/config.json: open /Users/user/.minikube/config/config.json: no such file or directory
I1101 12:02:25.675028   24809 notify.go:121] Checking for updates...
I1101 12:02:25.971633   24809 start.go:99] Viper configuration:
Aliases:
map[string]string{}
Override:
map[string]interface {}{"v":"999"}
PFlags:
map[string]viper.FlagValue{"apiserver-names":viper.pflagValue{flag:(*pflag.Flag)(0xc42033a460)}, "network-plugin":viper.pflagValue{flag:(*pflag.Flag)(0xc42033a8c0)}, "registry-mirror":viper.pflagValue{flag:(*pflag.Flag)(0xc42033a6e0)}, "vm-driver":viper.pflagValue{flag:(*pflag.Flag)(0xc420367c20)}, "cpus":viper.pflagValue{flag:(*pflag.Flag)(0xc420367d60)}, "disk-size":viper.pflagValue{flag:(*pflag.Flag)(0xc420367e00)}, "feature-gates":viper.pflagValue{flag:(*pflag.Flag)(0xc42033a960)}, "hyperkit-vsock-ports":viper.pflagValue{flag:(*pflag.Flag)(0xc42033ac80)}, "disable-driver-mounts":viper.pflagValue{flag:(*pflag.Flag)(0xc420367ae0)}, "gpu":viper.pflagValue{flag:(*pflag.Flag)(0xc42033ad20)}, "nfs-share":viper.pflagValue{flag:(*pflag.Flag)(0xc42033a140)}, "uuid":viper.pflagValue{flag:(*pflag.Flag)(0xc42033ab40)}, "apiserver-name":viper.pflagValue{flag:(*pflag.Flag)(0xc42033a3c0)}, "cache-images":viper.pflagValue{flag:(*pflag.Flag)(0xc42033aa00)}, "xhyve-disk-driver":viper.pflagValue{flag:(*pflag.Flag)(0xc42033a0a0)}, "dns-domain":viper.pflagValue{flag:(*pflag.Flag)(0xc42033a5a0)}, "docker-opt":viper.pflagValue{flag:(*pflag.Flag)(0xc42033a320)}, "host-only-cidr":viper.pflagValue{flag:(*pflag.Flag)(0xc420367ea0)}, "memory":viper.pflagValue{flag:(*pflag.Flag)(0xc420367cc0)}, "nfs-shares-root":viper.pflagValue{flag:(*pflag.Flag)(0xc42033a1e0)}, "iso-url":viper.pflagValue{flag:(*pflag.Flag)(0xc420367b80)}, "bootstrapper":viper.pflagValue{flag:(*pflag.Flag)(0xc420366fa0)}, "container-runtime":viper.pflagValue{flag:(*pflag.Flag)(0xc42033a780)}, "docker-env":viper.pflagValue{flag:(*pflag.Flag)(0xc42033a280)}, "extra-config":viper.pflagValue{flag:(*pflag.Flag)(0xc42033aaa0)}, "insecure-registry":viper.pflagValue{flag:(*pflag.Flag)(0xc42033a640)}, "apiserver-ips":viper.pflagValue{flag:(*pflag.Flag)(0xc42033a500)}, "keep-context":viper.pflagValue{flag:(*pflag.Flag)(0xc420367900)}, "kvm-network":viper.pflagValue{flag:(*pflag.Flag)(0xc42033a000)}, "mount":viper.pflagValue{flag:(*pflag.Flag)(0xc4203679a0)}, "mount-string":viper.pflagValue{flag:(*pflag.Flag)(0xc420367a40)}, "profile":viper.pflagValue{flag:(*pflag.Flag)(0xc420366f00)}, "hyperkit-vpnkit-sock":viper.pflagValue{flag:(*pflag.Flag)(0xc42033abe0)}, "hyperv-virtual-switch":viper.pflagValue{flag:(*pflag.Flag)(0xc420367f40)}, "kubernetes-version":viper.pflagValue{flag:(*pflag.Flag)(0xc42033a820)}}
Env:
map[string]string{}
Key/Value Store:
map[string]interface {}{}
Config:
map[string]interface {}{}
Defaults:
map[string]interface {}{"log_dir":"", "reminderwaitperiodinhours":24, "wantnonedriverwarning":true, "showdriverdeprecationnotification":true, "showbootstrapperdeprecationnotification":true, "v":"0", "alsologtostderr":"false", "wantupdatenotification":true, "wantreporterror":false, "wantreporterrorprompt":true, "wantkubectldownloadmsg":true}
Starting local Kubernetes v1.10.0 cluster...
Starting VM...
I1101 12:02:25.972050   24809 utils.go:100] retry loop 0
I1101 12:02:25.972089   24809 cluster.go:73] Skipping create...Using existing machine configuration
Found binary path at /usr/local/bin/docker-machine-driver-hyperkit
Launching plugin server for driver hyperkit
Plugin server listening at address 127.0.0.1:56021
() Calling .GetVersion
Using API Version  1
() Calling .SetConfigRaw
() Calling .GetMachineName
(minikube) Calling .GetState
I1101 12:02:26.011670   24809 cluster.go:82] Machine state:  Stopped
(minikube) Calling .Start
(minikube) Using UUID fa403fab-dbb5-11e8-812b-8c859058d45f
(minikube) Generated MAC 86:5b:e6:33:fc:a1
(minikube) Starting with cmdline: loglevel=3 user=docker console=ttyS0 console=tty0 noembed nomodeset norestore waitusb=10 systemd.legacy_systemd_cgroup_controller=yes base host=minikube
(minikube) Calling .GetConfigRaw
(minikube) Calling .DriverName
Waiting for SSH to be available...
Getting to WaitForSSH function...
(minikube) Calling .GetSSHHostname
(minikube) Calling .GetSSHPort
(minikube) Calling .GetSSHKeyPath
(minikube) Calling .GetSSHKeyPath
(minikube) Calling .GetSSHUsername
Using SSH client type: native
&{{{<nil> 0 [] [] []} docker [0x140f940] 0x140f910  [] 0s} 192.168.64.4 22 <nil> <nil>}
About to run SSH command:
exit 0

Error dialing TCP: dial tcp 192.168.64.4:22: connect: operation timed out
Error dialing TCP: dial tcp 192.168.64.4:22: connect: operation timed out
Error dialing TCP: dial tcp 192.168.64.4:22: connect: operation timed out

Update: I created an a json file containing {} at /Users/user/.minikube/config/config.json but it still hangs.

I printed the process tree and found that the child process

/usr/local/bin/docker-machine-driver-hyperkit

is the one hanging.

-- user674669
kubernetes
minikube

2 Answers

11/1/2018

My guess is that the IP address of the xhyve/Hyperkit VM changed. It probably changed when you did the Mac OS upgrade.

You can update it in /Users/youruser/.minikube/machines/minikube/config.json:

{
    "ConfigVersion": 3,
    "Driver": {
        "IPAddress": "192.168.64.2",  <== here
        "MachineName": "minikube",
        "SSHUser": "docker",
        "SSHPort": 22,
        "SSHKeyPath": "/Users/youruser/.minikube/machines/minikube/id_rsa",
        "StorePath": "/Users/youruser/.minikube",
        "SwarmMaster": false,
        "SwarmHost": "",
        "SwarmDiscovery": "",
        "Boot2DockerURL": "file:///Users/youruser/.minikube/cache/iso/minikube-v0.30.0.iso",
        "DiskSize": 20000,
        "CPU": 2,
        "Memory": 2048,
        "Cmdline": "loglevel=3 user=docker console=ttyS0 console=tty0 noembed nomodeset norestore waitusb=10 systemd.legacy_systemd_cgroup_controller=yes base host=minikube",
        "NFSShares": [],
        "NFSSharesRoot": "/nfsshares",
        "UUID": "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "VpnKitSock": "",
        "VSockPorts": []
    },
    ...

And you can get the IP address by screening into the VM:

$ sudo screen /Users/youruser/.minikube/machines/minikube/tty # you need your mac sudo password
<enter>
Welcome to minikube
minikube login: root<enter>
                         _             _
            _         _ ( )           ( )
  ___ ___  (_)  ___  (_)| |/')  _   _ | |_      __
/' _ ` _ `\| |/' _ `\| || , <  ( ) ( )| '_`\  /'__`\
| ( ) ( ) || || ( ) || || |\`\ | (_) || |_) )(  ___/
(_) (_) (_)(_)(_) (_)(_)(_) (_)`\___/'(_,__/'`\____)

# ifconfig
docker0   Link encap:Ethernet  HWaddr 02:42:06:3F:18:54
          inet addr:172.17.0.1  Bcast:172.17.255.255  Mask:255.255.0.0
          inet6 addr: fe80::42:6ff:fe3f:1854/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:39173 errors:0 dropped:0 overruns:0 frame:0
          TX packets:49410 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:7801618 (7.4 MiB)  TX bytes:12392980 (11.8 MiB)

eth0      Link encap:Ethernet  HWaddr D2:EE:50:CB:B5:94
          inet addr:192.168.64.2  Bcast:192.168.64.255  Mask:255.255.255.0 <== This addr
          inet6 addr: fe80::d0ee:50ff:fecb:b594/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:234201 errors:0 dropped:0 overruns:0 frame:112
          TX packets:70224 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:325353860 (310.2 MiB)  TX bytes:4951049 (4.7 MiB)
...

You probably will have to update the IP in the Kubernetes configs in /Users/youruser/.minikube/profiles/minikube

Lastly, the config in /Users/youruser/.kube/config:

...
- cluster:
certificate-authority: /Users/youruser/.minikube/ca.crt
server: https://192.168.64.2:8443 => here.
name: minikube
...

Note: you might have re-generate the kube-apiserver certs if they are tied to an IP address.

Also, note that I also see:

W1101 16:07:41.121373   59126 root.go:146] Error reading config file at /Users/youruser/.minikube/config/config.json: open /Users/youruser/.minikube/config/config.json: no such file or directory

and my VM starts fine.

-- Rico
Source: StackOverflow

11/1/2018

I have been fixing such issues by:

minikube stop

rm -rf ~/.minikube

minikube start
-- Ijaz Ahmad Khan
Source: StackOverflow