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

Log spammed with: Failed to parse localaddr for upstream connection "[::1]" and "hijacked connection" messages #114

Open
Robby- opened this issue Jan 22, 2025 · 2 comments

Comments

@Robby-
Copy link

Robby- commented Jan 22, 2025

We are connecting to the ircd over the local loopback interface using ::1 as the address, and even though everything seems to work fine, the log/console is getting spammed with the following messages:

2025/01/22 06:21:45.943530 L_WARN client:253767 Failed to parse localaddr for upstream connection "[::1]"
2025/01/22 06:21:47.294457 L_WARN client:253768 Failed to parse localaddr for upstream connection "[::1]"
2025/01/22 06:21:59.263131 http: response.WriteHeader on hijacked connection from github.com/igm/sockjs-go/v3/sockjs.(*Handler).sockjsWebsocket (websocket.go:53)
2025/01/22 06:21:59.263230 http: response.Write on hijacked connection from fmt.Fprintln (print.go:305)
2025/01/22 06:22:00.085936 L_WARN client:253769 Failed to parse localaddr for upstream connection "[::1]"
2025/01/22 06:22:15.730254 L_WARN client:253770 Failed to parse localaddr for upstream connection "[::1]"
2025/01/22 06:22:19.430853 http: response.WriteHeader on hijacked connection from github.com/igm/sockjs-go/v3/sockjs.(*Handler).sockjsWebsocket (websocket.go:53)
2025/01/22 06:22:19.430929 http: response.Write on hijacked connection from fmt.Fprintln (print.go:305)
2025/01/22 06:22:30.812348 L_WARN client:253771 Failed to parse localaddr for upstream connection "[::1]"
2025/01/22 06:22:46.163853 L_WARN client:253772 Failed to parse localaddr for upstream connection "[::1]"

Unsure if both the parse errors and the "hijacked connection" messages are related to each other.

Possible relevant configuration settings of note are probably these:

[upstream.1]
hostname = "[::1]"
localaddr = "[::1]"
@ItsOnlyBinary
Copy link
Collaborator

setting localaddr = "::1" will fix Failed to parse localaddr for upstream connection (you could also leave empty and let it pick its own bind address)

The write on hijacked connection is something trying to write to the http connection after it has been upgraded to a websocket. If this still happens after changing localaddr please enable debug mode logLevel = 1 and get me a more detailed log of that happening as I've been unable to reproduce that issue.

@Robby-
Copy link
Author

Robby- commented Jan 24, 2025

Hi, thank you, setting it to "::1" indeed fixed it.

As for the hijacked connection messages, they indeed still happen:

2025/01/24 04:39:35.840019 http: response.WriteHeader on hijacked connection from github.com/igm/sockjs-go/v3/sockjs.(*Handler).sockjsWebsocket (websocket.go:53)
2025/01/24 04:39:35.840165 http: response.Write on hijacked connection from fmt.Fprintln (print.go:305)
2025/01/24 04:39:35.840328 L_DEBUG kiwi connection closed (sockjs: session not in open state)
2025/01/24 04:39:35.840794 L_DEBUG client:269304 StartShutdown(client_closed) ShuttingDown=false
2025/01/24 04:39:35.840832 L_INFO client:269304 Client disconnected
2025/01/24 04:39:35.840851 L_INFO client:269304 Removing channel from connection
2025/01/24 04:39:35.840870 L_DEBUG client:269304 client.Recv closed
2025/01/24 04:39:35.840888 L_DEBUG client:269304 Traffic (->Upstream) QUIT :leaving
2025/01/24 04:39:35.840906 L_DEBUG client:269304 StartShutdown(client_closed) ShuttingDown=true
2025/01/24 04:39:35.841040 L_DEBUG client:269304 leaving clientLineWorker

I was able to pinpoint this to it happening only when people disconnect/quit, as the debug log above shows.

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