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

panic: runtime error: invalid memory address or nil pointer dereference #317

Closed
olevole opened this issue Dec 11, 2024 · 3 comments · Fixed by #318
Closed

panic: runtime error: invalid memory address or nil pointer dereference #317

olevole opened this issue Dec 11, 2024 · 3 comments · Fixed by #318

Comments

@olevole
Copy link

olevole commented Dec 11, 2024

garm-cli init --name=local_garm --url https://XXX -e root@localhost --username=garm --password="XXXX"

leads to:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x9f0d93]

goroutine 1 [running]:
github.com/cloudbase/garm/cmd/garm-cli/cmd.init.func3(0x86c6ad200?, {0xba657a?, 0x4?, 0xba657e?})
        /root/garm/cmd/garm-cli/cmd/init.go:118 +0x613
github.com/spf13/cobra.(*Command).execute(0x12104e0, {0x86c29ca10, 0x7, 0x7})
        /root/garm/vendor/github.com/spf13/cobra/command.go:983 +0xaaa
github.com/spf13/cobra.(*Command).ExecuteC(0x1218920)
        /root/garm/vendor/github.com/spf13/cobra/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
        /root/garm/vendor/github.com/spf13/cobra/command.go:1039
github.com/cloudbase/garm/cmd/garm-cli/cmd.Execute()
        /root/garm/cmd/garm-cli/cmd/root.go:61 +0x16d
main.main()
        /root/garm/cmd/garm-cli/main.go:20 +0xf

Other info:

  • OS: 15.0-CURRENT
  • garm v0.1.5-41-gc4a7a59
  • go version go1.23.2 freebsd/amd64

Most likely it is not garm bug but with a third-party/submodule (spf13/cobra?), but maybe there will be some ideas/comments?

ps: I used garm on FreeBSD (with custom virtualization backend/engine - bhyve hypervisor) two years ago and it worked just fine.

Thanks!

@gabriel-samfira
Copy link
Member

Hi @olevole

Does this happen with the released version well or just the main branch?

@gabriel-samfira
Copy link
Member

The panic probably happens because I failed to check the error message before trying to access the payload from the update URLs call. PR #318 should fix that. Let me know if the issue persists. (I should make time to write some tests for the CLI as well).

@olevole
Copy link
Author

olevole commented Dec 12, 2024

@gabriel-samfira

Congrats! Your controller is now initialized

The patch fixed my problem! Thanks!

@olevole olevole closed this as completed Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants