Skip to content

Commit 32f470f

Browse files
committed
Remove VBOX_THIRD_PARTY, add GOOS matching
2 parents 27cd8b1 + 4af163a commit 32f470f

File tree

2 files changed

+93
-0
lines changed

2 files changed

+93
-0
lines changed

pkg/minikube/problem/err_map.go

+27
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,33 @@ var vmProblems = map[string]match{
7070
Issues: []int{3614},
7171
URL: "https://stackoverflow.com/questions/52277019/how-to-fix-vm-issue-with-minikube-start",
7272
},
73+
"VBOX_BLOCKED_LOADING": {
74+
Regexp: re(`NS_ERROR_FAILURE.*0x80004005`),
75+
Advice: "Reinstall VirtualBox and verify that it is not blocked: System Preferences -> Security & Privacy -> General -> Some system software was blocked from loading",
76+
Issues: []int{4107},
77+
},
78+
"VBOX_KERNEL_MODULE_NOT_LOADED": {
79+
Regexp: re(`The vboxdrv kernel module is not loaded`),
80+
Advice: "Run 'sudo modprobe vboxdrv' and reinstall VirtualBox if it fails.",
81+
Issues: []int{4043},
82+
},
83+
"VBOX_DEVICE_MISSING": {
84+
Regexp: re(`/dev/vboxdrv does not exist`),
85+
Advice: "Run 'sudo modprobe vboxdrv' and reinstall VirtualBox if it fails.",
86+
Issues: []int{3974},
87+
},
88+
"VBOX_HARDENING": {
89+
Regexp: re(`terminated unexpectedly.*VBoxHardening`),
90+
Advice: "Disable real-time anti-virus software, reboot, and reinstall VirtualBox if the problem continues.",
91+
Issues: []int{3859, 3910},
92+
URL: "https://forums.virtualbox.org/viewtopic.php?f=25&t=82106",
93+
},
94+
"VBOX_HOST_ADAPTER": {
95+
Regexp: re(`The host-only adapter we just created is not visible`),
96+
Advice: "Reboot to complete VirtualBox installation, and verify that VirtualBox is not blocked by your system",
97+
Issues: []int{3614},
98+
URL: "https://stackoverflow.com/questions/52277019/how-to-fix-vm-issue-with-minikube-start",
99+
},
73100
"KVM2_NOT_FOUND": {
74101
Regexp: re(`Driver "kvm2" not found. Do you have the plugin binary .* accessible in your PATH`),
75102
Advice: "Please install the minikube kvm2 VM driver, or select an alternative --vm-driver",

pkg/minikube/problem/problem_test.go

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*
2+
Copyright 2019 The Kubernetes Authors All rights reserved.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package problem
18+
19+
import (
20+
"fmt"
21+
"testing"
22+
)
23+
24+
func TestFromError(t *testing.T) {
25+
var tests = []struct {
26+
issue int
27+
os string
28+
want string
29+
err string
30+
}{
31+
{0, "", "", "this is just a lame error message with no matches."},
32+
{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"},
33+
{3784, "", "VBOX_NOT_FOUND", "create: precreate: VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path"},
34+
{3849, "", "IP_NOT_FOUND", "bootstrapper: Error creating new ssh host from driver: Error getting ssh host name for driver: IP not found"},
35+
{3859, "windows", "VBOX_HARDENING", `Unable to start VM: create: creating: Unable to start the VM: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe startvm minikube --type headless failed:
36+
VBoxManage.exe: error: The virtual machine 'minikube' has terminated unexpectedly during startup with exit code -1073741819 (0xc0000005). More details may be available in 'C:\Users\pabitra_b.minikube\machines\minikube\minikube\Logs\VBoxHardening.log'
37+
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component MachineWrap, interface IMachine`},
38+
{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:
39+
* 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.`},
40+
{4107, "darwin", "VBOX_BLOCKED", "Result Code: NS_ERROR_FAILURE (0x80004005)"},
41+
}
42+
for _, tc := range tests {
43+
t.Run(tc.want, func(t *testing.T) {
44+
got := FromError(fmt.Errorf(tc.err), tc.os)
45+
if got == nil {
46+
if tc.want != "" {
47+
t.Errorf("FromError(%q)=nil, want %s", tc.err, tc.want)
48+
}
49+
return
50+
}
51+
if got.ID != tc.want {
52+
t.Errorf("FromError(%q)=%s, want %s", tc.err, got.ID, tc.want)
53+
}
54+
55+
found := false
56+
for _, i := range got.Issues {
57+
if i == tc.issue {
58+
found = true
59+
}
60+
}
61+
if !found {
62+
t.Errorf("Issue %d is not listed in %+v", tc.issue, got.Issues)
63+
}
64+
})
65+
}
66+
}

0 commit comments

Comments
 (0)