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

Adding pool to a non-existent repo results in SIGSEGV: segmentation violation in garm-cli #265

Closed
gustaff-weldon opened this issue Jun 20, 2024 · 2 comments

Comments

@gustaff-weldon
Copy link

When adding a pool via garm-cli, if repo id does not exist, garm-cli will exit with SIGSEGV error:

Check providers:

# garm-cli provider list
+--------------+-----------------------+----------+
| NAME         | DESCRIPTION           | TYPE     |
+--------------+-----------------------+----------+
| gcp_external | external gcp provider | external |
+--------------+-----------------------+----------+

Check repos:

# garm-cli repo list
+--------------------------------------+----------+----------+------------------+------------------+
| ID                                   | OWNER    | NAME     | CREDENTIALS NAME | POOL MGR RUNNING |
+--------------------------------------+----------+----------+------------------+------------------+
| 6906b1b0-3c19-4ace-9591-f8c25a952766 | redacted | redacted | garm-pat         | true             |
+--------------------------------------+----------+----------+------------------+------------------+

Add pool with wrong repo id:

# garm-cli pool add \
   --repo 12345678-0000-0000-1234-123456789012 \
   --enabled true \
   --provider-name gcp_external \
   --flavor e2-medium \
   --image projects/ubuntu-os-cloud/global/images/ubuntu-2204-jammy-v20240614 \
   --os-arch amd64 \
   --max-runners 5 \
   --min-idle-runners 0 \
   --os-type linux \
   --tags garm-e2-medium

will result in:

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

goroutine 1 [running]:
github.com/cloudbase/garm/cmd/garm-cli/cmd.init.func23(0x104ebc0, {0xabea78?, 0x4?, 0xabea7c?})
	/build/garm/cmd/garm-cli/cmd/pool.go:254 +0x397
github.com/spf13/cobra.(*Command).execute(0x104ebc0, {0xc0005ed040, 0x14, 0x14})
	/build/garm/vendor/github.com/spf13/cobra/command.go:983 +0xaca
github.com/spf13/cobra.(*Command).ExecuteC(0x1051400)
	/build/garm/vendor/github.com/spf13/cobra/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
	/build/garm/vendor/github.com/spf13/cobra/command.go:1039
github.com/cloudbase/garm/cmd/garm-cli/cmd.Execute()
	/build/garm/cmd/garm-cli/cmd/root.go:57 +0x13b
main.main()
	/build/garm/cmd/garm-cli/main.go:20 +0xf
@gabriel-samfira
Copy link
Member

Hi!

This has been fixed in main here: #239

Sorry about that.

@gustaff-weldon
Copy link
Author

👍 so 0.1.5 should fix this, thanks!

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

No branches or pull requests

2 participants