Dids / rustbot

A Discord bot that acts as a two-way chat bridge between Discord and Rust (the game), written in Go.
MIT License
2 stars 1 forks source link

Errors in webrcon console (server-side) #15

Open Dids opened 5 years ago

Dids commented 5 years ago

The following error is repeatedly occurring server-side, and it's likely caused by the bot:

01/25/2019 20:03:37|Fatal|<>c__DisplayClass6.<receiveRequest>b__5|WebSocketSharp.WebSocketException: An exception has occurred while reading an HTTP request/response. ---> System.IO.EndOfStreamException: The header cannot be read from the data source.
                            at WebSocketSharp.HttpBase+<>c__DisplayClass1.<readHeaders>b__0 (System.Int32 i) [0x0000c] in <e43fdf6d91f44d8ea7f975577024882c>:0 
                            at WebSocketSharp.Ext.EqualsWith (System.Int32 value, System.Char c, System.Action`1[T] action) [0x00001] in <e43fdf6d91f44d8ea7f975577024882c>:0 
                            at WebSocketSharp.HttpBase.readHeaders (System.IO.Stream stream, System.Int32 maxLength) [0x00031] in <e43fdf6d91f44d8ea7f975577024882c>:0 
                            at WebSocketSharp.HttpBase.Read[T] (System.IO.Stream stream, System.Func`2[T,TResult] parser, System.Int32 millisecondsTimeout) [0x00039] in <e43fdf6d91f44d8ea7f975577024882c>:0 
                             --- End of inner exception stack trace ---
                            at WebSocketSharp.HttpBase.Read[T] (System.IO.Stream stream, System.Func`2[T,TResult] parser, System.Int32 millisecondsTimeout) [0x000ef] in <e43fdf6d91f44d8ea7f975577024882c>:0 
                            at WebSocketSharp.HttpRequest.Read (System.IO.Stream stream, System.Int32 millisecondsTimeout) [0x00001] in <e43fdf6d91f44d8ea7f975577024882c>:0 
                            at WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext..ctor (System.Net.Sockets.TcpClient tcpClient, System.String protocol, System.Boolean secure, WebSocketSharp.Net.ServerSslConfiguration sslConfig, WebSocketSharp.Logger logger) [0x00073] in <e43fdf6d91f44d8ea7f975577024882c>:0 
                            at WebSocketSharp.Ext.GetWebSocketContext (System.Net.Sockets.TcpClient tcpClient, System.String protocol, System.Boolean secure, WebSocketSharp.Net.ServerSslConfiguration sslConfig, WebSocketSharp.Logger logger) [0x00001] in <e43fdf6d91f44d8ea7f975577024882c>:0 
                            at WebSocketSharp.Server.WebSocketServer+<>c__DisplayClass6.<receiveRequest>b__5 (System.Object state) [0x00002] in <e43fdf6d91f44d8ea7f975577024882c>:0
Dids commented 5 years ago

It should also be noted that sometimes the server (gracefully) shuts down after this, after receiving a "stop" signal. It's not 100% confirmed if it is caused by the bot or not, but it is sounding likely.

Another option is that someone's trying to brute force the webrcon port, which is eventually leading to stopping/crashing?

Dids commented 5 years ago

Apparently the Rust server should support SSL now (wss://), but this still needs more testing. There are also new "convars" for setting the SSL certificate and password for the Rust server itself, but I'm hoping to avoid that.