kubernetes / minikube

Run Kubernetes locally
https://minikube.sigs.k8s.io/
Apache License 2.0
29.35k stars 4.88k forks source link

Minikube crashes on start-up in glinux #8668

Closed redborian closed 3 years ago

redborian commented 4 years ago

Steps to reproduce the issue:

  1. On a glinux machine, run minikube start

Full output of minikube start command used, if not already included:

panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/shirou/gopsutil/host.PlatformInformationWithContext(0x1edd4e0, 0xc0000ec010, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,, 0xc0006389a0)
    /go/pkg/mod/github.com/shirou/gopsutil@v2.18.12+incompatible/host/host_linux.go:356 +0x1ad5
github.com/shirou/gopsutil/host.PlatformInformation(0xc000467080, 0x18, 0x0, 0x0, 0xc0003f1150, 0x7ffcd470d99b, 0x13, 0x7ffcd470d99b)
    /go/pkg/mod/github.com/shirou/gopsutil@v2.18.12+incompatible/host/host_linux.go:312 +0x3d
github.com/shirou/gopsutil/host.InfoWithContext(0x1edd4e0, 0xc0000ec010, 0x203000, 0x203000, 0x203000)
    /go/pkg/mod/github.com/shirou/gopsutil@v2.18.12+incompatible/host/host_linux.go:48 +0x8c
github.com/shirou/gopsutil/host.Info(...)
    /go/pkg/mod/github.com/shirou/gopsutil@v2.18.12+incompatible/host/host_linux.go:35
k8s.io/minikube/cmd/minikube/cmd.platform(0x193cca0, 0xc000408c00)
    /app/cmd/minikube/cmd/start.go:95 +0x62
k8s.io/minikube/cmd/minikube/cmd.displayVersion(0x1e6c9a8, 0xe)
    /app/cmd/minikube/cmd/start.go:348 +0x202
k8s.io/minikube/cmd/minikube/cmd.runStart(0x2c6e5a0, 0xc0006e9c80, 0x0, 0x6)
    /app/cmd/minikube/cmd/start.go:124 +0x4e
github.com/spf13/cobra.(*Command).execute(0x2c6e5a0, 0xc0006e9c20, 0x6, 0x6, 0x2c6e5a0,, 0xc0006e9c20)
    /go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:846 +0x2aa
github.com/spf13/cobra.(*Command).ExecuteC(0x2c73460, 0x0, 0x1, 0xc000513890)
    /go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950 +0x349
github.com/spf13/cobra.(*Command).Execute(...)
    /go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887
k8s.io/minikube/cmd/minikube/cmd.Execute,()
    /app/cmd/minikube/cmd/root.go:106 +0x747
,main.main()
    /app/cmd/minikube/main.go:71 +0x143

Optional: Full output of minikube logs command:

vjocw commented 4 years ago

Cannot get logs because minikube cannot be started.

afbjorklund commented 4 years ago

This is really an upstream* bug, it is trying to parse /etc/debian_version

* https://github.com/shirou/gopsutil

Apparently that file is empty (?), which is unexpected (it returns the first line)

Or ask gLinux to fix their base-files...

vjocw commented 4 years ago

@afbjorklund I see, thanks for taking a look. I think we can close this for now. We have a few members with Ubuntu boxes that can test linux and we will go that route.

justinsb commented 4 years ago

I think this is already fixed upstream in https://github.com/shirou/gopsutil/commit/c69ef749eb2a6bcc6fea1025a7e652bc259b8e2e

fejta-bot commented 3 years ago

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

fejta-bot commented 3 years ago

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

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 rotten

mogren commented 3 years ago

I can add that the file is not empty, it is just missing a newline. Adding a newline to /etc/debian_version fixed the issue for me.