bitlbee / bitlbee-facebook

Facebook protocol plugin for BitlBee
GNU General Public License v2.0
279 stars 49 forks source link

Can't connect to facebook anymore: Failed to read fixed header #175

Closed CryptoSiD closed 5 years ago

CryptoSiD commented 5 years ago

I'm having this issue since 3 days or so. Am I the only one?

BitlBee 3.5.1+20181003+develop+79-g8813282-git

I was using bitlbee-facebook compiled from source and had the issue then I tried the .deb, installed from bitlbee repo, and same issue.

strace while connecting to facebook: http://dpaste.com/16HPC7G

I'm using the same server for ZNC and many other services, there is no issue with the network. If you need anything to debug the issue please let me know.

[16:05:38] (@bitlbee): facebook2 - Logging in: Connecting [16:05:38] (@bitlbee): facebook2 - Login error: Failed to read fixed header [16:05:38] (@bitlbee): facebook2 - Logging in: Signing off.. [16:05:39] (@bitlbee): facebook2 - Logging in: Reconnecting in 15 seconds.. [16:05:39] (@bitlbee): facebook - Logging in: Connecting [16:05:39] (@bitlbee): facebook - Login error: Failed to read fixed header [16:05:39] (@bitlbee): facebook - Logging in: Signing off.. [16:05:39] (@bitlbee): facebook - Logging in: Reconnecting in 15 seconds.. [16:05:53] (@bitlbee): facebook2 - Logging in: Fetching contacts [16:05:54] (@bitlbee): facebook - Logging in: Fetching contacts [16:05:55] (@bitlbee): facebook2 - Logging in: Connecting [16:05:55] (@bitlbee): facebook - Logging in: Connecting [16:05:55] (@bitlbee): facebook2 - Login error: Failed to read fixed header [16:05:55] (@bitlbee): facebook2 - Logging in: Signing off.. [16:05:55] (@bitlbee): facebook2 - Logging in: Reconnecting in 45 seconds.. [16:05:55] (@bitlbee): facebook - Login error: Failed to read fixed header [16:05:55] (@bitlbee): facebook - Logging in: Signing off.. [16:05:55] (@bitlbee): facebook - Logging in: Reconnecting in 45 seconds..

CryptoSiD commented 5 years ago

It look like I'm the only one?

fejjj commented 5 years ago

i have it too, after upgrading to ubuntu cosmic sunday night

fejjj commented 5 years ago

i have it too, after upgrading to ubuntu cosmic sunday night

BTW, @CryptoSiD how'd you add the repo?

CryptoSiD commented 5 years ago

I created /etc/apt/sources.list.d/bitlbee.list with "deb https://code.bitlbee.org/debian/develop/bionic/amd64/ ./" inside.

I use apt as I would do to install any package.

It look like the issue is related to 18.10 (cosmic) since I'm also on it... however it was working perfectly approximately 3-4 days before I opened this issue and I was already on cosmic.

fejjj commented 5 years ago

it does indeed seem related to 18.10. i went back to 18.04.1 and installed from the same repositories and bitlbee-facebook works again.

On Mon, Oct 29, 2018 at 5:13 PM CryptoSiD notifications@github.com wrote:

I created /etc/apt/sources.list.d/bitlbee.list with "deb https://code.bitlbee.org/debian/develop/bionic/amd64/ ./" inside.

I use apt as I would do to install any package.

It look like the issue is related to 18.10 (cosmic) since I'm also on it... however it was working perfectly approximately 3-4 days before I opened this issue.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bitlbee/bitlbee-facebook/issues/175#issuecomment-434100568, or mute the thread https://github.com/notifications/unsubscribe-auth/AlQrijyWSZIA1UYjkiwsQJ0PljshOaHQks5up32OgaJpZM4Xdh7Q .

AdrianKoshka commented 5 years ago

I upgraded to Fedora29, Seems I've encountered this issue as well.

dgw commented 5 years ago

It's interesting. My BitlBee server is still on Ubuntu 12.04 (I know…) and I've seen this a couple times after it gets disconnected. But another reconnection attempt always succeeds, so it might be a different thing.

CryptoSiD commented 5 years ago

Could this be related to this https://github.com/dequis/purple-facebook/issues/410 ?

arfy8820 commented 5 years ago

I would have to think it is. I recently had an ArchLinux upgrade where gnutls was updated from 3.5.19 to 3.6.5. I've been trying to figure out since why bitlbee-facebook was still working perfectly fine under FreeBSD but not arch, I think this may be the reason. FreeBSD is still using gnutls 3.5.19. For now.

CryptoSiD commented 5 years ago

I would have to think it is. I recently had an ArchLinux upgrade where gnutls was updated from 3.5.19 to 3.6.5. I've been trying to figure out since why bitlbee-facebook was still working perfectly fine under FreeBSD but not arch, I think this may be the reason. FreeBSD is still using gnutls 3.5.19. For now.

