alexemanuelol / rustplusplus

A NodeJS Discord Bot that uses the rustplus.js library to utilize the power of the Rust+ Companion App with additional Quality-of-Life features.
GNU General Public License v3.0
198 stars 99 forks source link

Bot loses connection when Rust Server restarts #69

Closed fakerli closed 1 year ago

fakerli commented 2 years ago

My server restarts every morning. The bot won't reconnect on its own so I have to manually click on disconnect and connect in discord. Screenshot_20220907-122323

alexemanuelol commented 2 years ago

Can you see from the console what it says when it disconnects?

fakerli commented 1 year ago

{"level":"info","message":"2022-9-08 04:00:02 | 1013878657959350352 | [EU|GERMAN] Rust Beginner-Survival [Low Decay] just wiped | DISCONNECTED: RUSTPLUS DISCONNECTED"} {"level":"info","message":"2022-9-08 04:00:02 | 1013878657959350352 | [EU|GERMAN] Rust Beginner-Survival [Low Decay] just wiped | RECONNECTING: RUSTPLUS RECONNECTING"} {"level":"info","message":"2022-9-08 04:00:02 | 1013878657959350352 | [EU|GERMAN] Rust Beginner-Survival [Low Decay] just wiped | CONNECTING: RUSTPLUS CONNECTING..."} {"level":"error","message":"2022-9-08 04:00:02 | 1013878657959350352 | [EU|GERMAN] Rust Beginner-Survival [Low Decay] just wiped | ERROR: Connection refused to: xx.yy.zz:28082."}

alexemanuelol commented 1 year ago

xx.yy.zz:28082 looks like an interesting address that it is trying to connect to... If you look in the file src/instances/939872692846.json, what does it say at serverList?

fakerli commented 1 year ago

There was the ip. I put the xx.yy. there (in the logs)

alexemanuelol commented 1 year ago

There was the ip. I put the xx.yy. there

The IP of the server is displayed there. Not sure why it won't reconnect. Does it just stop trying there or does it continue trying to reconnect?

fakerli commented 1 year ago

It stops trying until I reconnect manually via Discord.

alexemanuelol commented 1 year ago

146878770672828416.log log

@C74K You can try the reconnect_failed branch, run the following: git fetch --all git stash git checkout origin/reconnect_failed git stash pop

fakerli commented 1 year ago

testing

Does it work?

craftycorvid commented 1 year ago

I'm also seeing this issue on the server I play on. Server reboots nightly, rustPlusPlus tries to reconnected a bunch of times(but it seems like there's barely a pause between re-connection attempts) then gives up. Won't reconnect unless you manually hit the Connect button.

Maybe doing an exponential backoff retry for connection attempts would solve this issue?



