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

Unhandled exception when tunneling all services with a non-existent namespace #19933

Closed
mattisafur opened this issue Nov 10, 2024 · 0 comments · Fixed by #19957
Closed

Unhandled exception when tunneling all services with a non-existent namespace #19933

mattisafur opened this issue Nov 10, 2024 · 0 comments · Fixed by #19957
Assignees
Labels
co/service issues related to the service feature kind/bug Categorizes issue or PR as related to a bug.

Comments

@mattisafur
Copy link

What Happened?

When I am running the command minikube service --all -n some-namespace-that-doesnt-exists the program thrown an exception.

output without --alsologtostderr flag:

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

goroutine 1 [running]:
k8s.io/minikube/cmd/minikube/cmd.init.func35(0x4d8b200?, {0xc0001ba120, 0x0, 0x3?})
        /app/cmd/minikube/cmd/service.go:117 +0x127a
github.com/spf13/cobra.(*Command).execute(0x4d8b200, {0xc0001ba0f0, 0x3, 0x3})
        /go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:989 +0xab1
github.com/spf13/cobra.(*Command).ExecuteC(0x4d8ac40)
        /go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1117 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
        /go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1041
k8s.io/minikube/cmd/minikube/cmd.Execute()
        /app/cmd/minikube/cmd/root.go:174 +0x5a5
main.main()
        /app/cmd/minikube/main.go:95 +0x250

output with --alsologtostderr flag:

I1110 17:58:07.366355   17131 out.go:345] Setting OutFile to fd 1 ...
I1110 17:58:07.366554   17131 out.go:358] Setting ErrFile to fd 2...
I1110 17:58:07.367064   17131 root.go:338] Updating PATH: /home/matt/.minikube/bin
I1110 17:58:07.367597   17131 mustload.go:65] Loading cluster: minikube
I1110 17:58:07.368557   17131 config.go:182] Loaded profile config "minikube": Driver=docker, ContainerRuntime=docker, KubernetesVersion=v1.31.0
I1110 17:58:07.368946   17131 cli_runner.go:164] Run: docker container inspect minikube --format={{.State.Status}}
I1110 17:58:07.407212   17131 host.go:66] Checking if "minikube" exists ...
I1110 17:58:07.407516   17131 cli_runner.go:164] Run: docker container inspect -f "'{{(index (index .NetworkSettings.Ports "8443/tcp") 0).HostPort}}'" minikube
I1110 17:58:07.434659   17131 api_server.go:166] Checking apiserver status ...
I1110 17:58:07.434771   17131 ssh_runner.go:195] Run: sudo pgrep -xnf kube-apiserver.*minikube.*
I1110 17:58:07.434858   17131 cli_runner.go:164] Run: docker container inspect -f "'{{(index (index .NetworkSettings.Ports "22/tcp") 0).HostPort}}'" minikube
I1110 17:58:07.459704   17131 sshutil.go:53] new ssh client: &{IP:127.0.0.1 Port:29227 SSHKeyPath:/home/matt/.minikube/machines/minikube/id_rsa Username:docker}
I1110 17:58:07.797011   17131 ssh_runner.go:195] Run: sudo egrep ^[0-9]+:freezer: /proc/2318/cgroup
I1110 17:58:07.899114   17131 api_server.go:182] apiserver freezer: "7:freezer:/docker/d781e7377d80808d8a5b241c3fa71508bc7f48c5540174aa30a48fea7af16bea/kubepods/burstable/pod9e315b3a91fa9f6f7463439d9dac1a56/3e632bd276dc096d6392c26b235d80e1096d890558d4c200bf5c9b0d1ea64374"
I1110 17:58:07.899259   17131 ssh_runner.go:195] Run: sudo cat /sys/fs/cgroup/freezer/docker/d781e7377d80808d8a5b241c3fa71508bc7f48c5540174aa30a48fea7af16bea/kubepods/burstable/pod9e315b3a91fa9f6f7463439d9dac1a56/3e632bd276dc096d6392c26b235d80e1096d890558d4c200bf5c9b0d1ea64374/freezer.state
I1110 17:58:07.990725   17131 api_server.go:204] freezer state: "THAWED"
I1110 17:58:07.990795   17131 api_server.go:253] Checking apiserver healthz at https://127.0.0.1:29231/healthz ...
I1110 17:58:07.996528   17131 api_server.go:279] https://127.0.0.1:29231/healthz returned 200:
ok
I1110 17:58:07.996577   17131 host.go:66] Checking if "minikube" exists ...
I1110 17:58:07.996842   17131 cli_runner.go:164] Run: docker container inspect -f "{{range .NetworkSettings.Networks}}{{.IPAddress}},{{.GlobalIPv6Address}}{{end}}" minikube
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
k8s.io/minikube/cmd/minikube/cmd.init.func35(0x4d8b200?, {0xc0009a42c0, 0x0, 0x4?})
        /app/cmd/minikube/cmd/service.go:117 +0x127a
github.com/spf13/cobra.(*Command).execute(0x4d8b200, {0xc0009a4280, 0x4, 0x4})
        /go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:989 +0xab1
github.com/spf13/cobra.(*Command).ExecuteC(0x4d8ac40)
        /go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1117 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
        /go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1041
k8s.io/minikube/cmd/minikube/cmd.Execute()
        /app/cmd/minikube/cmd/root.go:174 +0x5a5
main.main()
        /app/cmd/minikube/main.go:95 +0x250

Tested on Ubuntu running on WSL and using the docker driver.

The output above is from a past test I did, but the issue is the same as when I replicated it in the attached log.

Steps I took when recreating the issue:

  • (deleted minikube cluster)
  • started new minikube cluster
  • deployed an exmaple helm chart - helm install some-chart prometheus-community/prometheus
  • ran minikube service list to view the services created from the helm deployment
  • ran minikube service --all -n some-namespace-that-doesnt-exists and received the exception.
  • exported the log using minikube logs --file log.txt

Attach the log file

log.txt
I removed all commands prior to replicating the issue from the audit log for privacy reasons. The minkube cluster has been deleted before replicating the error. The first command in the table is me starting the cluster after deleting it.

Operating System

Ubuntu

Driver

Docker

@spowelljr spowelljr self-assigned this Nov 12, 2024
@spowelljr spowelljr added kind/bug Categorizes issue or PR as related to a bug. co/service issues related to the service feature labels Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/service issues related to the service feature kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants