Minikube: vbox: Cannot delete or start minikube if VM is deleted outside of minikube

Created on 1 Oct 2019  路  8Comments  路  Source: kubernetes/minikube

The exact command to reproduce the issue:

minikube start
馃槃  minikube v1.4.0 on Darwin 10.14.6
馃敟  Creating virtualbox VM (CPUs=2, Memory=6500MB, Disk=20000MB) ...
^C

Cancelled the start with Ctrl+c

minikube start

Failed:

馃槃  minikube v1.4.0 on Darwin 10.14.6
馃挕  Tip: Use 'minikube start -p <name>' to create a new cluster, or 'minikube delete' to delete this one.
馃攧  Retriable failure: Error getting state for host: machine does not exist

Try to delete

minikube delete

Failed

馃挘  Unable to get the status of the cluster.

To fix the problem

rm -r ~/.minikube/machines/minikube

You can reproduce the issue if you run minikube start and then delete the vm in the hypervisor GUI.

The output of the minikube logs command:

馃挘 command runner: getting ssh client for bootstrapper: Error dialing tcp via ssh client: dial tcp 127.0.0.1:22: connect: connection refused

馃樋 Sorry that minikube crashed. If this was unexpected, we would love to hear from you:
馃憠 https://github.com/kubernetes/minikube/issues/new/choose

The operating system version:
Mac OS 10.14.6

cvirtualbox help wanted kinbug prioritimportant-longterm

Most helpful comment

I'm now fixing this.

And I noticed the minikube delete failure is solved by #5654!
So, I'll fix error about minikube start failure.

All 8 comments

Ugh. minikube delete is supposed to deal with missing VM's, but clearly it's not working as intended.

Stepping through the code when doing this noticed that the executed command

/usr/bin/VBoxManage showvminfo minikube --machinereadable

returned with the following error

VBoxManage: error: Could not find a registered machine named 'minikube'
VBoxManage: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBoxWrap, interface IVirtualBox, callee nsISupports
VBoxManage: error: Context: "FindMachine(Bstr(VMNameOrUuid).raw(), machine.asOutParam())" at line 2621 of file VBoxManageInfo.cpp

and it is returned as part of the err object however the DeleteHost(..) is printing out as a generic error as 'Unable to get the status of the cluster.'

Is the requirement to report the error as what is returned to DeleteHost(..) or thinking of something else.

Happy to take this on if required.

Can I work on this?
I'll take.

I'm checking the code about this error.
I found following code section.

https://github.com/kubernetes/minikube/blob/5c6f33b7963b716a44c1d3d790feafa819613b7b/pkg/minikube/cluster/cluster.go#L110

https://github.com/kubernetes/minikube/blob/5c6f33b7963b716a44c1d3d790feafa819613b7b/pkg/minikube/cluster/cluster.go#L279

Now there is not "machine does not exist" error handling in startHost func and DeleteHost func.
So, I would add error handling when "machine does not exist" error occurs.

/assign

I'm now fixing this.

And I noticed the minikube delete failure is solved by #5654!
So, I'll fix error about minikube start failure.

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

/remove-lifecycle stale

Was this page helpful?
0 / 5 - 0 ratings