gliderlabs / gliderlabs/logspout

Panic accessing /logs via websocket

Open
#412 2 comments 3 reactions 0 assignees View on GitHub
type: bug
Dominant language
Go
Stars
4.7k
Forks
661
PR merge metrics
No merged PRs in 30d

Description

First, thanks for the great software :-)

I'm seeing a panic when accessing /logs via a websocket. Here's the stack trace:

```
# logspout v3.2.5 by gliderlabs
# adapters: raw syslog multiline tcp udp tls
# options : persist:/mnt/routes
# jobs : pump routes http[routes,logs]:80
# routes : none
panic: send on closed channel

goroutine 41 [running]:
github.com/gliderlabs/logspout/router.(*containerPump).send(0xc42022f560, 0xc420053280)
/go/src/github.com/gliderlabs/logspout/router/pump.go:384 +0x129
github.com/gliderlabs/logspout/router.newContainerPump.func1(0x5634dbc5087f, 0x6, 0x5634dc174ac0, 0xc42023c060)
/go/src/github.com/gliderlabs/logspout/router/pump.go:364 +0xbc
created by github.com/gliderlabs/logspout/router.newContainerPump
/go/src/github.com/gliderlabs/logspout/router/pump.go:373 +0x174

```

You can reproduce this by running logspout via docker:

docker run -d --name="logspout" --volume=/var/run/docker.sock:/var/run/docker.sock --publish=8000:80 --restart=always gliderlabs/logspout

and then hitting the endpoint with curl:

$ curl -H "Connection: Upgrade" -H "Upgrade: websocket" http://127.0.0.1:8000/logs
mismatch challenge/response

`mismatch challenge/response` is the only output.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in router/pump.go at the reported lines 364 and 384, then reproduce the issue with the Docker command and websocket curl request against /logs. Trace the channel lifecycle around the panic and verify that the reproduction no longer ends with a send-on-closed-channel panic.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.