diff --git a/pkg/minikube/exit/exit.go b/pkg/minikube/exit/exit.go index efe606ddd8..04ff252ce8 100644 --- a/pkg/minikube/exit/exit.go +++ b/pkg/minikube/exit/exit.go @@ -72,9 +72,11 @@ func WithProblem(msg string, p *problem.Problem) { out.ErrT(out.Empty, "") out.FatalT(msg) p.Display() - out.ErrT(out.Empty, "") - out.ErrT(out.Sad, "If the above advice does not help, please let us know: ") - out.ErrT(out.URL, "https://github.com/kubernetes/minikube/issues/new/choose") + if !p.HideCreateLink { + out.ErrT(out.Empty, "") + out.ErrT(out.Sad, "If the above advice does not help, please let us know: ") + out.ErrT(out.URL, "https://github.com/kubernetes/minikube/issues/new/choose") + } os.Exit(Config) } diff --git a/pkg/minikube/logs/logs.go b/pkg/minikube/logs/logs.go index 9dcc5a1a2e..0c6625f8b4 100644 --- a/pkg/minikube/logs/logs.go +++ b/pkg/minikube/logs/logs.go @@ -34,7 +34,7 @@ import ( ) // rootCauseRe is a regular expression that matches known failure root causes -var rootCauseRe = regexp.MustCompile(`^error: |eviction manager: pods.* evicted|unknown flag: --|forbidden.*no providers available|eviction manager:.*evicted|tls: bad certificate|kubelet.*no API client|kubelet.*No api server|STDIN.*127.0.0.1:8080|failed to create listener|address already in use`) +var rootCauseRe = regexp.MustCompile(`^error: |eviction manager: pods.* evicted|unknown flag: --|forbidden.*no providers available|eviction manager:.*evicted|tls: bad certificate|kubelet.*no API client|kubelet.*No api server|STDIN.*127.0.0.1:8080|failed to create listener|address already in use|unable to evict any pods|eviction manager: unexpected error`) // ignoreCauseRe is a regular expression that matches spurious errors to not surface var ignoreCauseRe = regexp.MustCompile("error: no objects passed to apply") diff --git a/pkg/minikube/logs/logs_test.go b/pkg/minikube/logs/logs_test.go index 417f788fa0..bfb8b14b55 100644 --- a/pkg/minikube/logs/logs_test.go +++ b/pkg/minikube/logs/logs_test.go @@ -35,6 +35,7 @@ func TestIsProblem(t *testing.T) { {"no-providers-available #3818", true, ` kubelet.go:1662] Failed creating a mirror pod for "kube-apiserver-minikube_kube-system(c7d572aebd3d33b17fa78ae6395b6d0a)": pods "kube-apiserver-minikube" is forbidden: no providers available to validate pod request`}, {"no-objects-passed-to-apply #4010", false, "error: no objects passed to apply"}, {"bad-certificate #4251", true, "log.go:172] http: TLS handshake error from 127.0.0.1:49200: remote error: tls: bad certificate"}, + {"ephemeral-eviction #5355", true, " eviction_manager.go:419] eviction manager: unexpected error when attempting to reduce ephemeral-storage pressure: wanted to free 9223372036854775807 bytes, but freed 0 bytes space with errors in image deletion"}, } for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { diff --git a/pkg/minikube/problem/err_map.go b/pkg/minikube/problem/err_map.go index eacc3cfc25..4d5538cdb9 100644 --- a/pkg/minikube/problem/err_map.go +++ b/pkg/minikube/problem/err_map.go @@ -25,81 +25,85 @@ func re(s string) *regexp.Regexp { // vmProblems are VM related problems var vmProblems = map[string]match{ - "SERVICE_NOT_FOUND": { - Regexp: re(`Could not find finalized endpoint being pointed to by`), - Advice: "Please make sure the service you are looking for is deployed or is in the correct namespace.", - Issues: []int{4599}, + // Generic VM driver + "DRIVER_CORRUPT": { + Regexp: re(`Error attempting to get plugin server address for RPC`), + Advice: "The VM driver exited with an error, and may be corrupt. Run 'minikube start' with --alsologtostderr -v=8 to see the error", + URL: "https://minikube.sigs.k8s.io/docs/reference/drivers/", + }, + "DRIVER_EXITED": { + Regexp: re(`Unable to start VM: start: exit status 1`), + Advice: "The VM driver crashed. Run 'minikube start --alsologtostderr -v=8' to see the VM driver error message", + URL: "https://minikube.sigs.k8s.io/docs/reference/drivers/#troubleshooting", + }, + "DRIVER_NOT_FOUND": { + Regexp: re(`registry: driver not found`), + Advice: "Your minikube config refers to an unsupported driver. Erase ~/.minikube, and try again.", + Issues: []int{5295}, + HideCreateLink: true, }, "MACHINE_NOT_FOUND": { Regexp: re(`Machine does not exist for api.Exists`), Advice: "Your minikube vm is not running, try minikube start.", Issues: []int{4889}, }, + + // Hyperkit "HYPERKIT_NO_IP": { Regexp: re(`IP address never found in dhcp leases file Temporary Error: Could not find an IP address for`), - Advice: "Install the latest minikube hyperkit driver, and run 'minikube delete'", + Advice: "Install the latest hyperkit binary, and run 'minikube delete'", URL: "https://minikube.sigs.k8s.io/docs/reference/drivers/hyperkit/", Issues: []int{1926, 4206}, }, - "VBOX_NOT_FOUND": { - Regexp: re(`VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path`), - Advice: "Install VirtualBox, ensure that VBoxManage is executable and in path, or select an alternative value for --vm-driver", - URL: "https://www.virtualbox.org/wiki/Downloads", - Issues: []int{3784, 3776}, + "HYPERKIT_NOT_FOUND": { + Regexp: re(`Driver "hyperkit" not found. Do you have the plugin binary .* accessible in your PATH?`), + Advice: "Please install the minikube hyperkit VM driver, or select an alternative --vm-driver", + URL: "https://minikube.sigs.k8s.io/docs/reference/drivers/hyperkit/", + HideCreateLink: true, }, - "VBOX_VTX_DISABLED": { - Regexp: re(`This computer doesn't have VT-X/AMD-v enabled`), - Advice: "In some environments, this message is incorrect. Try 'minikube start --no-vtx-check'", - Issues: []int{3900}, + + // Hyper-V + "HYPERV_NO_VSWITCH": { + Regexp: re(`no External vswitch found. A valid vswitch must be available for this command to run.`), + Advice: "Configure an external network switch following the official documentation, then add `--hyperv-virtual-switch=` to `minikube start`", + URL: "https://docs.docker.com/machine/drivers/hyper-v/", + HideCreateLink: true, }, - "VBOX_VERR_VMX_NO_VMX": { - Regexp: re(`VT-x is not available.*VERR_VMX_NO_VMX`), - Advice: "Please check your BIOS, and ensure that you are running without HyperV or other nested virtualization that may interfere", - Issues: []int{1994}, + "HYPERV_VSWITCH_NOT_FOUND": { + Regexp: re(`precreate: vswitch.*not found`), + Advice: "Confirm that you have supplied the correct value to --hyperv-virtual-switch using the 'Get-VMSwitch' command", + URL: "https://docs.docker.com/machine/drivers/hyper-v/", + HideCreateLink: true, }, - "VBOX_BLOCKED": { - Regexp: re(`NS_ERROR_FAILURE.*0x80004005`), - Advice: "Reinstall VirtualBox and verify that it is not blocked: System Preferences -> Security & Privacy -> General -> Some system software was blocked from loading", - Issues: []int{4107}, - GOOS: "darwin", + "HYPERV_POWERSHELL_NOT_FOUND": { + Regexp: re(`Powershell was not found in the path`), + Advice: "To start minikube with HyperV Powershell must be in your PATH`", + URL: "https://docs.docker.com/machine/drivers/hyper-v/", + HideCreateLink: true, }, - "VBOX_DRV_NOT_LOADED": { - Regexp: re(`The vboxdrv kernel module is not loaded`), - Advice: "Run 'sudo modprobe vboxdrv' and reinstall VirtualBox if it fails.", - Issues: []int{4043}, - }, - "VBOX_DEVICE_MISSING": { - Regexp: re(`/dev/vboxdrv does not exist`), - Advice: "Run 'sudo modprobe vboxdrv' and reinstall VirtualBox if it fails.", - Issues: []int{3974}, - }, - "VBOX_HARDENING": { - Regexp: re(`terminated unexpectedly.*VBoxHardening`), - Advice: "Disable real-time anti-virus software, reboot, and reinstall VirtualBox if the problem continues.", - Issues: []int{3859, 3910}, - URL: "https://forums.virtualbox.org/viewtopic.php?f=25&t=82106", - GOOS: "windows", - }, - "VBOX_HOST_ADAPTER": { - Regexp: re(`The host-only adapter we just created is not visible`), - Advice: "Reboot to complete VirtualBox installation, and verify that VirtualBox is not blocked by your system", - Issues: []int{3614, 4222}, - URL: "https://stackoverflow.com/questions/52277019/how-to-fix-vm-issue-with-minikube-start", - }, - "VBOX_KERNEL_MODULE_NOT_LOADED": { - Regexp: re(`The vboxdrv kernel module is not loaded`), - Advice: "Run 'sudo modprobe vboxdrv' and reinstall VirtualBox if it fails.", - Issues: []int{4043}, + "HYPERV_AS_ADMIN": { + Regexp: re(`Hyper-v commands have to be run as an Administrator`), + Advice: "Run the minikube command as an Administrator", + URL: "https://rominirani.com/docker-machine-windows-10-hyper-v-troubleshooting-tips-367c1ea73c24", + Issues: []int{4511}, + HideCreateLink: true, }, + + // KVM "KVM2_NOT_FOUND": { Regexp: re(`Driver "kvm2" not found. Do you have the plugin binary .* accessible in your PATH`), Advice: "Please install the minikube kvm2 VM driver, or select an alternative --vm-driver", URL: "https://minikube.sigs.k8s.io/docs/reference/drivers/kvm2/", }, - "HYPERKIT_NOT_FOUND": { - Regexp: re(`Driver "hyperkit" not found. Do you have the plugin binary .* accessible in your PATH?`), - Advice: "Please install the minikube hyperkit VM driver, or select an alternative --vm-driver", - URL: "https://minikube.sigs.k8s.io/docs/reference/drivers/hyperkit/", + "KVM2_NO_DOMAIN": { + Regexp: re(`no domain with matching name`), + Advice: "The VM that minikube is configured for no longer exists. Run 'minikube delete'", + Issues: []int{3636}, + }, + "KVM_CREATE_CONFLICT": { + Regexp: re(`KVM_CREATE_VM.* failed:.* Device or resource busy`), + Advice: "There appears to be another hypervisor conflicting with KVM. Please stop the other hypervisor, or use --vm-driver to switch to it.", + Issues: []int{4913}, }, "KVM2_RESTART_NO_IP": { Regexp: re(`Error starting stopped host: Machine didn't return an IP after 120 seconds`), @@ -108,124 +112,196 @@ var vmProblems = map[string]match{ }, "KVM2_START_NO_IP": { Regexp: re(`Error in driver during machine creation: Machine didn't return an IP after 120 seconds`), - Advice: "Install the latest kvm2 driver and run 'virt-host-validate'", + Advice: "Check your firewall rules for interference, and run 'virt-host-validate' to check for KVM configuration issues. If you are running minikube within a VM, consider using --vm-driver=none", URL: "https://minikube.sigs.k8s.io/docs/reference/drivers/kvm2/", Issues: []int{4249, 3566}, }, "KVM2_NETWORK_DEFINE_XML": { - Regexp: re(`not supported by the connection driver: virNetworkDefineXML`), - Advice: "Rebuild libvirt with virt-network support", - URL: "https://forums.gentoo.org/viewtopic-t-981692-start-0.html", - Issues: []int{4195}, + Regexp: re(`not supported by the connection driver: virNetworkDefineXML`), + Advice: "Rebuild libvirt with virt-network support", + URL: "https://forums.gentoo.org/viewtopic-t-981692-start-0.html", + Issues: []int{4195}, + HideCreateLink: true, }, "KVM2_QEMU_MONITOR": { - Regexp: re(`qemu unexpectedly closed the monitor`), - Advice: "Upgrade to QEMU v3.1.0+, run 'virt-host-validate', or ensure that you are not running in a nested VM environment.", - Issues: []int{4277}, + Regexp: re(`qemu unexpectedly closed the monitor`), + Advice: "Upgrade to QEMU v3.1.0+, run 'virt-host-validate', or ensure that you are not running in a nested VM environment.", + Issues: []int{4277}, + HideCreateLink: true, }, "KVM_UNAVAILABLE": { - Regexp: re(`invalid argument: could not find capabilities for domaintype=kvm`), - Advice: "Your host does not support KVM virtualization. Ensure that qemu-kvm is installed, and run 'virt-host-validate' to debug the problem", - URL: "http://mikko.repolainen.fi/documents/virtualization-with-kvm", - Issues: []int{2991}, + Regexp: re(`invalid argument: could not find capabilities for domaintype=kvm`), + Advice: "Your host does not support KVM virtualization. Ensure that qemu-kvm is installed, and run 'virt-host-validate' to debug the problem", + URL: "http://mikko.repolainen.fi/documents/virtualization-with-kvm", + Issues: []int{2991}, + HideCreateLink: true, }, "KVM_CONNECTION_ERROR": { - Regexp: re(`error connecting to libvirt socket`), - Advice: "Have you set up libvirt correctly?", - URL: "https://minikube.sigs.k8s.io/docs/reference/drivers/kvm2/", - }, - "DRIVER_CRASHED": { - Regexp: re(`Error attempting to get plugin server address for RPC`), - Advice: "The VM driver exited with an error, and may be corrupt. Run 'minikube start' with --alsologtostderr -v=8 to see the error", - URL: "https://minikube.sigs.k8s.io/docs/reference/drivers/", - }, - "DRIVER_EXITED": { - Regexp: re(`Unable to start VM: create: creating: exit status 1`), - Advice: "Re-run 'minikube start' with --alsologtostderr -v=8 to see the VM driver error message", - URL: "https://minikube.sigs.k8s.io/docs/reference/drivers/#troubleshooting", - }, - "VM_BOOT_FAILED_HYPERV_ENABLED": { - Regexp: re(`VirtualBox won't boot a 64bits VM when Hyper-V is activated`), - Advice: "Disable Hyper-V when you want to run VirtualBox to boot the VM", - Issues: []int{4051}, - }, - "HYPERV_NO_VSWITCH": { - Regexp: re(`no External vswitch found. A valid vswitch must be available for this command to run.`), - Advice: "Configure an external network switch following the official documentation, then add `--hyperv-virtual-switch=` to `minikube start`", - URL: "https://docs.docker.com/machine/drivers/hyper-v/", - }, - "HYPERV_POWERSHELL_NOT_FOUND": { - Regexp: re(`Powershell was not found in the path`), - Advice: "To start minikube with HyperV Powershell must be in your PATH`", - URL: "https://docs.docker.com/machine/drivers/hyper-v/", + Regexp: re(`error connecting to libvirt socket`), + Advice: "Have you set up libvirt correctly?", + URL: "https://minikube.sigs.k8s.io/docs/reference/drivers/kvm2/", + HideCreateLink: true, }, - "HOST_CIDR_CONFLICT": { - Regexp: re(`host-only cidr conflicts with the network address of a host interface`), - Advice: "Specify an alternate --host-only-cidr value, such as 172.16.0.1/24", - Issues: []int{3594}, + // None + "SYSTEMCTL_EXIT_1": { + Regexp: re(`sudo systemctl start docker: exit status 1`), + Advice: "Either systemctl is not installed, or Docker is broken. Run 'sudo systemctl start docker' and 'journalctl -u docker'", + URL: "https://minikube.sigs.k8s.io/docs/reference/drivers/none", + Issues: []int{4498}, + HideCreateLink: true, }, - "OOM_KILL_SSH": { - Regexp: re(`Process exited with status 137 from signal KILL`), - Advice: "Disable dynamic memory in your VM manager, or pass in a larger --memory value", - Issues: []int{1766}, + + // VirtualBox + "VBOX_BLOCKED": { + Regexp: re(`NS_ERROR_FAILURE.*0x80004005`), + Advice: "Reinstall VirtualBox and verify that it is not blocked: System Preferences -> Security & Privacy -> General -> Some system software was blocked from loading", + Issues: []int{4107}, + GOOS: "darwin", + HideCreateLink: true, }, - "OOM_KILL_SCP": { - Regexp: re(`An existing connection was forcibly closed by the remote host`), - Advice: "Disable dynamic memory in your VM manager, or pass in a larger --memory value", - Issues: []int{1766}, + "VBOX_DRV_NOT_LOADED": { + Regexp: re(`vboxdrv kernel module is not loaded`), + Advice: "Reinstall VirtualBox and reboot. Alternatively, try the kvm2 driver: https://minikube.sigs.k8s.io/docs/reference/drivers/kvm2/", + HideCreateLink: true, + Issues: []int{4043, 4711}, + }, + "VBOX_DEVICE_MISSING": { + Regexp: re(`vboxdrv does not exist`), + Advice: "Reinstall VirtualBox and reboot. Alternatively, try the kvm2 driver: https://minikube.sigs.k8s.io/docs/reference/drivers/kvm2/", + Issues: []int{3974}, + HideCreateLink: true, + }, + "VBOX_HARDENING": { + Regexp: re(`terminated unexpectedly.*VBoxHardening`), + Advice: "VirtualBox is broken. Disable real-time anti-virus software, reboot, and reinstall VirtualBox if the problem continues.", + Issues: []int{3859, 3910}, + URL: "https://forums.virtualbox.org/viewtopic.php?f=25&t=82106", + GOOS: "windows", + HideCreateLink: true, + }, + "VBOX_NS_ERRROR": { + Regexp: re(`terminated unexpectedly.*NS_ERROR_FAILURE.*0x80004005`), + Advice: "VirtualBox is broken. Reinstall VirtualBox, reboot, and run 'minikube delete'.", + Issues: []int{5227}, + GOOS: "linux", + HideCreateLink: true, + }, + "VBOX_HOST_ADAPTER": { + Regexp: re(`The host-only adapter we just created is not visible`), + Advice: "Reboot to complete VirtualBox installation, and verify that VirtualBox is not blocked by your system", + Issues: []int{3614, 4222}, + URL: "https://stackoverflow.com/questions/52277019/how-to-fix-vm-issue-with-minikube-start", + HideCreateLink: true, + }, + "VBOX_IP_CONFLICT": { + Regexp: re(`VirtualBox is configured with multiple host-only adapters with the same IP`), + Advice: "Use VirtualBox to remove the conflicting VM and/or network interfaces", + URL: "https://stackoverflow.com/questions/55573426/virtualbox-is-configured-with-multiple-host-only-adapters-with-the-same-ip-whe", + Issues: []int{3584}, + }, + "VBOX_HYPERV_64_BOOT": { + Regexp: re(`VirtualBox won't boot a 64bits VM when Hyper-V is activated`), + Advice: "VirtualBox and Hyper-V are having a conflict. Use '--vm-driver=hyperv' or disable Hyper-V using: 'bcdedit /set hypervisorlaunchtype off'", + Issues: []int{4051, 4783}, + HideCreateLink: true, + }, + "VBOX_HYPERV_NEM_VM": { + Regexp: re(`vrc=VERR_NEM_VM_CREATE_FAILED`), + Advice: "VirtualBox and Hyper-V are having a conflict. Use '--vm-driver=hyperv' or disable Hyper-V using: 'bcdedit /set hypervisorlaunchtype off'", + Issues: []int{4587}, + HideCreateLink: true, + }, + "VBOX_NOT_FOUND": { + Regexp: re(`VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path`), + Advice: "Install VirtualBox, or select an alternative value for --vm-driver", + URL: "https://minikube.sigs.k8s.io/docs/start/", + Issues: []int{3784}, + HideCreateLink: true, + }, + "VBOX_NO_VM": { + Regexp: re(`Could not find a registered machine named`), + Advice: "The VM that minikube is configured for no longer exists. Run 'minikube delete'", + Issues: []int{4694}, + HideCreateLink: true, + }, + "VBOX_VTX_DISABLED": { + Regexp: re(`This computer doesn't have VT-X/AMD-v enabled`), + Advice: "Your host does not support virtualization. If you are running minikube within a VM, try '--vm-driver=none'. Otherwise, enable virtualization in your BIOS", + Issues: []int{3900, 4730}, + HideCreateLink: true, + }, + "VBOX_VERR_VMX_NO_VMX": { + Regexp: re(`VT-x is not available.*VERR_VMX_NO_VMX`), + Advice: "Your host does not support virtualization. If you are running minikube within a VM, try '--vm-driver=none'. Otherwise, enable virtualization in your BIOS", + Issues: []int{1994, 5326}, + HideCreateLink: true, + }, + "VBOX_HOST_NETWORK": { + Regexp: re(`Error setting up host only network on machine start.*Unspecified error`), + Advice: "VirtualBox cannot create a network, probably because it conflicts with an existing network that minikube no longer knows about. Try running 'minikube delete'", + Issues: []int{5260}, }, } // proxyDoc is the URL to proxy documentation const proxyDoc = "https://minikube.sigs.k8s.io/docs/reference/networking/proxy/" +const vpnDoc = "https://minikube.sigs.k8s.io/docs/reference/networking/vpn/" // netProblems are network related problems. var netProblems = map[string]match{ "GCR_UNAVAILABLE": { - Regexp: re(`gcr.io.*443: connect: invalid argument`), - Advice: "minikube is unable to access the Google Container Registry. You may need to configure it to use a HTTP proxy.", - URL: proxyDoc, - Issues: []int{3860}, + Regexp: re(`gcr.io.*443: connect: invalid argument`), + Advice: "minikube is unable to access the Google Container Registry. You may need to configure it to use a HTTP proxy.", + URL: proxyDoc, + Issues: []int{3860}, + HideCreateLink: true, }, "DOWNLOAD_RESET_BY_PEER": { - Regexp: re(`Error downloading .*connection reset by peer`), - Advice: "A firewall is likely blocking minikube from reaching the internet. You may need to configure minikube to use a proxy.", - URL: proxyDoc, - Issues: []int{3909}, + Regexp: re(`Error downloading .*connection reset by peer`), + Advice: "A firewall is likely blocking minikube from reaching the internet. You may need to configure minikube to use a proxy.", + URL: proxyDoc, + Issues: []int{3909}, + HideCreateLink: true, }, "DOWNLOAD_IO_TIMEOUT": { - Regexp: re(`Error downloading .*timeout`), - Advice: "A firewall is likely blocking minikube from reaching the internet. You may need to configure minikube to use a proxy.", - URL: proxyDoc, - Issues: []int{3846}, + Regexp: re(`Error downloading .*timeout`), + Advice: "A firewall is likely blocking minikube from reaching the internet. You may need to configure minikube to use a proxy.", + URL: proxyDoc, + Issues: []int{3846}, + HideCreateLink: true, }, "DOWNLOAD_TLS_OVERSIZED": { - Regexp: re(`tls: oversized record received with length`), - Advice: "A firewall is interfering with minikube's ability to make outgoing HTTPS requests. You may need to change the value of the HTTPS_PROXY environment variable.", - URL: proxyDoc, - Issues: []int{3857, 3759, 4252}, + Regexp: re(`tls: oversized record received with length`), + Advice: "A firewall is interfering with minikube's ability to make outgoing HTTPS requests. You may need to change the value of the HTTPS_PROXY environment variable.", + URL: proxyDoc, + Issues: []int{3857, 3759, 4252}, + HideCreateLink: true, }, "ISO_DOWNLOAD_FAILED": { - Regexp: re(`iso: failed to download`), - Advice: "A firewall is likely blocking minikube from reaching the internet. You may need to configure minikube to use a proxy.", - URL: proxyDoc, - Issues: []int{3922}, + Regexp: re(`iso: failed to download`), + Advice: "A firewall is likely blocking minikube from reaching the internet. You may need to configure minikube to use a proxy.", + URL: proxyDoc, + Issues: []int{3922}, + HideCreateLink: true, }, "PULL_TIMEOUT_EXCEEDED": { - Regexp: re(`failed to pull image k8s.gcr.io.*Client.Timeout exceeded while awaiting headers`), - Advice: "A firewall is blocking Docker within the minikube VM from reaching the internet. You may need to configure it to use a proxy.", - URL: proxyDoc, - Issues: []int{3898}, + Regexp: re(`failed to pull image k8s.gcr.io.*Client.Timeout exceeded while awaiting headers`), + Advice: "A firewall is blocking Docker within the minikube VM from reaching the internet. You may need to configure it to use a proxy.", + URL: proxyDoc, + Issues: []int{3898}, + HideCreateLink: true, }, "SSH_AUTH_FAILURE": { Regexp: re(`ssh: handshake failed: ssh: unable to authenticate.*, no supported methods remain`), Advice: "Your host is failing to route packets to the minikube VM. If you have VPN software, try turning it off or configuring it so that it does not re-route traffic to the VM IP. If not, check your VM environment routing options.", + URL: vpnDoc, Issues: []int{3930}, }, "SSH_TCP_FAILURE": { Regexp: re(`dial tcp .*:22: connectex: A connection attempt failed because the connected party did not properly respond`), Advice: "Your host is failing to route packets to the minikube VM. If you have VPN software, try turning it off or configuring it so that it does not re-route traffic to the VM IP. If not, check your VM environment routing options.", + URL: vpnDoc, Issues: []int{3388}, }, "INVALID_PROXY_HOSTNAME": { @@ -233,6 +309,12 @@ var netProblems = map[string]match{ Advice: "Verify that your HTTP_PROXY and HTTPS_PROXY environment variables are set correctly.", URL: proxyDoc, }, + "HOST_CIDR_CONFLICT": { + Regexp: re(`host-only cidr conflicts with the network address of a host interface`), + Advice: "Specify an alternate --host-only-cidr value, such as 172.16.0.1/24", + Issues: []int{3594}, + HideCreateLink: true, + }, } // deployProblems are Kubernetes deployment problems. @@ -243,17 +325,49 @@ var deployProblems = map[string]match{ Issues: []int{3952}, }, "INVALID_KUBERNETES_VERSION": { - Regexp: re(`No Major.Minor.Patch elements found`), - Advice: "Specify --kubernetes-version in v. form. example: 'v1.1.14'", + Regexp: re(`No Major.Minor.Patch elements found`), + Advice: "Specify --kubernetes-version in v. form. example: 'v1.1.14'", + HideCreateLink: true, }, "KUBERNETES_VERSION_MISSING_V": { Regexp: re(`strconv.ParseUint: parsing "": invalid syntax`), Advice: "Check that your --kubernetes-version has a leading 'v'. For example: 'v1.1.14'", }, + "APISERVER_NEVER_APPEARED": { + Regexp: re(`apiserver process never appeared`), + Advice: "Check that your apiserver flags are valid, or run 'minikube delete'", + Issues: []int{4536}, + }, "APISERVER_TIMEOUT": { - Regexp: re(`wait: waiting for component=kube-apiserver: timed out waiting for the condition`), - Advice: "Run 'minikube delete'. If the problem persists, check your proxy or firewall configuration", - Issues: []int{4202, 3836, 4221}, + Regexp: re(`apiserver: timed out waiting for the condition`), + Advice: "A VPN or firewall is interfering with HTTP access to the minikube VM. Alternatively, try a different VM driver: https://minikube.sigs.k8s.io/docs/start/", + URL: vpnDoc, + Issues: []int{4302}, + }, + "DNS_TIMEOUT": { + Regexp: re(`dns: timed out waiting for the condition`), + Advice: "Run 'kubectl describe pod coredns -n kube-system' and check for a firewall or DNS conflict", + URL: vpnDoc, + }, + "SERVICE_NOT_FOUND": { + Regexp: re(`Could not find finalized endpoint being pointed to by`), + Advice: "Please make sure the service you are looking for is deployed or is in the correct namespace.", + Issues: []int{4599}, + }, + "OOM_KILL_SSH": { + Regexp: re(`Process exited with status 137 from signal KILL`), + Advice: "Disable dynamic memory in your VM manager, or pass in a larger --memory value", + Issues: []int{1766}, + }, + "OOM_KILL_SCP": { + Regexp: re(`An existing connection was forcibly closed by the remote host`), + Advice: "Disable dynamic memory in your VM manager, or pass in a larger --memory value", + Issues: []int{1766}, + }, + "PROXY_UNEXPECTED_503": { + Regexp: re(`proxy.*unexpected response code: 503`), + Advice: "Confirm that you have a working internet connection and that your VM has not run out of resources by using: 'minikube logs'", + Issues: []int{4749}, }, } @@ -265,19 +379,26 @@ var osProblems = map[string]match{ Issues: []int{1574}, }, "SYSTEMCTL_EXIT_1": { - Regexp: re(`Failed to enable container runtime: .*sudo systemctl start docker: exit status 1`), - Advice: "If using the none driver, ensure that systemctl is installed", - URL: "https://minikube.sigs.k8s.io/docs/reference/drivers/none/", - Issues: []int{2704}, + Regexp: re(`Failed to enable container runtime: .*sudo systemctl start docker: exit status 1`), + Advice: "If using the none driver, ensure that systemctl is installed", + URL: "https://minikube.sigs.k8s.io/docs/reference/drivers/none/", + Issues: []int{2704}, + HideCreateLink: true, + }, + "KUBECONFIG_WRITE_FAIL": { + Regexp: re(`Failed to setup kubeconfig: writing kubeconfig`), + Advice: "Unset the KUBECONFIG environment variable, or verify that it does not point to an empty or otherwise invalid path", + Issues: []int{5268, 4100, 5207}, }, } // stateProblems are issues relating to local state var stateProblems = map[string]match{ "MACHINE_DOES_NOT_EXST": { - Regexp: re(`Error getting state for host: machine does not exist`), - Advice: "Run 'minikube delete' to delete the stale VM", - Issues: []int{3864}, + Regexp: re(`Error getting state for host: machine does not exist`), + Advice: "Run 'minikube delete' to delete the stale VM", + Issues: []int{3864}, + HideCreateLink: true, }, "IP_NOT_FOUND": { Regexp: re(`Error getting ssh host name for driver: IP not found`), diff --git a/pkg/minikube/problem/problem.go b/pkg/minikube/problem/problem.go index c4e2660f11..0e7c710242 100644 --- a/pkg/minikube/problem/problem.go +++ b/pkg/minikube/problem/problem.go @@ -39,6 +39,8 @@ type Problem struct { URL string // Issues are a list of related issues to this problem Issues []int + // Hide the new issue link: it isn't our problem, and we won't be able to suggest additional assistance. + HideCreateLink bool } // match maps a regular expression to problem metadata. @@ -49,6 +51,8 @@ type match struct { Issues []int // GOOS is what platforms this problem may be specific to, when disambiguation is necessary. GOOS string + // Hide the new issue link: it isn't our problem, and we won't be able to suggest additional assistance. + HideCreateLink bool } // Display problem metadata to the console @@ -87,11 +91,12 @@ func FromError(err error, os string) *Problem { } if v.Regexp.MatchString(err.Error()) { return &Problem{ - Err: err, - Advice: v.Advice, - URL: v.URL, - ID: k, - Issues: v.Issues, + Err: err, + Advice: v.Advice, + URL: v.URL, + ID: k, + Issues: v.Issues, + HideCreateLink: v.HideCreateLink, } } } diff --git a/pkg/minikube/problem/problem_test.go b/pkg/minikube/problem/problem_test.go index 15b8c9a483..4bb561d5d7 100644 --- a/pkg/minikube/problem/problem_test.go +++ b/pkg/minikube/problem/problem_test.go @@ -119,7 +119,7 @@ VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component MachineWrap, {3922, "", "ISO_DOWNLOAD_FAILED", `unable to cache ISO: https://storage.googleapis.com/minikube/iso/minikube-v0.35.0.iso: failed to download: failed to download to temp file: download failed: 5 error(s) occurred: * Temporary download error: Get https://storage.googleapis.com/minikube/iso/minikube-v0.35.0.iso: dial tcp 216.58.207.144:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.`}, {4107, "darwin", "VBOX_BLOCKED", "Result Code: NS_ERROR_FAILURE (0x80004005)"}, - {4202, "", "APISERVER_TIMEOUT", "Error restarting cluster: wait: waiting for component=kube-apiserver: timed out waiting for the condition"}, + {4302, "", "APISERVER_TIMEOUT", "apiserver: timed out waiting for the condition"}, {4252, "", "DOWNLOAD_TLS_OVERSIZED", "Failed to update cluster: downloading binaries: downloading kubeadm: Error downloading kubeadm v1.14.1: failed to download: failed to download to temp file: download failed: 5 error(s) occurred:\n\nTemporary download error: Get https://storage.googleapis.com/kubernetes-release/release/v1.14.1/bin/linux/amd64/kubeadm: proxyconnect tcp: tls: oversized record received with length 20527"}, {4222, "", "VBOX_HOST_ADAPTER", "Unable to start VM: create: creating: Error setting up host only network on machine start: The host-only adapter we just created is not visible. This is a well known VirtualBox bug. You might want to uninstall it and reinstall at least version 5.0.12 that is is supposed to fix this issue"}, }