# Many errors in logs- "websocket.NextReader: closing websocket"

**URL:** <https://forum.mattermost.com/t/many-errors-in-logs-websocket-nextreader-closing-websocket/14335>\
**Category:** Troubleshooting\
**Created:** [October 27, 2022, 12:36pm UTC](https://forum.mattermost.com/t/many-errors-in-logs-websocket-nextreader-closing-websocket/14335 "2022-10-27T12:36:55Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![KakEgorka](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/kakegorka/32/6015_2.png) [@KakEgorka](https://forum.mattermost.com/u/KakEgorka)\
**Post date:** [October 27, 2022, 12:36pm UTC](https://forum.mattermost.com/t/many-errors-in-logs-websocket-nextreader-closing-websocket/14335/1 "2022-10-27T12:36:55Z")

</div>

We face many entries in logs with errors:  
`{"timestamp":"2022-10-26 14:04:59.515 +05:00","level":"error","msg":"websocket.NextReader: closing websocket","caller":"app/web_conn.go:830","user_id":"grfze6dkeb8bige7737ibojecr","error":"read tcp 127.0.0.1:8065->127.0.0.2:33418: i/o timeout"}`  
Overwise, Mattermost works normally at this time. Maybe, you knows what errors or bugs can triggers such entries in system log?

---

<div class="post-metadata">

**Author:** ![TI-Admin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/ti-admin/32/4272_2.png) [@TI-Admin](https://forum.mattermost.com/u/TI-Admin)\
**Post date:** [October 28, 2022, 10:57am UTC](https://forum.mattermost.com/t/many-errors-in-logs-websocket-nextreader-closing-websocket/14335/2 "2022-10-28T10:57:59Z")

</div>

Hi. I reported this problem a long time ago to support. The feedback was unsatisfactory: It is nor really a bug as long as everything is working fine. For me it should than be flagged as INFO and not as ERROR.

---

<div class="post-metadata">

**Author:** ![agnivade](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agnivade/32/3846_2.png) [@agnivade](https://forum.mattermost.com/u/agnivade)\
**Post date:** [October 28, 2022, 5:03pm UTC](https://forum.mattermost.com/t/many-errors-in-logs-websocket-nextreader-closing-websocket/14335/3 "2022-10-28T17:03:12Z")

</div>

Hey all, from 7.4 onwards, the log level has been changed to DEBUG again. [Revert "Use error log level for websocket timeouts (#19609)" by agnivade · Pull Request #20929 · mattermost/mattermost-server · GitHub](https://github.com/mattermost/mattermost-server/pull/20929)

Please ignore the error for the time being. This can normally happen in a healthy system.

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [October 30, 2022, 8:56am UTC](https://forum.mattermost.com/t/many-errors-in-logs-websocket-nextreader-closing-websocket/14335/4 "2022-10-30T08:56:49Z")

</div>

Awesome, that’s great to hear, thanks @agnivade for this info 🙂

---

<div class="post-metadata">

**Author:** ![KakEgorka](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/kakegorka/32/6015_2.png) [@KakEgorka](https://forum.mattermost.com/u/KakEgorka)\
**Post date:** [December 21, 2022, 4:37am UTC](https://forum.mattermost.com/t/many-errors-in-logs-websocket-nextreader-closing-websocket/14335/5 "2022-12-21T04:37:30Z")

</div>

Hi!  
After updating to 7.4 the error disappeared. But a new one has appeared and there are many of them.

```auto
{"timestamp":"2022-12-21 09:06:46.778 +05:00","level":"warn","msg":"websocket.slow: dropping message","caller":"app/web_conn.go:714","user_id":"8pbho6btcf8w5ydy56tq1yhuoy","type":"channel_viewed"}
{"timestamp":"2022-12-21 09:06:46.931 +05:00","level":"warn","msg":"websocket.slow: dropping message","caller":"app/web_conn.go:714","user_id":"8pbho6btcf8w5ydy56tq1yhuoy","type":"typing"}

```

---

<div class="post-metadata">

**Author:** ![agnivade](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agnivade/32/3846_2.png) [@agnivade](https://forum.mattermost.com/u/agnivade)\
**Post date:** [December 21, 2022, 5:01am UTC](https://forum.mattermost.com/t/many-errors-in-logs-websocket-nextreader-closing-websocket/14335/6 "2022-12-21T05:01:37Z")

</div>

This can happen when your server is generating high amount of traffic. If the websocket queue gets filled up, the server will start dropping low priority messages. This feature was always there since the beginning and hasn’t changed.

If you don’t want typing and channel viewed messages, you can disable `ServiceSettings.EnableUserTypingMessages` and `ServiceSettings.EnableChannelViewedMessages`

---

<div class="post-metadata">

**Author:** ![KakEgorka](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/kakegorka/32/6015_2.png) [@KakEgorka](https://forum.mattermost.com/u/KakEgorka)\
**Post date:** [December 21, 2022, 5:08am UTC](https://forum.mattermost.com/t/many-errors-in-logs-websocket-nextreader-closing-websocket/14335/7 "2022-12-21T05:08:07Z")

</div>

Thank you. Is it possible to somehow increase the throughput of web sockets?

---

<div class="post-metadata">

**Author:** ![agnivade](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agnivade/32/3846_2.png) [@agnivade](https://forum.mattermost.com/u/agnivade)\
**Post date:** [December 21, 2022, 8:41am UTC](https://forum.mattermost.com/t/many-errors-in-logs-websocket-nextreader-closing-websocket/14335/8 "2022-12-21T08:41:21Z")

</div>

The throughput is dictated by server resources and client consumption speed. If the client is slow in consuming the events, the server cannot do much.

One idea could be to increase the number of nodes in your cluster. This will shard traffic across nodes and give more breathing space for your servers. Or alternatively vertically scale up your existing server.

But even then slow clients will clog events for that connection, and server will drop them. But only for that client and not others.
