Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to reconnect/reopen client #34

Open
dzonimn opened this issue Apr 3, 2021 · 1 comment
Open

Unable to reconnect/reopen client #34

dzonimn opened this issue Apr 3, 2021 · 1 comment

Comments

@dzonimn
Copy link

dzonimn commented Apr 3, 2021

I have been talking with @tk3369 about my bot always losing a connection to Discord at some point and I implemented his error handling fix in #32, which alleviated the situation. However it always fails to reconnect at some point.

We discussed the idea of turning on all debug messages to catch what it is doing when it calls

open(c; resume=resume)
and after 3 days of uptime I managed to capture some results: botdebugoutput.txt

The output is rather verbose, so I should annotate what is going on:

  • Ignore the beginning errors, those usually pop up because the script does not run fast enough due to precompilation, but the bot works fine despite all of that. (Still, maybe I could be mistaken and perhaps it is somehow affecting this whole issue.)
  • Ignore most of the Info messages except for the ones with the message Going to reopen and Reopened. Those are @info tags sandwiching the aforementioned open(c; resume=resume) line.
  • These are all the lines where it reopens and successfully reopens. Perhaps something relevant or of interest is that a tasks_pending list starts to get larger and larger over time.
176-228, 254-299, 336-393, 418-475, 510-567, 602-659, 705-748, 783-843, 894-954, 983-1030, 1077-1140, 1166-1214, 1245-1311, 1358-1424, 1458-1504, 1535-1604, 1632-1701, 1726-1795, 1820-1889, 1932-1979, 2020-2092, 2131-2203, 2242-2314, 2348-2420, 2454-2502, 2534-2609
  • The last time it reopens and hangs there (bot fails to respond anymore, client object says Discord.Client(shard=1/1, api=6, not logged in) and does not switch to logged in) is at L2642 to the end of the file.

Sorry for the large text file, I would attempt to assist further but I'm really out of my element at the moment. I hope this somehow helps!

@tk3369
Copy link
Contributor

tk3369 commented Apr 14, 2021

By now, for HoJBot, I have seen 2 crashes before. Today, it did not crash but the bot appears to be offline in Discord and it's not handling messages. I checked the console and this is where it last reported anything:

┌ Info: Reconnecting
│   time = 2021-04-14T20:25:41.918
│   conn = 48
│   resume = true
└   zombie = false
┌ Warning: Unable to close existing connection
│   ex = IOError: stream is closed or unusable
└ @ Discord ~/.julia/packages/Discord/ywMY6/src/gateway/gateway.jl:372

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants