sm00th / bitlbee-discord

Bitlbee plugin for Discord (http://discordapp.com)
GNU General Public License v2.0
290 stars 27 forks source link

Error: Failed to read data. Causing disconnects every few minutes. #57

Closed zertap closed 7 years ago

zertap commented 7 years ago

This has been going on for about 4-5 hours now. log.txt

Running BitlBee 3.4.2+20160526+master+35-g59a7dc5-git and the newest version of bitlbee-discord.

zertap commented 7 years ago

While connected, sending and receiving messages works just as expected, and the reconnects are without delay.

sm00th commented 7 years ago

Noticed that yesterday as well. At some point it just fails to read the next chunk of data with PREMATURE_TERMINATION error, so discord just closes the connection for some reason. What is more interesting it mostly happens with one of my accounts (I have 2). There was a brief period when both of them reconnected very often, but then one just started doing it way less. Account that is disconnecting a lot has MFA enabled, the other one does not. Is multi-factor-auth enabled on your account?

There are no errors in data stream and nothing that suggests that bitlbee-discord is doing something wrong. So far it looks like some issues on discord's side even though it's been going on for quite some time and they have no issues listed on their status page.

At this point I have no idea on what exactly is going on and how can I fix this, I'll keep an eye on it though and will try to update this issue with any info I get.

zertap commented 7 years ago

I don't have MFA enabled. Certainly interesting, if this is account based.

Sophira commented 7 years ago

I've been getting this quite a lot. I do not have two-factor auth on my account. (I'm thinking of enabling it now that I know the option is there, but for debugging purposes I'm happy to leave it if wanted for debugging this issue.)

sm00th commented 7 years ago

It doesn't seem to matter whether it is on or off, my second account is still getting disconnected, but it happens roughly 5-7 times less frequently than the first one.

zertap commented 7 years ago

God damn. This is getting quite ridiculous. Over 10k lines of log on each channel just from the disconnects in about 6 hours. It seems to vary a bit how bad it is. Sometimes I get 3 or more disconncts within a minute, sometimes none in half an hour.

hjst commented 7 years ago

I'm seeing the same thing here: disconnects with varying frequency that have been going on & off for a few days now. No MFA on my account.

Linkandzelda commented 7 years ago

Wanted to add that I too have this problem for the last couple of days, every few minutes constant disconnections. I don't have MFA either, and it was working fine until a few days ago.

sm00th commented 7 years ago

While 67e693b seems to fix the issue with disconnects it breaks everything else due to api version switch. Please do not update yet.

sm00th commented 7 years ago

As of d4c29da (74e480b in listchan branch) this should be fixed and at least basic functionality should work fine. As mentioned above it involved an API version change so some things might not work properly (for instance backlog doesn't work on master at the moment, but works on listchan)

Sophira commented 7 years ago

It seems to have fixed it for me. So far I haven't noticed anything missing, but then I mainly just use the normal chat functions, so.

Sophira commented 7 years ago

Update: About 40 minutes ago, I had my first (and so far only) "Failed to read data" error since the updated code was installed. I was having these occasional errors since before it became as problematic as this, though, so I expect this might be due to another problem and not this one.

The problem of disconnects happening every few minutes is definitely fixed, though!

sm00th commented 7 years ago

Thanks for testing. The disconnect you experienced might be caused by a network issue or by bitlbee-discord not yet implementing the "forced reconnect" feature. According to the API documentation gateway can send a client a request to reconnect without user noticing and it also says that the gateway may decide to just drop the connection at any time. I'll try to implement it a bit later.

Closing this issue since my testing also shows that is pretty much stable.