bitlbee/bitlbee-facebook

Login error: Null value for $.viewer.message_threads.sync_sequence_id

Opened this issue ยท 48 comments

ADMIN EDIT

This is already fixed in the latest release. This ticket is only open for visibility

Release notes: https://github.com/bitlbee/bitlbee-facebook/releases


Original ticket description

Got an Error: Failed to send message this morning and got disconnected from Facebook, and now I'm getting a Login error: Null value for $.viewer.message_threads.sync_sequence_id every time BitlBee reconnects to Facebook.

Yeah, I'm currently getting this issue too.

same here. cant login because of it. seems like something has changed.

I suspect this has something to do with Facebook dropping support for ancient versions of Messenger: https://messengerblog.com/general-messenger/update-on-support-for-older-versions-of-messenger-and-facebook-apps/

dup #130

NOT a dup of #130. This message is NOT transient - it is a permanent error. something has changed server side, and this plugin won't work unless a workaround is enacted. Linking a closed bug and calling it a dup because the symptom is superficially the same is not helpful as it creates the impression the bug reports are invalid - there is a genuine issue here and it has been triggered by a serverside change which is why it's appearing in both implementations as per dequis/purple-facebook#306

@exitdown: I accept that the original issue refers to a transient bug. However, I mildly disagree that bringing up a closed bug is not useful: similar prior issues may still be of relevance and providing some link to with associated information ensures there's more information available now, and there's continuity in the treatment. (I also note that dequis/purple-facebook#179 was brought up similarly.)

@jashank yes - if you had added some context to that effect your point is valid - however by simply posting a "dup" with no context most people would read it as dismissive of the issue - which is why i made it clear in my subsequent post that it was not a dupe of that previously closed bug :) either way,hopefully now its obvious there's an issue here's hoping the protocol modifications are relatively easy so we can all get back to using this excellent software :)

well, fuck.

Fix 9390579

I'll prepare a release shortly.

edit nevermind see below

[INFO] facebook: Parsing JSON: {"succeeded":false,"msgid":6252783076008029414,"errno":1545075,"errStr":"This app version no longer supports messaging. To continue to send and receive messages, please update your app to a newer version or use the mobile web version of Facebook.","isRetryable":false}

fuck

At least this issue is something I predicted that could happen, but was hoping it wouldn't. The /send_message2 mqtt topic (that we use to send json messages instead of thrift) is very old.

Bad news is that I'll have to implement the newer, more complex one right now.

Good news is that we'll get stickers.

thank you for your efforts dequis!

Yes, thanks dequis! Been using the plugin for a while now and really appreciate it :)

I tried the new plugin and now I get "Arguments are invalid"

Same here, but I think that's what dequis was saying about having to implement complex stuff

I can confirm this issue as well

Edit:

Maybe this should be opened as new issue?

I installed the latest commit: 201703299390579279
Now I can login again. However, I can only receive messages, not send. When I send I get this in the &bitlbee buffer:

@root | facebook - Logging in: Fetching contacts
@root | facebook - Logging in: Connecting
@root | facebook - Logging in: Logged in
@root | facebook - Error: Failed to send message
@root | facebook - Signing off..
@root | facebook - Reconnecting in 5 seconds..
@root | facebook - Logging in: Fetching contacts
@root | facebook - Logging in: Connecting
@root | facebook - Logging in: Logged in

@malinkb read up

Please try latest master.

1629e2f fixes message sending - turned out to be just a boring "set user agent version" thing. The old-style /send_message2 message sending is still used by supported versions of the official app, and for the sake of not breaking more than needed now, I'm not changing it.

93a62d3 fixes invalid arguments errors when fetching channel lists.

edit: nope nevermind not yet

And af132a8 fixes a last minute bug. You can test it now.

Thanks dequis, currently being an idiot and failing to work out how to install it, but that's just me

Builds should appear in the package repos shortly: https://build.opensuse.org/package/show/home:jgeboski/bitlbee-facebook

edit: done

Thanks for such a fast fix & package!

Works now. Thanks for fast fix :)

Ping @spwhitton, this may be worth uploading to debian, too.

gahr commented

@dequis Are you planning tagging a new release soon?

Yeah I'll prepare the long overdue 1.1.0 release now.

Here's a long-form explanation of what happened here:

As others suggested, https://messengerblog.com/general-messenger/update-on-support-for-older-versions-of-messenger-and-facebook-apps/ is indeed relevant. They deploy to production on tuesdays which is when it broke.

