Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Dont call close handler if conn is nil#255

Merged
robindiddams merged 1 commit intomainfrom
catch-panic-in-ws-shutdown
Apr 30, 2025
Merged

Dont call close handler if conn is nil#255
robindiddams merged 1 commit intomainfrom
catch-panic-in-ws-shutdown

Conversation

@robindiddams
Copy link
Copy Markdown
Contributor

@robindiddams robindiddams commented Apr 30, 2025

fixes:

[ERROR] failed to read message: websocket: close 1006 (abnormal closure): unexpected EOF
[INFO]  attempting to reconnect, retry 1 of 5
[ERROR] failed to reconnect: failed to dial: dial tcp [::1]:8787: connect: connection refused
[INFO]  live dev connection closed, shutting down
[DEBUG] server stopping
[INFO]  server stopped
[DEBUG] shutting down OpenTelemetry
[DEBUG] shut down OpenTelemetry
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x128 pc=0x104bb33cc]

goroutine 1 [running]:
github.com/gorilla/websocket.(*Conn).CloseHandler(...)
        C:/Users/runneradmin/go/pkg/mod/github.com/gorilla/websocket@v1.5.3/conn.go:1118
github.com/agentuity/cli/internal/dev.(*Websocket).Close(0x1400047c2c0)
        D:/a/cli/cli/internal/dev/websocket.go:376 +0x10c
github.com/agentuity/cli/cmd.init.func28(0x105a649e0, {0x105aa9fe0?, 0x4?, 0x104c7562e?})
        D:/a/cli/cli/cmd/dev.go:196 +0x1178
github.com/spf13/cobra.(*Command).execute(0x105a649e0, {0x105aa9fe0, 0x0, 0x0})
        C:/Users/runneradmin/go/pkg/mod/github.com/spf13/cobra@v1.9.1/command.go:1019 +0x810
github.com/spf13/cobra.(*Command).ExecuteC(0x105a66560)
        C:/Users/runneradmin/go/pkg/mod/github.com/spf13/cobra@v1.9.1/command.go:1148 +0x350
github.com/spf13/cobra.(*Command).Execute(...)
        C:/Users/runneradmin/go/pkg/mod/github.com/spf13/cobra@v1.9.1/command.go:1071
github.com/agentuity/cli/cmd.Execute()
        D:/a/cli/cli/cmd/root.go:76 +0x24
main.main()
        D:/a/cli/cli/main.go:47 +0x21c

@robindiddams robindiddams requested a review from jhaynie April 30, 2025 16:18
@robindiddams robindiddams merged commit 6d48247 into main Apr 30, 2025
12 checks passed
@robindiddams robindiddams deleted the catch-panic-in-ws-shutdown branch April 30, 2025 17:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant