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

nil pointer error when enabling addon on non-existing cluster #17317

Closed
marufmax opened this issue Sep 28, 2023 · 1 comment · Fixed by #17324
Closed

nil pointer error when enabling addon on non-existing cluster #17317

marufmax opened this issue Sep 28, 2023 · 1 comment · Fixed by #17324
Assignees
Labels
area/addons kind/regression Categorizes issue or PR as related to a regression from a prior release. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.

Comments

@marufmax
Copy link

What Happened?

❯❯ minikube version
minikube version: v1.31.2
commit: fd7ecd9c4599bef9f04c0986c4a0187f98a4396e

Steps to reproduce:

  1. Download latest version
  2. Delete all profiles minikube delete --all
  3. Start minikube with a new profile minikube start -p test-profile set driver docker
  4. Try enabling any addons, for example:
minikube addons enable dashboard

Will show below error:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x220 pc=0x104057b3c]
goroutine 1 [running]:
k8s.io/minikube/cmd/minikube/cmd/config.glob..func11(0x106097c40?, {0x140010db110, 0x1, 0x1?})
        /app/cmd/minikube/cmd/config/enable.go:47 +0x1cc
github.com/spf13/cobra.(*Command).execute(0x106097c40, {0x140010db0e0, 0x1, 0x1})
        /go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:944 +0x5b0
github.com/spf13/cobra.(*Command).ExecuteC(0x106091d60)
        /go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:1068 +0x35c
github.com/spf13/cobra.(*Command).Execute(...)
        /go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:992
k8s.io/minikube/cmd/minikube/cmd.Execute()
        /app/cmd/minikube/cmd/root.go:174 +0x6cc
main.main()
        /app/cmd/minikube/main.go:95 +0x260

Attach the log file

  • ==> Audit <==
  • |---------|--------------------------------|------------------|-------|---------|---------------------|---------------------|
    | Command | Args | Profile | User | Version | Start Time | End Time |
    |---------|--------------------------------|------------------|-------|---------|---------------------|---------------------|
    | addons | enable registry | minikube | maruf | v1.31.2 | 28 Sep 23 22:11 +06 | |
    | start | --nodes 2 -p service3-cluster | service3-cluster | maruf | v1.31.2 | 28 Sep 23 22:12 +06 | 28 Sep 23 22:14 +06 |
    | | set driver docker | | | | | |
    | addons | enable metrics-server | minikube | maruf | v1.31.2 | 28 Sep 23 22:16 +06 | |
    | delete | --all | minikube | maruf | v1.31.2 | 28 Sep 23 22:16 +06 | 28 Sep 23 22:16 +06 |
    | start | | minikube | maruf | v1.31.2 | 28 Sep 23 22:17 +06 | 28 Sep 23 22:17 +06 |
    | addons | enable metrics-server | minikube | maruf | v1.31.2 | 28 Sep 23 22:17 +06 | 28 Sep 23 22:17 +06 |
    | delete | --all | minikube | maruf | v1.31.2 | 28 Sep 23 22:17 +06 | 28 Sep 23 22:17 +06 |
    | start | -p service3-cluster set driver | service3-cluster | maruf | v1.31.2 | 28 Sep 23 22:32 +06 | 28 Sep 23 22:32 +06 |
    | | docker | | | | | |
    | addons | enable metrics-server | minikube | maruf | v1.31.2 | 28 Sep 23 22:32 +06 | |
    |---------|--------------------------------|------------------|-------|---------|---------------------|---------------------|

Operating System

macOS (Default)

Driver

Docker

@spowelljr spowelljr self-assigned this Sep 29, 2023
@spowelljr spowelljr added area/addons kind/regression Categorizes issue or PR as related to a regression from a prior release. labels Sep 29, 2023
@spowelljr
Copy link
Member

Hi @marufmax, while this error should not occur, the problem is you're not passing your profile.

You should be running minikube addons enable dashboard -p test-profile

But we shouldn't be outputting that error when trying to enable an addon on a non-existing cluster, we should output:

🤷  Profile "minikube" not found. Run "minikube profile list" to view all profiles.
👉  To start a cluster, run: "minikube start"

@spowelljr spowelljr changed the title Enabling add-on not working in latest version when profile is different than default minikube nil pointer error when enabling addon on non-existing cluster Sep 29, 2023
@spowelljr spowelljr added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/addons kind/regression Categorizes issue or PR as related to a regression from a prior release. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants