Skip to content

Commit 2a4270c

Browse files
authored
Merge pull request #4257 from tstromberg/solution-msgs
Add more solutions messages
2 parents c55b916 + b1e5f0d commit 2a4270c

File tree

4 files changed

+56
-11
lines changed

4 files changed

+56
-11
lines changed

pkg/minikube/logs/logs.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333
)
3434

3535
// rootCauseRe is a regular expression that matches known failure root causes
36-
var rootCauseRe = regexp.MustCompile(`^error: |eviction manager: pods.* evicted|unknown flag: --|forbidden.*no providers available|eviction manager:.*evicted`)
36+
var rootCauseRe = regexp.MustCompile(`^error: |eviction manager: pods.* evicted|unknown flag: --|forbidden.*no providers available|eviction manager:.*evicted|tls: bad certificate`)
3737

3838
// ignoreRe is a regular expression that matches spurious errors to not surface
3939
var ignoreCauseRe = regexp.MustCompile("error: no objects passed to apply")

pkg/minikube/logs/logs_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ func TestIsProblem(t *testing.T) {
3434
{"apiserver-admission #3524", true, "error: unknown flag: --GenericServerRunOptions.AdmissionControl"},
3535
{"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`},
3636
{"no-objects-passed-to-apply #4010", false, "error: no objects passed to apply"},
37+
{"bad-certificate #4251", true, "log.go:172] http: TLS handshake error from 127.0.0.1:49200: remote error: tls: bad certificate"},
3738
}
3839
for _, tc := range tests {
3940
t.Run(tc.name, func(t *testing.T) {

pkg/minikube/problem/err_map.go

+49-10
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ func re(s string) *regexp.Regexp {
2525

2626
// vmProblems are VM related problems
2727
var vmProblems = map[string]match{
28+
"HYPERKIT_NO_IP": {
29+
Regexp: re(`IP address never found in dhcp leases file Temporary Error: Could not find an IP address for`),
30+
Advice: "Install the latest minikube hyperkit driver, and run 'minikube delete'",
31+
URL: "https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#hyperkit-driver",
32+
Issues: []int{1926, 4206},
33+
},
2834
"VBOX_NOT_FOUND": {
2935
Regexp: re(`VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path`),
3036
Advice: "Install VirtualBox, ensure that VBoxManage is executable and in path, or select an alternative value for --vm-driver",
@@ -67,7 +73,7 @@ var vmProblems = map[string]match{
6773
"VBOX_HOST_ADAPTER": {
6874
Regexp: re(`The host-only adapter we just created is not visible`),
6975
Advice: "Reboot to complete VirtualBox installation, and verify that VirtualBox is not blocked by your system",
70-
Issues: []int{3614},
76+
Issues: []int{3614, 4222},
7177
URL: "https://stackoverflow.com/questions/52277019/how-to-fix-vm-issue-with-minikube-start",
7278
},
7379
"VBOX_KERNEL_MODULE_NOT_LOADED": {
@@ -80,21 +86,28 @@ var vmProblems = map[string]match{
8086
Advice: "Please install the minikube kvm2 VM driver, or select an alternative --vm-driver",
8187
URL: "https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#kvm2-driver",
8288
},
83-
"KVM2_NO_IP": {
89+
"KVM2_RESTART_NO_IP": {
8490
Regexp: re(`Error starting stopped host: Machine didn't return an IP after 120 seconds`),
8591
Advice: "The KVM driver is unable to resurrect this old VM. Please run `minikube delete` to delete it and try again.",
86-
Issues: []int{3901, 3566, 3434},
92+
Issues: []int{3901, 3434},
93+
},
94+
"KVM2_START_NO_IP": {
95+
Regexp: re(`Error in driver during machine creation: Machine didn't return an IP after 120 seconds`),
96+
Advice: "The KVM driver is not providing an IP address to the VM. Try checking your libvirt configuration and/or opening an issue",
97+
URL: "https://fedoraproject.org/wiki/How_to_debug_Virtualization_problems#Networking",
98+
Issues: []int{4249, 3566},
8799
},
88100
"KVM2_NETWORK_DEFINE_XML": {
89101
Regexp: re(`not supported by the connection driver: virNetworkDefineXML`),
90102
Advice: "Rebuild libvirt with virt-network support",
91103
URL: "https://forums.gentoo.org/viewtopic-t-981692-start-0.html",
92104
Issues: []int{4195},
93105
},
94-
"VM_DOES_NOT_EXIST": {
95-
Regexp: re(`Error getting state for host: machine does not exist`),
96-
Advice: "Your system no longer knows about the VM previously created by minikube. Run 'minikube delete' to reset your local state.",
97-
Issues: []int{3864},
106+
"KVM_UNAVAILABLE": {
107+
Regexp: re(`invalid argument: could not find capabilities for domaintype=kvm`),
108+
Advice: "Your host does not support KVM virtualization. Ensure that qemu-kvm is installed, and run 'virt-host-validate' to debug the problem",
109+
URL: "http://mikko.repolainen.fi/documents/virtualization-with-kvm",
110+
Issues: []int{2991},
98111
},
99112
"VM_BOOT_FAILED_HYPERV_ENABLED": {
100113
Regexp: re(`VirtualBox won't boot a 64bits VM when Hyper-V is activated`),
@@ -106,6 +119,21 @@ var vmProblems = map[string]match{
106119
Advice: "Configure an external network switch following the official documentation, then add `--hyperv-virtual-switch=<switch-name>` to `minikube start`",
107120
URL: "https://docs.docker.com/machine/drivers/hyper-v/",
108121
},
122+
"HOST_CIDR_CONFLICT": {
123+
Regexp: re(`host-only cidr conflicts with the network address of a host interface`),
124+
Advice: "Specify an alternate --host-only-cidr value, such as 172.16.0.1/24",
125+
Issues: []int{3594},
126+
},
127+
"OOM_KILL_SSH": {
128+
Regexp: re(`Process exited with status 137 from signal KILL`),
129+
Advice: "Disable dynamic memory in your VM manager, or pass in a larger --memory value",
130+
Issues: []int{1766},
131+
},
132+
"OOM_KILL_SCP": {
133+
Regexp: re(`An existing connection was forcibly closed by the remote host`),
134+
Advice: "Disable dynamic memory in your VM manager, or pass in a larger --memory value",
135+
Issues: []int{1766},
136+
},
109137
}
110138

111139
// proxyDoc is the URL to proxy documentation
@@ -132,10 +160,10 @@ var netProblems = map[string]match{
132160
Issues: []int{3846},
133161
},
134162
"DOWNLOAD_TLS_OVERSIZED": {
135-
Regexp: re(`failed to download.*tls: oversized record received with length`),
136-
Advice: "A firewall is interfering with minikube's ability to make outgoing HTTPS requests. You may need to configure minikube to use a proxy.",
163+
Regexp: re(`tls: oversized record received with length`),
164+
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.",
137165
URL: proxyDoc,
138-
Issues: []int{3857, 3759},
166+
Issues: []int{3857, 3759, 4252},
139167
},
140168
"ISO_DOWNLOAD_FAILED": {
141169
Regexp: re(`iso: failed to download`),
@@ -181,6 +209,11 @@ var deployProblems = map[string]match{
181209
Regexp: re(`strconv.ParseUint: parsing "": invalid syntax`),
182210
Advice: "Check that your --kubernetes-version has a leading 'v'. For example: 'v1.1.14'",
183211
},
212+
"APISERVER_TIMEOUT": {
213+
Regexp: re(`wait: waiting for component=kube-apiserver: timed out waiting for the condition`),
214+
Advice: "Run 'minikube delete'. If the problem persists, check your proxy or firewall configuration",
215+
Issues: []int{4202, 3836, 4221},
216+
},
184217
}
185218

186219
// osProblems are operating-system specific issues
@@ -190,6 +223,12 @@ var osProblems = map[string]match{
190223
Advice: "Run minikube from the C: drive.",
191224
Issues: []int{1574},
192225
},
226+
"SYSTEMCTL_EXIT_1": {
227+
Regexp: re(`Failed to enable container runtime: .*sudo systemctl start docker: exit status 1`),
228+
Advice: "If using the none driver, ensure that systemctl is installed",
229+
URL: "https://github.com/kubernetes/minikube/blob/master/docs/vmdriver-none.md",
230+
Issues: []int{2704},
231+
},
193232
}
194233

195234
// stateProblems are issues relating to local state

pkg/minikube/problem/problem_test.go

+5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ func TestFromError(t *testing.T) {
2929
err string
3030
}{
3131
{0, "", "", "this is just a lame error message with no matches."},
32+
{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 ')"},
33+
{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."},
3234
{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"},
3335
{3784, "", "VBOX_NOT_FOUND", "create: precreate: VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path"},
3436
{3849, "", "IP_NOT_FOUND", "bootstrapper: Error creating new ssh host from driver: Error getting ssh host name for driver: IP not found"},
@@ -38,6 +40,9 @@ VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component MachineWrap,
3840
{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:
3941
* 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.`},
4042
{4107, "darwin", "VBOX_BLOCKED", "Result Code: NS_ERROR_FAILURE (0x80004005)"},
43+
{4202, "", "APISERVER_TIMEOUT", "Error restarting cluster: wait: waiting for component=kube-apiserver: timed out waiting for the condition"},
44+
{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"},
45+
{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"},
4146
}
4247
for _, tc := range tests {
4348
t.Run(tc.want, func(t *testing.T) {

0 commit comments

Comments
 (0)