2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins RECONNECTING: RECONNECTING TO SERVER...

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins CONNECTING: CONNECTING TO SERVER...

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: Error: WebSocket was closed before the connection was established

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: WebSocket was closed before the connection was established.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins DISCONNECTED: DISCONNECTED FROM SERVER.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins RECONNECTING: RECONNECTING TO SERVER...

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins CONNECTING: CONNECTING TO SERVER...

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: Error: WebSocket was closed before the connection was established

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: WebSocket was closed before the connection was established.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins DISCONNECTED: DISCONNECTED FROM SERVER.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins RECONNECTING: RECONNECTING TO SERVER...

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins CONNECTING: CONNECTING TO SERVER...

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: Error: WebSocket was closed before the connection was established

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: WebSocket was closed before the connection was established.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins DISCONNECTED: DISCONNECTED FROM SERVER.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins RECONNECTING: RECONNECTING TO SERVER...

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins CONNECTING: CONNECTING TO SERVER...

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: Error: WebSocket was closed before the connection was established

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: WebSocket was closed before the connection was established.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins DISCONNECTED: DISCONNECTED FROM SERVER.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins RECONNECTING: RECONNECTING TO SERVER...

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins CONNECTING: CONNECTING TO SERVER...

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: Error: WebSocket was closed before the connection was established

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: WebSocket was closed before the connection was established.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins DISCONNECTED: DISCONNECTED FROM SERVER.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins RECONNECTING: RECONNECTING TO SERVER...

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins CONNECTING: CONNECTING TO SERVER...

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: Error: WebSocket was closed before the connection was established

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: WebSocket was closed before the connection was established.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins DISCONNECTED: DISCONNECTED FROM SERVER.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins RECONNECTING: RECONNECTING TO SERVER...

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins CONNECTING: CONNECTING TO SERVER...

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: Error: WebSocket was closed before the connection was established

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: WebSocket was closed before the connection was established.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins DISCONNECTED: DISCONNECTED FROM SERVER.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins RECONNECTING: RECONNECTING TO SERVER...

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins CONNECTING: CONNECTING TO SERVER...

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: Error: WebSocket was closed before the connection was established

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: WebSocket was closed before the connection was established.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins DISCONNECTED: DISCONNECTED FROM SERVER.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins RECONNECTING: RECONNECTING TO SERVER...

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins CONNECTING: CONNECTING TO SERVER...

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: Error: WebSocket was closed before the connection was established

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: WebSocket was closed before the connection was established.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins DISCONNECTED: DISCONNECTED FROM SERVER.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins RECONNECTING: RECONNECTING TO SERVER...

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins CONNECTING: CONNECTING TO SERVER...

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: Error: WebSocket was closed before the connection was established

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: WebSocket was closed before the connection was established.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins DISCONNECTED: DISCONNECTED FROM SERVER.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins RECONNECTING: RECONNECTING TO SERVER...

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins CONNECTING: CONNECTING TO SERVER...

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: Error: WebSocket was closed before the connection was established

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: WebSocket was closed before the connection was established.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins DISCONNECTED: DISCONNECTED FROM SERVER.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins RECONNECTING: RECONNECTING TO SERVER...

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: Response contain error property with value: Tokens did not replenish in time..

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: Something went wrong with connection.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins CONNECTING: CONNECTING TO SERVER...

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: Error: WebSocket was closed before the connection was established

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: WebSocket was closed before the connection was established.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins DISCONNECTED: DISCONNECTED FROM SERVER.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins CONNECTING: CONNECTING TO SERVER...

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: Error: WebSocket was closed before the connection was established

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: WebSocket was closed before the connection was established.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins DISCONNECTED: DISCONNECTED FROM SERVER.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins CONNECTING: CONNECTING TO SERVER...

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: Error: WebSocket was closed before the connection was established

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: WebSocket was closed before the connection was established.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins DISCONNECTED: DISCONNECTED FROM SERVER.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins CONNECTED: CONNECTED TO SERVER.

2022-10-18 14:09:48 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins DISCONNECTED: DISCONNECTED FROM SERVER.

2022-10-18 14:10:18 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: Response contain error property with value: Tokens did not replenish in time..

2022-10-18 14:10:18 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: Something went wrong with connection.

2022-10-18 14:10:56 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: Timeout reached while waiting for response.

2022-10-18 14:10:56 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: Something went wrong with connection.

2022-10-18 14:10:56 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: Timeout reached while waiting for response.

2022-10-18 14:10:56 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: Something went wrong with connection.

2022-10-18 14:11:16 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: Timeout reached while waiting for response.

2022-10-18 14:11:16 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: Something went wrong with connection.

2022-10-18 14:11:47 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: Timeout reached while waiting for response.

2022-10-18 14:11:47 671925471218368552 PICKLE VANILLA MONTHLY | No BP Wipe | Active Admins ERROR: Something went wrong with connection.```
alexemanuelol commented 1 year ago

I've created a branch reconnect_issue where you can test to see if it still happens @fakerli @CraftyCorvid

alexemanuelol commented 1 year ago

Fixed in: d2e672ddd1f793b2f0f04822f137f44c6be0f46a