Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more solutions messages #4257

Merged
merged 3 commits into from
May 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/minikube/logs/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,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`)
var rootCauseRe = regexp.MustCompile(`^error: |eviction manager: pods.* evicted|unknown flag: --|forbidden.*no providers available|eviction manager:.*evicted|tls: bad certificate`)

// ignoreRe is a regular expression that matches spurious errors to not surface
var ignoreCauseRe = regexp.MustCompile("error: no objects passed to apply")
Expand Down
1 change: 1 addition & 0 deletions pkg/minikube/logs/logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func TestIsProblem(t *testing.T) {
{"apiserver-admission #3524", true, "error: unknown flag: --GenericServerRunOptions.AdmissionControl"},
{"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"},
}
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
Expand Down
59 changes: 49 additions & 10 deletions pkg/minikube/problem/err_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ func re(s string) *regexp.Regexp {

// vmProblems are VM related problems
var vmProblems = map[string]match{
"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'",
URL: "https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#hyperkit-driver",
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",
Expand Down Expand Up @@ -67,7 +73,7 @@ var vmProblems = map[string]match{
"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},
Issues: []int{3614, 4222},
URL: "https://stackoverflow.com/questions/52277019/how-to-fix-vm-issue-with-minikube-start",
},
"VBOX_KERNEL_MODULE_NOT_LOADED": {
Expand All @@ -80,21 +86,28 @@ var vmProblems = map[string]match{
Advice: "Please install the minikube kvm2 VM driver, or select an alternative --vm-driver",
URL: "https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#kvm2-driver",
},
"KVM2_NO_IP": {
"KVM2_RESTART_NO_IP": {
Regexp: re(`Error starting stopped host: Machine didn't return an IP after 120 seconds`),
Advice: "The KVM driver is unable to resurrect this old VM. Please run `minikube delete` to delete it and try again.",
Issues: []int{3901, 3566, 3434},
Issues: []int{3901, 3434},
},
"KVM2_START_NO_IP": {
Regexp: re(`Error in driver during machine creation: Machine didn't return an IP after 120 seconds`),
Advice: "The KVM driver is not providing an IP address to the VM. Try checking your libvirt configuration and/or opening an issue",
URL: "https://fedoraproject.org/wiki/How_to_debug_Virtualization_problems#Networking",
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},
},
"VM_DOES_NOT_EXIST": {
Regexp: re(`Error getting state for host: machine does not exist`),
Advice: "Your system no longer knows about the VM previously created by minikube. Run 'minikube delete' to reset your local state.",
Issues: []int{3864},
"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},
},
"VM_BOOT_FAILED_HYPERV_ENABLED": {
Regexp: re(`VirtualBox won't boot a 64bits VM when Hyper-V is activated`),
Expand All @@ -106,6 +119,21 @@ var vmProblems = map[string]match{
Advice: "Configure an external network switch following the official documentation, then add `--hyperv-virtual-switch=<switch-name>` to `minikube start`",
URL: "https://docs.docker.com/machine/drivers/hyper-v/",
},
"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},
},
"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},
},
}

// proxyDoc is the URL to proxy documentation
Expand All @@ -132,10 +160,10 @@ var netProblems = map[string]match{
Issues: []int{3846},
},
"DOWNLOAD_TLS_OVERSIZED": {
Regexp: re(`failed to download.*tls: oversized record received with length`),
Advice: "A firewall is interfering with minikube's ability to make outgoing HTTPS requests. You may need to configure minikube to use a proxy.",
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},
Issues: []int{3857, 3759, 4252},
},
"ISO_DOWNLOAD_FAILED": {
Regexp: re(`iso: failed to download`),
Expand Down Expand Up @@ -181,6 +209,11 @@ var deployProblems = map[string]match{
Regexp: re(`strconv.ParseUint: parsing "": invalid syntax`),
Advice: "Check that your --kubernetes-version has a leading 'v'. For example: 'v1.1.14'",
},
"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},
},
}

// osProblems are operating-system specific issues
Expand All @@ -190,6 +223,12 @@ var osProblems = map[string]match{
Advice: "Run minikube from the C: drive.",
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://github.com/kubernetes/minikube/blob/master/docs/vmdriver-none.md",
Issues: []int{2704},
},
}

// stateProblems are issues relating to local state
Expand Down
5 changes: 5 additions & 0 deletions pkg/minikube/problem/problem_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ func TestFromError(t *testing.T) {
err string
}{
{0, "", "", "this is just a lame error message with no matches."},
{2991, "", "KVM_UNAVAILABLE", "Unable to start VM: create: Error creating machine: Error in driver during machine creation: creating domain: Error defining domain xml:\n\n: virError(Code=8, Domain=44, Message='invalid argument: could not find capabilities for domaintype=kvm ')"},
{3594, "", "HOST_CIDR_CONFLICT", "Error starting host: Error starting stopped host: Error setting up host only network on machine start: host-only cidr conflicts with the network address of a host interface."},
{3614, "", "VBOX_HOST_ADAPTER", "Error starting host: Error starting stopped host: 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"},
{3784, "", "VBOX_NOT_FOUND", "create: precreate: VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path"},
{3849, "", "IP_NOT_FOUND", "bootstrapper: Error creating new ssh host from driver: Error getting ssh host name for driver: IP not found"},
Expand All @@ -38,6 +40,9 @@ 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"},
{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"},
}
for _, tc := range tests {
t.Run(tc.want, func(t *testing.T) {
Expand Down