I was aware of this, but, as far as I knew, nothing needed updating, because it says that versions older than 5 will be discontinued but we're compatible up to version 38, mostly. I suspected the /send_message2 method might go away, or that the "MQIsdp" connections would break (the latter are only used by the oldest bitlbee-versions). But neither of those were issues, as they seem to be used by versions newer than 5 (I tested 14 and 38 today)

Versioning in facebook is complicated, which is both good and bad. Good because it allows them to have excellent backwards compatibility (as far as they want to keep it). Bad because it's hard to understand where to draw the line on what a version means.

There were two fixes:

  1. The graphql query hash to get the sequence id. Those hashes represent a textual graphql query stored in the server, and those queries are basically a way to tell the server "pick these fields from this deeply nested structure and return them with this other structure". We don't know what the exact query is, we just know the arguments and the result. Well, we don't exactly know the arguments, as evidenced by those errors some people got today. But they are discoverable with some effort.

    So my best guess is that something in the underlying structure of the facebook graph API changed to stop supporting old clients (likely not directly related), and this means that the field that was accessed by the old hash was no longer there. The newer hash checks a different location, or filters it differently, or who knows what, but manages to access that field successfully. It also has different arguments so I'm only using it for the sync sequence number for now, while thread listing uses the other query, because everything else just works.

  2. The version string in the MQTT CONNECT message. This was a surprise because it was previously empty and just worked, but it's how they chose to stop old versions from sending messages. I think that was the only intended breakage, and who knows, maybe the other issue is a bug that facebook should fix. Heh. Our code also likes to disconnect too easily on almost all errors, which seems to be a successful strategy overall.

Not too bad overall. Next time we won't have the surprise version check since we're sending a version exactly where they expect it. Also, I'm happy with the approach they've taken to deprecate very old versions. This announcement sounds like they are committing to 3 years or so of support for old versions, which sounds great.

EDIT: I should mention, the graphql hash for the first (and most important) fix was found by @EionRobb, go thank him too.

(keeping this open for visibility)

You're awesome, @dequis!

Thanks for the quick fix @dequis. I tipped you some btc.

Hi guys! It would be awesome to get a new debian-package as well... Do you think it's possible? Awesome response time on the patch! :) ๐Ÿ‘

The builds in https://build.opensuse.org/package/show/home:jgeboski/bitlbee-facebook happen automatically a few minutes after each commit.

Aha. Sorry - Did not know that one. :) Thanks mate! Great!

I just realized I had a problem and it's already fixed ๐Ÿ‘

Do I have to recreate the facebook account in bitlbee for this fix? I tried updating to 20170402~41382c1~288 while keeping the old config files, but I'm still getting the error when connecting to the facebook account.

Recreating accounts is not needed. You do need to restart the bitlbee daemon and reconnect your irc client.

lew1s commented

I am still having this issue. Can you somebody give me clear suggestion?

@lew1s did you

  1. update bitlbee-facebook to latest git revision
  2. restart bitblee daemon
  3. /reconnect your IRC client to the bitlbee server?

If so, please open an issue with a bit more debug info, because this specific issue seems to be fixed for most people on this thread.

@lew1s The issue was persisting for me too after following the above steps, and even after a complete reboot.

I was using the latest ubuntu 16.04 apt package of bitlbee (3.4.2), but I guess that was too old for this fix. I upgraded to 3.5.1+20170130+master+0-g262a82b-git using the packages from https://wiki.bitlbee.org/Packages. For 16.04, add deb http://code.bitlbee.org/debian/master/xenial/amd64/ ./ to your /etc/apt/sources.list.

@thallada "was"? does it still not work?

Check that you're using the right bitlbee version with /ctcp root version and check that you're using the right plugin version with the plugins command (available in bitlbee 3.5+)

@dequis sorry for not being clear. Upgrading to 3.5.1 fixed the issue for me.

lew1s commented

I am on windows and dont know where to update bitlbee-facebook. Is there some guide for windoes?

@lew1s Are you sure you're not using purple-facebook instead? https://github.com/dequis/purple-facebook/wiki/Installing-on-Windows

I mean, bitlbee doesn't really support windows, except through cygwin. If you use cygwin the same installation methods in the README apply.

I installed puple-facebook from the repo but I am still getting the error.

@JR1994 This is bitlbee-facebook, not purple-facebook.

I'm locking this thread since this is resolved.

If anyone has any issues please open a new issue instead.