Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Crash when calling zrok share reserved without shareToken #740

Closed
rossvz opened this issue Aug 26, 2024 · 1 comment
Closed

Crash when calling zrok share reserved without shareToken #740

rossvz opened this issue Aug 26, 2024 · 1 comment
Assignees
Labels
defect Something isn't working
Milestone

Comments

@rossvz
Copy link

rossvz commented Aug 26, 2024

The Zrok docs mention just running zrok share reserved after creating a reserved instance.

However, when I ran that I get the following:

❯ zrok share reserved
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
main.(*shareReservedCommand).run(0x0?, 0x6df3a3eb00000000?, {0x10655dfe0?, 0x0?, 0x0?})
	github.com/openziti/zrok/cmd/zrok/shareReserved.go:49 +0x1564
github.com/spf13/cobra.(*Command).execute(0x14001014c08, {0x10655dfe0, 0x0, 0x0})
	github.com/spf13/cobra@v1.8.0/command.go:987 +0x828
github.com/spf13/cobra.(*Command).ExecuteC(0x1063d48a0)
	github.com/spf13/cobra@v1.8.0/command.go:1115 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/cobra@v1.8.0/command.go:1039
main.main()
	github.com/openziti/zrok/cmd/zrok/main.go:106 +0x24

Looking in the error message I went to the source file here

and realized it's expecting an argument. After the fact I saw that the help text usage implies the <shareToken> but a more helpful error message would be appreciated.

Note - I tried cloning this and fixing myself but I dont think I understand enough about the project to get the error message showing correctly.

@openziti openziti deleted a comment Aug 26, 2024
@michaelquigley
Copy link
Collaborator

Nice find. It's a one-liner fix. Will include a fix in the next v0.4 release.

@michaelquigley michaelquigley self-assigned this Aug 26, 2024
@michaelquigley michaelquigley added the defect Something isn't working label Aug 26, 2024
@michaelquigley michaelquigley added this to the v0.4 milestone Aug 26, 2024
michaelquigley added a commit that referenced this issue Sep 17, 2024
michaelquigley added a commit that referenced this issue Sep 17, 2024
Fix Argument Handling in Reserved Sharing (#740)
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
defect Something isn't working
Projects
Development

No branches or pull requests

2 participants