hookdeck / hookdeck-cli

Alternative to ngrok for localhost asynchronous web development (e.g. webhooks). No account required.
https://hookdeck.com?ref=github-hookdeck-cli
Apache License 2.0
260 stars 9 forks source link

Segfault when using connection specifier #85

Closed baileywickham closed 3 months ago

baileywickham commented 3 months ago

I'm getting a segfault when I attempt to use a source and a connection through the CLI. The connection errors whenever I use either a valid or invalid connection. I get no errors when only specifying the source. Link to line segfaulting here


hookdeck listen 8080 test testconn
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x8 pc=0x10040af84]

goroutine 1 [running]:
github.com/hookdeck/hookdeck-cli/pkg/listen.getConnections(0x140001dedc0, 0x14000244960, {0x16fdbe85b, 0x8})
    /Users/runner/work/hookdeck-cli/hookdeck-cli/pkg/listen/connection.go:41 +0x2a4
github.com/hookdeck/hookdeck-cli/pkg/listen.Listen(0x140001483f0, {0x16fdbe855, 0x5}, {0x16fdbe85b, 0x8}, {0x64?}, 0x1008a7180)
    /Users/runner/work/hookdeck-cli/hookdeck-cli/pkg/listen/listen.go:54 +0xa8
github.com/hookdeck/hookdeck-cli/pkg/cmd.(*listenCmd).runListenCmd(0x1400015e820, 0x1001d2710?, {0x140001d0f90, 0x140001b3bb8?, 0x0?})
    /Users/runner/work/hookdeck-cli/hookdeck-cli/pkg/cmd/listen.go:115 +0x194
github.com/spf13/cobra.(*Command).execute(0x140001e0000, {0x140001d0f60, 0x3, 0x3})
    /Users/runner/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:842 +0x4c4
github.com/spf13/cobra.(*Command).ExecuteC(0x10089dec0)
    /Users/runner/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950 +0x34c
github.com/spf13/cobra.(*Command).Execute(...)
    /Users/runner/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887
github.com/hookdeck/hookdeck-cli/pkg/cmd.Execute()
    /Users/runner/work/hookdeck-cli/hookdeck-cli/pkg/cmd/root.go:46 +0x34
main.main()
    /Users/runner/work/hookdeck-cli/hookdeck-cli/main.go:21 +0x20```
leggetter commented 3 months ago

@alexluong could you take a look at this, please?

baileywickham commented 3 months ago

This might be an error on my part (let me know if it is), but a better error message would be great if it is! Thanks

leggetter commented 3 months ago

@baileywickham could you please confirm the version of the CLI you are running?

https://github.com/hookdeck/hookdeck-cli?tab=readme-ov-file#version

baileywickham commented 3 months ago

Thanks for the quick response.

❯ hookdeck version
hookdeck version 0.10.0
A newer version of the Hookdeck CLI is available, please update to: v0.9.3

Installed via brew on macos

alexluong commented 3 months ago

I think this should be fixed by #83. This issue is because the source has a nameless connection. I assume this is the case, @baileywickham?

baileywickham commented 3 months ago
image

I thought my connection had a name, am I missing something?

I also thought it might be related to #76, but I'm on v0.10.0.

If you want I can pull and test #83

baileywickham commented 3 months ago

I see what you mean, one of the other connections was nameless, not bwtesting. Naming that fixed the error. Feel free to close once #83 is merged. Thanks for the quick responses.

leggetter commented 3 months ago

Thanks for the quick response.

❯ hookdeck version
hookdeck version 0.10.0
A newer version of the Hookdeck CLI is available, please update to: v0.9.3

Installed via brew on macos

Thanks for this. This flagged that we published a version on GitHub out of order.

I've just triggered the release of v0.10.1 which contains #83.

baileywickham commented 3 months ago

Thanks, I can confirm that v0.10.1 fixed my issue.

leggetter commented 3 months ago

Thanks, @baileywickham 🙌