dequis / purple-facebook

Facebook protocol plugin for libpurple (moved from jgeboski/purple-facebook)
GNU General Public License v2.0
954 stars 88 forks source link

Frequent disconnect on new message after some time #496

Closed ghost closed 3 years ago

ghost commented 4 years ago

Starting ~Oct 16, 2020, I've been getting frequent disconnects with the following message: ":1: Parse error: unexpected identifier `taNewMessage', unexpected value"

This seems to be due to a message sent to a chat (group or individual) which has not gotten a message in some time (I think more than ~3 minutes time). Unscientifically, it feels like 80-90% repo in group chats and maybe slightly lower in individual chats. These have been simple text only messages, and they are received just fine when pidgin reconnects a moment later.

I am on pidgin 2.14.1 on windows 10, and the libfacebook.dll I have is timestamped 5-19-2019 (don't think I missed a newer release, apologies if I have).

Let me know if any more info would help. Thanks!

SM0TVI commented 4 years ago

Same here, Windows 10 and latest stable Debian (10 IIRC). Frequent disconnects as above.

[Edit: Pidgin/Purple and FB plugin setup specs, for completeness] Windows 10: Pidgin 2.12.0 (libpurple 2.12.0) Facebook Author: (null) Version: 20190113-0.9.6-0250907-166 Website: https://github.com/dequis/purple-facebook ID String: prpl-facebook Loadable: Yes Loaded: Yes

Debian 10: Pidgin 2.13.0 (libpurple 2.13.0) Facebook Version: 20190113-0.9.6-0250907-166 Website: https://github.com/dequis/purple-facebook ID String: prpl-facebook

jaymzh commented 4 years ago

I was gonna file this exact same bug. :) Linux, Debian unstable. I'll try to grab a debug log when I get a moment.

raidancampbell commented 4 years ago

Cross-linking both ways: this is seen in bitlbee-facebook as well in https://github.com/bitlbee/bitlbee-facebook/issues/200

gtTracy commented 4 years ago

If I were a betting man, I would bet this is related to the recent "integration" of Facebook Messenger and Instagram.... But I'm not a code jockey these days, and I haven't looked deeply into it. Just seems the most likely source for a breakage to come from....

rich-hohm commented 4 years ago

Same here plus same msg for 'taReadReceipt'; Pidgin 2.13.0 under Linux Mint 20.

RangerMauve commented 4 years ago

Seeing this too on Linux.

After a while I started getting disconnected with the error "The action attempted has been deemed abusive or is otherwise disallowed".

Not sure if this is related. It doesn't look like my account was actually banned as the web app / messenger lite still work on my phone and re-enabling works for a few seconds.

jonaburg commented 4 years ago

