Reconnecting to PubSub crashes the bot
Opened this issue · 1 comments
zneix commented
Running (4e61221@master go1.17.4 built 2021-12-06T16:30:41+01:00)
Dec 15 17:46:17 shungite pajbot2[287959]: 2021/12/15 17:46:17 Channel zneixbot initialized successfully
Dec 15 17:46:17 shungite pajbot2[287959]: 2021/12/15 17:46:17 Channel zneix initialized successfully
Dec 15 17:48:06 shungite pajbot2[287959]: [go-twitch-pubsub] Lost connection, will try to reconnect
Dec 15 18:13:37 shungite pajbot2[287959]: panic: concurrent write to websocket connection
Dec 15 18:13:37 shungite pajbot2[287959]: goroutine 1028817 [running]:
Dec 15 18:13:38 shungite pajbot2[287959]: github.com/gorilla/websocket.(*messageWriter).flushFrame(0xc000ffb2c0, 0x1, {0x0, 0x7f4981dcb5b8, 0x0})
Dec 15 18:13:38 shungite pajbot2[287959]: /opt/pajbot/go/pkg/mod/github.com/gorilla/websocket@v1.4.2/conn.go:610 +0x52b
Dec 15 18:13:38 shungite pajbot2[287959]: github.com/gorilla/websocket.(*messageWriter).Close(0x0)
Dec 15 18:13:38 shungite pajbot2[287959]: /opt/pajbot/go/pkg/mod/github.com/gorilla/websocket@v1.4.2/conn.go:724 +0x45
Dec 15 18:13:38 shungite pajbot2[287959]: github.com/gorilla/websocket.(*Conn).beginMessage(0xc000e4b340, 0xc003b6c270, 0x1)
Dec 15 18:13:38 shungite pajbot2[287959]: /opt/pajbot/go/pkg/mod/github.com/gorilla/websocket@v1.4.2/conn.go:473 +0x42
Dec 15 18:13:38 shungite pajbot2[287959]: github.com/gorilla/websocket.(*Conn).NextWriter(0xc000e4b340, 0x1)
Dec 15 18:13:38 shungite pajbot2[287959]: /opt/pajbot/go/pkg/mod/github.com/gorilla/websocket@v1.4.2/conn.go:513 +0x45
Dec 15 18:13:38 shungite pajbot2[287959]: github.com/gorilla/websocket.(*Conn).WriteMessage(0xc00004bf98, 0xc00004bf78, {0xc002696810, 0x0, 0x9d3d01})
Dec 15 18:13:38 shungite pajbot2[287959]: /opt/pajbot/go/pkg/mod/github.com/gorilla/websocket@v1.4.2/conn.go:766 +0x165
Dec 15 18:13:38 shungite pajbot2[287959]: github.com/pajlada/go-twitch-pubsub.(*connection).startWriter(0xc000e6f290)
Dec 15 18:13:38 shungite pajbot2[287959]: /opt/pajbot/go/pkg/mod/github.com/pajlada/go-twitch-pubsub@v0.0.0-20190525183000-d70aff1c5c71/connection.go:220 +0x47
Dec 15 18:13:38 shungite pajbot2[287959]: created by github.com/pajlada/go-twitch-pubsub.(*connection).connect
Dec 15 18:13:38 shungite pajbot2[287959]: /opt/pajbot/go/pkg/mod/github.com/pajlada/go-twitch-pubsub@v0.0.0-20190525183000-d70aff1c5c71/connection.go:190 +0xfd
Dec 15 18:13:38 shungite systemd[1]: pajbot2.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Dec 15 18:13:38 shungite systemd[1]: pajbot2.service: Failed with result 'exit-code'.
Dec 15 18:13:38 shungite systemd[1]: pajbot2.service: Consumed 13min 22.885s CPU time.
Dec 15 18:13:40 shungite systemd[1]: pajbot2.service: Scheduled restart job, restart counter is at 2.
Dec 15 18:13:40 shungite systemd[1]: Stopped pajbot2.
Dec 15 18:13:40 shungite systemd[1]: pajbot2.service: Consumed 13min 22.885s CPU time.
ALazyMeme commented
Same issue:
Dec 16 13:08:51 hendrix start.sh[1211]: [go-twitch-pubsub] Lost connection, will try to reconnect
Dec 16 13:09:34 hendrix start.sh[1211]: panic: concurrent write to websocket connection
Dec 16 13:09:34 hendrix start.sh[1211]: goroutine 2418802 [running]:
Dec 16 13:09:34 hendrix start.sh[1211]: github.com/gorilla/websocket.(*messageWriter).flushFrame(0xc001cb7dd0, 0x44fe01, 0x0, 0x0, 0x0, 0x7feb66bcca68, 0x30)
Dec 16 13:09:34 hendrix start.sh[1211]: /home/pajbot/go/pkg/mod/github.com/gorilla/websocket@v1.4.2/conn.go:610 +0x62e
Dec 16 13:09:34 hendrix start.sh[1211]: github.com/gorilla/websocket.(*messageWriter).Close(0xc001cb7dd0, 0x0, 0xc001cbfe60)
Dec 16 13:09:34 hendrix start.sh[1211]: /home/pajbot/go/pkg/mod/github.com/gorilla/websocket@v1.4.2/conn.go:724 +0x65
Dec 16 13:09:34 hendrix start.sh[1211]: github.com/gorilla/websocket.(*Conn).beginMessage(0xc000828840, 0xc001662840, 0x1, 0x2, 0x2)
Dec 16 13:09:34 hendrix start.sh[1211]: /home/pajbot/go/pkg/mod/github.com/gorilla/websocket@v1.4.2/conn.go:473 +0x262
Dec 16 13:09:34 hendrix start.sh[1211]: github.com/gorilla/websocket.(*Conn).NextWriter(0xc000828840, 0x1, 0xc001a36960, 0xc001a36960, 0xc0015689c0, 0xc001dd2088)
Dec 16 13:09:34 hendrix start.sh[1211]: /home/pajbot/go/pkg/mod/github.com/gorilla/websocket@v1.4.2/conn.go:513 +0x53
Dec 16 13:09:34 hendrix start.sh[1211]: github.com/gorilla/websocket.(*Conn).WriteMessage(0xc000828840, 0x1, 0xc000cf2840, 0xf, 0x10, 0x1, 0x1)
Dec 16 13:09:34 hendrix start.sh[1211]: /home/pajbot/go/pkg/mod/github.com/gorilla/websocket@v1.4.2/conn.go:766 +0x6e
Dec 16 13:09:34 hendrix start.sh[1211]: github.com/pajlada/go-twitch-pubsub.(*connection).startWriter(0xc001a3e5a0)
Dec 16 13:09:34 hendrix start.sh[1211]: /home/pajbot/go/pkg/mod/github.com/pajlada/go-twitch-pubsub@v0.0.0-20190525183000-d70aff1c5c71/connection.go:220 +0x6d
Dec 16 13:09:34 hendrix start.sh[1211]: created by github.com/pajlada/go-twitch-pubsub.(*connection).connect
Dec 16 13:09:34 hendrix start.sh[1211]: /home/pajbot/go/pkg/mod/github.com/pajlada/go-twitch-pubsub@v0.0.0-20190525183000-d70aff1c5c71/connection.go:190 +0x10c
Dec 16 13:09:34 hendrix systemd[1]: pajbot2.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Dec 16 13:09:34 hendrix systemd[1]: pajbot2.service: Failed with result 'exit-code'.
Dec 16 13:09:36 hendrix systemd[1]: pajbot2.service: Scheduled restart job, restart counter is at 2.
Dec 16 13:09:36 hendrix systemd[1]: Stopped pajbot2.