It make sens. The version of gnutls on Ubuntu 18.10 is 3.6.4. I have a debian with Gnutls 3.5.9, I'm going to test tomorrow if bitlbee facebook work fine on this version. If it's the case then the issue is most likely related gnutls 3.6.0+

zer0def commented 5 years ago

Can confirm downgrading gnutls 3.6.5-1 → 3.5.19-2 on Arch mitigates this issue.

CryptoSiD commented 5 years ago

Hopefully the dev(s) know how to fix this. Unfortunately I'm just a noob :)

nath1as commented 5 years ago

I have the same issue after updating arch.

mikroskeem commented 5 years ago

This happens for me as well.

akorn commented 5 years ago

I was able to workaround this by rebuilding the libgnutls30 package with --with-default-priority-string=@SYSTEM added to the configure command line, and creating /etc/gnutls/default-priorities with the following contents:

SYSTEM=NORMAL:-VERS-SSL3.0:-VERS-TLS1.3:-VERS-TLS1.0:-VERS-DTLS1.0:-SHA1:-SIGN-RSA-SHA1:-SIGN-ECDSA-SHA1

(The problem is that GnuTLS and Facebook don't see eye to eye using TLS1.3. Disabling TLS1.3 is a workaround, but I found no other way to do it, because bitlbee doesn't allow you to customize cipher priorities via configuration.)

dequis commented 5 years ago

Sorry for the delay handling this. I still can't reproduce the issue (arch linux here too) but this commit from the 'development' branch is very likely to fix the issue: https://github.com/bitlbee/bitlbee-facebook/commit/4fb29aabac3c78d88a99bbcd3396fc91e33f597a - so please checkout that branch and build that.

mikroskeem commented 5 years ago

I'm still experiencing the issue

Edit: I tried commit 4fb29aabac3c78d88a99bbcd3396fc91e33f597a

dequis commented 5 years ago

Hm. Please ensure bitlbee is fully restarted (restarting daemon and reconnecting client is usually enough, otherwise kill all processes and start it again). Shame about the change being small enough that there's no other way to tell it's running the new code...

mikroskeem commented 5 years ago

... Killing the bitlbee and starting it again is truly obvious. Can I get an easy way to make this facebook module dump all debugging data? That's maybe the data that could be helpful to you.

EDIT: phone keyboard sucks ass.

dequis commented 5 years ago

You'd think so, but not properly restarting bitlbee after upgrades is an extremely common issue, doesn't hurt to check for it.

Debugging instructions at https://wiki.bitlbee.org/Debugging - I don't really expect a whole lot out of it though, the thing is failing at the socket read level which this debug doesn't have a lot of information about.

mikroskeem commented 5 years ago

I've noticed before that bitlbee won't even stop properly using default systemd service, so I am confident that I've actually restarted it.

Speaking about debug logging, I managed to capture a huge log which unfortunately contains a huge amount of personal information. I guess I'm going to strip out everything sensituve and keep only relevant.

CryptoSiD commented 5 years ago

Here's the debug log: removed since it's unsafe

I removed the sensible parts, hopefully you won't need anything in this, it seemed to only list my facebook contacts.

dequis commented 5 years ago

Some access tokens in there, to be safe remove the relevant session (or all of them) from https://www.facebook.com/settings?tab=security&section=sessions&view

Sorry, I should probably have specified that posting them publicly is not a good idea, for purple-facebook i ask people to email the thing: https://github.com/dequis/purple-facebook/wiki/Debugging-Logs

And, yeah, that log wasn't very informative i'm afraid :(

CryptoSiD commented 5 years ago

Thanks for letting me know, I deleted all sessions :)

I removed a huge part of the logs, could it be helpful to have it? It seemed useless to me but I'm just a noob :)

mikroskeem commented 5 years ago

Yeah forgot to mention that this log is amazingly annoying to clear from sensitive info.

---- On Wed, 02 Jan 2019 22:47:58 +0000 notifications@github.com wrote ----

Some access tokens in there, to be safe remove the relevant session (or all of them) from https://www.facebook.com/settings?tab=security&section=sessions&view

Sorry, I should probably have specified that posting them publicly is not a good idea, for purple-facebook i ask people to email the thing: https://github.com/dequis/purple-facebook/wiki/Debugging-Logs

And, yeah, that log wasn't very informative i'm afraid :(

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

dequis commented 5 years ago

Okay I can now reproduce this thing (not very reliably but often enough) so I pushed c612d255ec7c2699aef70b6eab10920a914c313d to both master/development branches, fixes the thing for me.

(Now to look into the other bugs that people started reporting recently, which may or may not affect you.)

CryptoSiD commented 5 years ago

Thanks a lot!

mikroskeem commented 5 years ago

c612d25 fixed issue for me, I can chat again now.

ChrisLane commented 5 years ago

Fixed for me too.

dequis commented 5 years ago

Released v1.2.0 with the fix for this

Note that the general error ("Failed to read fixed header") has many other causes unrelated to this issue so it might still appear here in the future.

If you're using v1.2.0 or higher and this happens (and it's not a network connectivity issue), please open another issue instead of adding comments here.