Seeing this as well: 1:12: Parse error: unexpected identifier `taNewMessage', expected value

baltitenger commented 4 years ago

They seem to have solved the issue at bitlbee, I adapted their fix and submitted a PR: #497

jaymzh commented 4 years ago

I build master after @baltitenger 's PR, but now it disconnects with: Failed to read thrift: api.c:1515 fb_api_cb_publish_mst: assertion 'id == 2' failed

EDIT: I got this twice yesterday but haven't gotten it again since. So I'm going to guess it was an aberration.

EDIT 2: Two more times this evening. So it's a thing. Unclear if it's related to the PR or an entirely orthogonal issue.

MS-Jahan commented 4 years ago

Same issue on Manjaro. Seems Facebook is restricting from their side.

nuxi commented 4 years ago

I build master after @baltitenger 's PR, but now it disconnects with: Failed to read thrift: api.c:1515 fb_api_cb_publish_mst: assertion 'id == 2' failed

EDIT: I got this twice yesterday but haven't gotten it again since. So I'm going to guess it was an aberration.

EDIT 2: Two more times this evening. So it's a thing. Unclear if it's related to the PR or an entirely orthogonal issue.

Yeah, that's my new code. I didn't have a very large sample set of thrift messages to work from when making the patch. (I think I got maybe 6 of them over the span of 3 days) The current code expects one of two formats for the thrift message:

  1. A stop field (0x00)
  2. A string field with ID=2 followed by a stop field.

I based the code on fb_api_cb_publish_pt() which is doing checks on the ID fields, but maybe we don't want to be that picky here. I'd never even heard of the thrift protocol before touching this code, so I am not an expert.

jaymzh commented 4 years ago

@nuxi - let me know what data I can provide to help you.

nuxi commented 4 years ago

@jaymzh I use this copy of this code in bitlbee-facebook, I don't know how to enable debugging in pidgin or what output from it would be.

With bitlbee I just enabled BITLBEE_DEBUG=1 and it spit out the raw hex of everything.

jaymzh commented 4 years ago

@nuxi - I have a log file with the hex dumps of the transactions that failed. I can send them to you, but I don't wanna include them here as it's possible they have sensitive info. However, the stuff leading up- parsed JSON, skipping hex dumps:

(20:15:49) facebook: Writing message (topic: /typing)
(20:15:49) facebook: Reading message (topic: /orca_typing_notifications)
(20:15:49) facebook: Parsing JSON: {"type":"typ","sender_fbid":542789149,"state":0}
(20:15:49) facebook: Reading 3 (flags: 0x2)
(20:15:49) facebook: Writing 4 (flags: 0x0)
(20:15:49) facebook: Reading message (topic: /t_ms)
(20:15:49) connection: Connection error on 0x559b69d77fa0 (reason: 0 description: Failed to read thrift: api.c:1515 fb_api_cb_publish_mst: assertion 'id == 2' failed)

If you wanna give me your email I can send you more stuff.

jaymzh commented 4 years ago

@nuxi - ping? you want the data?

dequis commented 4 years ago

Hey there, got some time this week, feel free to throw something my way.

jaymzh commented 4 years ago

@dequis - sent!

hethhhhh commented 4 years ago

same problem, windows here. frequent disconnects

jaymzh commented 4 years ago

@dequis have you had a chance to look at my debug data at all?

jaymzh commented 3 years ago

As this was becoming unusable I tried just removing the ASSERT that checks id=2. We'll see if that works or blows up miserably. :)

jaymzh commented 3 years ago

FWIW, after removing that ASSERT it's been pretty stable for me. It's probably not the best solution, but at least my connection is mostly stable.

johnchoi8 commented 3 years ago

Any chance of getting an updated full release for this?

johnchoi8 commented 3 years ago

Any chance of getting an updated full release for this?

No one? For those of us who aren't skilled enough to make our own, is there anyone willing to share the .dll built with the patch from this thread?

mvandemar commented 3 years ago

Getting this on CentOS 7, Pidgin 2.10.11-9.el7 (libpurple 2.10.11). As near as I can tell, it's only happening when someone messages me from the Faceboook web interface, not if they are using the app.

Edit: Additionally, it only seems to be certain browsers, was not happening when someone messaged me from Chrome. Can't say which browser it was happening with, unfortunately, but might he someone reproduce.

dequis commented 3 years ago

Merged that, but can't release yet. Builds are broken right now.

jaymzh commented 3 years ago

@dequis eh? I was able to build master...

dequis commented 3 years ago

I mean CI builds. OBS fails with authentication stuff (this is more obvious in bitlbee-facebook where the dependencies are fixed), and win32 uploads are broken too I think. Both things that need me specifically to have a look at the problem and, welp.

Building it yourself works, yeah.

SM0TVI commented 3 years ago

Getting this on CentOS 7, Pidgin 2.10.11-9.el7 (libpurple 2.10.11). As near as I can tell, it's only happening when someone messages me from the Faceboook web interface, not if they are using the app.

Edit: Additionally, it only seems to be certain browsers, was not happening when someone messaged me from Chrome. Can't say which browser it was happening with, unfortunately, but might he someone reproduce.

FWIW, I'm using Firefox, and that causes the problem with the plugin. And it seems it happens sporadically even without Messenger active in Firefox as well, tho nowhere near at the same level as when I have it open.

mvandemar commented 3 years ago

Just happened with someone messaging me from mobile Safari while I had Facebook open in Chrome.

Merged that, but can't release yet. Builds are broken right now.

@dequis, are you still unable to release the fix?

akhepcat commented 3 years ago

i see that this still isn't in code, but that there is a patch in the 'patches' directory for it.

Since i've been getting this error more often, i'm gonna give it a spin...

jaymzh commented 3 years ago

@akhepcat that's how this project is built, actually. run ./update.sh and that will grab the remote sources and patch them. then you can ./configure; make; sudo make install

akhepcat commented 3 years ago

@akhepcat that's how this project is built, actually. run ./update.sh and that will grab the remote sources and patch them. then you can ./configure; make; sudo make install

well, heck, i completely missed the 'update.sh' bit - it's not in the readme, and i've just been manually doing the git pull, configure; make et al thread without the patches all this time..

*edit - oh update.sh doesn't appear to work for me: bash -x update.sh | tail -4

it appears that my mercurial bits are from 2019, and woefully brokenly out-of-date - and apparently the script isn't noticing that it's in need of an rm -rf ...

Manual removal of the .pidgin directory gets things working again.

Phew! Thanks for the lead-up!

BrenBarn commented 3 years ago

What's the story with this? From the thread here it looks like the bug is "fixed" but the build system is broken so the fix can't be released? Is there any hope that this or future fixes will actually be released at some point?

johnchoi8 commented 3 years ago

What's the story with this? From the thread here it looks like the bug is "fixed" but the build system is broken so the fix can't be released? Is there any hope that this or future fixes will actually be released at some point?

I had forgotten I even asked about it. I gave up on this plugin and switched to the Facebook Messenger app. It is not what I wanted, but at least it works and is updated.

jaymzh commented 3 years ago

@BrenBarn - you can build it on master, I was able to build, see my comment above.

@dequis - we should get a release out though when you get time there's a ton of fixes waiting.

akhepcat commented 3 years ago

my current steps:

cd ${PDGBUILD}
./autogen.sh
./configure
make -j4
make install

this seems to work just fine, however I do get a lot of warnings about deprecated pre-processor symbols and deprecated parameter declarations.

BrenBarn commented 3 years ago

@BrenBarn - you can build it on master, I was able to build, see my comment above.

Thanks, but I'm not asking about building it myself, I'm asking if a built version is going to be actually released so people don't have to build it themselves.

jostwald commented 3 years ago

Any chance one of you folks who's successfully built it could post the .dll somewhere, please?

I don't have make set up on my machine and I'd rather not do it just for this.

akhepcat commented 3 years ago

Any chance one of you folks who's successfully built it could post the .dll somewhere, please?

I don't have make set up on my machine and I'd rather not do it just for this.

You'll probably have a better chance at getting that fulfilled if you provide some OS and bitting information: Win32, Linux x86_64, Armel, etc...

jostwald commented 3 years ago

Any chance one of you folks who's successfully built it could post the .dll somewhere, please? I don't have make set up on my machine and I'd rather not do it just for this.

You'll probably have a better chance at getting that fulfilled if you provide some OS and bitting information: Win32, Linux x86_64, Armel, etc...

Very good point, apologies.

I'm on a 64 bit windows 10 machine thanks

akhepcat commented 3 years ago

I'm on a 64 bit windows 10 machine thanks

Sorry that i can't help - i'm linux only.

alexolog commented 3 years ago

Any chance one of you folks who's successfully built it could post the .dll somewhere, please? I don't have make set up on my machine and I'd rather not do it just for this.

You'll probably have a better chance at getting that fulfilled if you provide some OS and bitting information: Win32, Linux x86_64, Armel, etc...

A DLL is a Windows term, and Pidgin 2 on Windows is 32-bit only (even on 64-bit Windows) so it's pretty much unambiguous in this context :)

akhepcat commented 3 years ago

@alexolog I know what a DLL is. I also know what assumptions are, and "dll" is used transparently across os's (nobody says "send me that .so file" - they say, "send me the library" or "the dll" because it's more well known)

enforcing clarity is not a bad thing to keep people in the habit of doing.

alexolog commented 3 years ago

Pre-built DLLs for this plugin are available from: https://github.com/ae-bogdan/libfacebook_pidgin

jostwald commented 3 years ago

Thank you!

On Wed, Jun 16, 2021 at 10:07 PM Alex @.***> wrote:

Pre-built DLLs for this plugin are available from: https://github.com/ae-bogdan/libfacebook_pidgin

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dequis/purple-facebook/issues/496#issuecomment-862858095, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQD67AOW5AVKKYXZWLS6U3TTFKERANCNFSM4SU4QMEQ .

bwo commented 1 year ago

… why is this closed? the latest release is from 2019