Closed nesnera closed 4 years ago
fbchat-asyncio v0.6.11 might fix that error
Sometimes it doesn't send the message, sometimes it doesn't receive it
https://github.com/tulir/mautrix-facebook/blob/master/mautrix_facebook/example-config.yaml#L130-L170
Thanks for advice but unfortunately it didn't solve our problem. (Our config was the same but fbchat-asyncio was older) There must be somthing wrong with session handling. My experiences (after upgrade):
connect
(Messenger) 1-2 per day. It takes about 10 minutes! :open_mouth: login
as suspicious activity, temporarily blocks my account and forces me to change my password. Very, very frustratingping
sometimes tell me that everything is correct but at https://www.facebook.com/settings?tab=security§ion=sessions&view I see missing or old session. Mautrix-facebook service must be restarted in this caseBTW I have been using Pidgin with purple-facebook for years and I have not encountered such problems.
I sent a message to myself from testing FB account at 2020-08-05 08:26 and it was received immediately in Matrix. But when I answered from the Matrix, I got this
Who/Time | Message |
---|
Ladislav Nešněra @otevrenamesta.cz 2020-08-04 22:21|ping Facebook bridge bot 2020-08-04 22:21|You're logged in as Ladislav Nešněra (user ID 100001337005250) 2020-08-04 22:21|The Messenger MQTT listener is connected. Facebook bridge bot 2020-08-05 08:26|Disconnected from Facebook Messenger: MQTT Error: no connection, retrying 2020-08-05 08:26|Connected to Facebook Messenger 2020-08-05 08:26|Failed to connect to Facebook Messenger: MQTT error: no connection. Not retrying! Ladislav Nešněra @otevrenamesta.cz 2020-08-05 08:26|connect Facebook bridge bot 2020-08-05 08:27|Connected to Facebook Messenger after being disconnected for 32 seconds, syncing chats... 2020-08-05 08:27|Disconnected from Facebook Messenger: MQTT Error: no connection, retrying 2020-08-05 08:27|Connected to Facebook Messenger 2020-08-05 08:27|Failed to connect to Facebook Messenger: Failed connecting. Maybe your cookies are wrong?. Not retrying!
Comment:
FB locked my account. Unlocking required 5 steps.
FB opened sessions
My new login attempt Who/Time | Message |
---|
Ladislav Nešněra @otevrenamesta.cz
2020-08-05 09:12|login nesnera@email.cz <new-password>
Facebook bridge bot
2020-08-05 09:12|You're already logged in
restart Mautrix-facebook service
Who/Time | Message |
---|
Ladislav Nešněra @otevrenamesta.cz
2020-08-05 09:19|login nesnera@email.cz <new-password>
Facebook bridge bot
2020-08-05 09:19|Logging in...
2020-08-05 09:19|Successfully logged in
2020-08-05 09:19|Connected to Facebook Messenger
FB opened sessions
Bridging works well now.
Why does the bot ask about cookies when I am logged in with a password?
Passwords aren't saved, it just logs in and gets the cookies automatically.
Manual cookie login with set-ua
might work better if the account keeps getting locked.
OK. I'll try it.
still bad :disappointed:
ping
doesn't recognize if connection is broken.
I performed this sequence after FB temporarily locked the account (and closed all sessions).
Who/Time | Message |
---|
Ladislav Nešněra @otevrenamesta.cz 2020-08-08 11-18|ping Facebook bridge bot 2020-08-08 11-18|You're logged in as Ladislav Nešněra (user ID 100001337005250) 2020-08-08 11-18|The Messenger MQTT listener is connected. Ladislav Nešněra @otevrenamesta.cz 2020-08-08 11-21|refresh Facebook bridge bot 2020-08-08 11-21|Failed to refresh Messenger session: Found empty fb_dtsg, the session was probably invalid.
At this time messages from FB were being delivered correctly. Direction Matrix > FB ended with alert: "Your message may not have been bridged: Nejste přihlášeni"
And one more observation. In Pidgin (with purple-facebook plugin), I see messages that I send from both the web client and the Matrix. Unfortunately, this does not apply to the Matrix. I'm losing track of everything I've sent by other clients.
The robot has to make fun of me.🤣
For this moment I was able to send messages but not to receive them. No warning from the bot or ping
.
Connect
was without effect but refresh
solved the problem. Unfortunately, the messages sent from FB were lost.
Who/Time | Message |
---|
Ladislav Nešněra @otevrenamesta.cz 2020-08-09 21:06|ping Facebook bridge bot 2020-08-09 21:06|You're logged in as Ladislav Nešněra (user ID 100001337005250) 2020-08-09 21:06|The Messenger MQTT listener is connected. Ladislav Nešněra @otevrenamesta.cz 2020-08-09 21:22|ping Facebook bridge bot 2020-08-09 21:22|You're logged in as Ladislav Nešněra (user ID 100001337005250) 2020-08-09 21:22|The Messenger MQTT listener is connected. Ladislav Nešněra @otevrenamesta.cz 2020-08-09 21:23|connect Facebook bridge bot 2020-08-09 21:23|You already have a Messenger MQTT connection Ladislav Nešněra @otevrenamesta.cz 2020-08-09 21:24|refresh Facebook bridge bot 2020-08-09 21:24|Successfully refreshed Messenger session 2020-08-09 21:24|Connected to Facebook Messenger Ladislav Nešněra @otevrenamesta.cz 2020-08-09 21:24|ping Facebook bridge bot 2020-08-09 21:24|You're logged in as Ladislav Nešněra (user ID 100001337005250) 2020-08-09 21:24|The Messenger MQTT listener is connected.
For this moment I was able to send messages but not to receive them. No warning from the bot or ping. Connect was without effect but refresh solved the problem.
Facebook sometimes does that, there's a config section to help mitigate the problem: https://github.com/tulir/mautrix-facebook/blob/master/mautrix_facebook/example-config.yaml#L163-L171
Unfortunately, the messages sent from FB were lost.
There's another config section to fix that: https://github.com/tulir/mautrix-facebook/blob/master/mautrix_facebook/example-config.yaml#L147-L162
OK. I'll try it.
This is the sequence when FB kicked me out again. (Account is Temporarily Locked).
version
to test if the bot is still alive.Who/Time | Message |
---|
Facebook bridge bot 2020-08-11 14:33|Disconnected from Facebook Messenger: Connection lost, retrying 2020-08-11 14:33|Connected to Facebook Messenger 2020-08-11 14:33|Failed to connect to Facebook Messenger: MQTT error: no connection. Not retrying! Ladislav Nešněra @otevrenamesta.cz 2020-08-11 18:01|connect Ladislav Nešněra @otevrenamesta.cz 2020-08-11 18:08|version Facebook bridge bot 2020-08-11 18:18|Connected to Facebook Messenger after being disconnected for 13503 seconds, syncing chats... 2020-08-11 18:18|mautrix-facebook 0.1.0rc3+dev.unknown 2020-08-11 18:18|Disconnected from Facebook Messenger: MQTT Error: no connection, retrying 2020-08-11 18:18|Connected to Facebook Messenger 2020-08-11 18:18|Failed to connect to Facebook Messenger: MQTT error: no connection. Not retrying!
After returning to the keyboard and resetting FB password (all sessions were closed) With new login, I was able to receive messages, not send them.
Who/Time | Message |
---|
Ladislav Nešněra @otevrenamesta.cz 2020-08-11 21:19|login-cookie Facebook bridge bot 2020-08-11 21:35|You're already logged in Ladislav Nešněra @otevrenamesta.cz 2020-08-11 23:01|logout Facebook bridge bot 2020-08-11 23:01|Successfully logged out Ladislav Nešněra @otevrenamesta.cz 2020-08-11 23:01|login-cookie Facebook bridge bot 2020-08-11 23:01|Log in to Messenger in a private/incognito window... .. .. Facebook bridge bot 2020-08-11 23:02|Successfully logged in 2020-08-11 23:02|Connected to Facebook Messenger Ladislav Nešněra @otevrenamesta.cz 2020-08-11 23:25|ping Facebook bridge bot 2020-08-11 23:25|This command requires you to be logged in. Ladislav Nešněra @otevrenamesta.cz 2020-08-11 23:25|refresh Facebook bridge bot 2020-08-11 23:25|This command requires you to be logged in.
Only restarting the service put me back in the game..
Inconsistent state after a login until restarting is probably an actual bug
I've just run into this same issue with fb_dtsg, same connect/sync/refresh/ping experience as above, after logout and login, same experience as above. However, restarting the Docker container helped, connected and synced fine automatically. If there is a related bug already open, I'd like to subscribe to that.
I have a lot of problems with mautrix-facebook. (Sometimes it doesn't send the message, sometimes it doesn't receive it. At logout command responds "This command requires you to be logged in." and if I try to login, then "You're already logged in.")
When I restart the service, I see in the log:
The bridge was built from the source at 2020-07-25