mautrix / facebook

A Matrix-Facebook Messenger puppeting bridge
https://matrix.to/#/#facebook:maunium.net
GNU Affero General Public License v3.0
389 stars 64 forks source link

Could not find fb_dtsg error #87

Closed nesnera closed 4 years ago

nesnera commented 4 years ago

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:

Jul 26 16:19:20 matrix systemd[1]: Starting Matrix-Facebook Messenger puppeting bridge...
Jul 26 16:19:22 matrix j0cp0fr7sl4mkg43fisxwk77l1mcjx1b-unit-script-mautrix-facebook-pre-start[17127]: INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
Jul 26 16:19:22 matrix j0cp0fr7sl4mkg43fisxwk77l1mcjx1b-unit-script-mautrix-facebook-pre-start[17127]: INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
Jul 26 16:19:22 matrix systemd[1]: Started Matrix-Facebook Messenger puppeting bridge.
Jul 26 16:19:24 matrix mautrix-facebook[17131]: [INFO@mau.init] Initializing mautrix-facebook 0.1.0rc3+dev.unknown
Jul 26 16:19:24 matrix mautrix-facebook[17131]: [INFO@mau.init] Initialization complete in 0.33 seconds
Jul 26 16:19:24 matrix mautrix-facebook[17131]: [INFO@mau.mx] Ensuring connectivity to homeserver
Jul 26 16:19:39 matrix mautrix-facebook[17131]: [INFO@mau.user.@nesnera_om:vesp.cz] Loaded session successfully
Jul 26 16:19:39 matrix mautrix-facebook[17131]: [INFO@mau.user.@nesnera_om:vesp.cz] Running post-login actions
Jul 26 16:19:39 matrix mautrix-facebook[17131]: [ERROR@mau.user.@b42666:vesp.cz] Failed to restore session
Jul 26 16:19:39 matrix mautrix-facebook[17131]: Traceback (most recent call last):
Jul 26 16:19:39 matrix mautrix-facebook[17131]:   File "/nix/store/dc1zr5i1h4sy3zr2651jxfcx95dq5ay3-mautrix-facebook-20-06-30git/lib/python3.7/site-packages/mautrix_facebook/user.py", line 200, in load_session
Jul 26 16:19:39 matrix mautrix-facebook[17131]:     user_agent=self.user_agent)
Jul 26 16:19:39 matrix mautrix-facebook[17131]:   File "/nix/store/nyhs0i7rszz9h46wcmrigr3vf73jc79m-python3.7-fbchat-asyncio-0.6.10/lib/python3.7/site-packages/fbchat/_session.py", line 501, in from_cookies
Jul 26 16:19:39 matrix mautrix-facebook[17131]:     return await cls._from_session(session=session)
Jul 26 16:19:39 matrix mautrix-facebook[17131]:   File "/nix/store/nyhs0i7rszz9h46wcmrigr3vf73jc79m-python3.7-fbchat-asyncio-0.6.10/lib/python3.7/site-packages/fbchat/_session.py", line 451, in _from_session
Jul 26 16:19:39 matrix mautrix-facebook[17131]:     raise _exception.ParseError("Could not find fb_dtsg", data=define)
Jul 26 16:19:39 matrix mautrix-facebook[17131]: fbchat.ParseError: Could not find fb_dtsg. Please report this, along with the data below:
Jul 26 16:19:39 matrix mautrix-facebook[17131]: {'cr:717822': {'__rc': ['TimeSliceImpl', 'Aa35dejJCJyOSnjSXmyFE1K_fVSs5EbtHP-1rbrzj8hP47HSoS-9or_MlRyp9p1SeJU1_-52eLnom59S4zkFyz0']}, 'cr:696703': {'__rc': [None, 'Aa35dejJCJyOSnjSXmyFE1K_fVSs5EbtHP-1rbrzj8hP47HSoS-9or_MlRyp9p1SeJU1_-52eLnom59S4zkFyz0']}, 'ErrorDebugHooks': {'SnapShotHook': None}, 'BigPipeExperiments': {'link_images_to_pagelets': False, 'enable_bigpipe_plugins': False}, 'SiteData': {'server_revision': 1002420272, 'client_revision': 1002420272, 'tier': '', 'push_phase': 'C3', 'pkg_cohort': 'FW_EXP:mnonjs_pkg', 'pr': 1, 'haste_site': 'mobile', 'be_one_ahead': False, 'ir_on': True, 'is_rtl': False, 'is_comet': False, 'is_experimental_tier': False, 'is_jit_warmed_up': True, 'hsi': '0-0', 'semr_host_bucket': '5', 'spin': 0, '__spin_r': 1002420272, '__spin_b': 'trunk', '__spin_t': 1595773178, 'vip': '157.240.30.18'}, 'BootloaderConfig': {'deferBootloads': False, 'jsRetries': [200, 500], 'jsRetryAbortNum': 2, 'jsRetryAbortTime': 5, 'payloadEndpointURI': 'https://www.messenger.com/ajax/bootloader-endpoint/', 'preloadBE': True, 'shouldCoalesceModuleRequestsMadeInSameTick': True, 'retryQueuedBootloads': False, 'silentDups': False}, 'CSSLoaderConfig': {'timeout': 5000, 'modulePrefix': 'BLCSS:'}, 'ServerNonce': {'ServerNonce': 'x95AtmZgwp2dHTxGixvcb_'}, 'UriNeedRawQuerySVConfig': {'uris': ['dms.netmng.com', 'doubleclick.net', 'r.msn.com', 'watchit.sky.com', 'graphite.instagram.com', 'www.kfc.co.th', 'learn.pantheon.io', 'www.landmarkshops.in', 'www.ncl.com', 's0.wp.com', 'www.tatacliq.com', 'bs.serving-sys.com', 'kohls.com', 'lazada.co.th', 'xg4ken.com', 'technopark.ru', 'officedepot.com.mx', 'bestbuy.com.mx', 'booking.com']}, 'KSConfig': {'killed': {'__set': ['POCKET_MONSTERS_CREATE', 'POCKET_MONSTERS_DELETE', 'VIDEO_DIMENSIONS_FROM_PLAYER_IN_UPLOAD_DIALOG', 'STO_AD_DELIVERY_PAUSE', 'POCKET_MONSTERS_UPDATE_NAME', 'ADS_PLACEMENT_FIX_PUBLISHER_PLATFORMS_MUTATION', 'MOBILITY_KILL_OLD_VISIBILITY_POSITION_SETTING', 'WORKPLACE_DISPLAY_TEXT_EVIDENCE_REPORTING', 'DYNAMIC_ADS_SET_CATALOG_AND_PRODUCT_SET_TOGETHER', 'BUSINESS_GRAPH_SETTING_APP_ASSIGNED_USERS_NEW_API', 'BUSINESS_GRAPH_SETTING_WABA_ASSIGNED_USERS_NEW_API', 'BUSINESS_GRAPH_SETTING_ESG_ASSIGNED_USERS_NEW_API', 'BUSINESS_GRAPH_SETTING_PRODUCT_CATALOG_ASSIGNED_USERS_NEW_API', 'BUSINESS_GRAPH_SETTING_BU_ASSIGNED_USERS_NEW_API', 'BUSINESS_GRAPH_SETTING_SESG_ASSIGNED_USERS_NEW_API', 'WORKPLACE_PLATFORM_SECURE_APPS_MAILBOXES', 'LAB_NET_NEW_UI_RELEASE', 'EO_SRT_HELPDESK_DASHBOARD_DISABLE_UNUSED_TAB_IN_RIGHT_PANEL', 'BUSINESS_INVITE_FLOW_WITH_SELLER_PROFILE', 'HELPDESK_USE_XDS_SEARCHABLE_INPUT_FOR_WORKFLOW', 'MLHUB_FLOW_AUTOREFRESH_SEARCH']}, 'ko': {'__set': ['acrJTh9WGdp', '1oOE64fL4wO', '2dhqRnqXGLQ', '3GaiM9xYkM2', '7r6mSP7ofr2', '1ntjZ2zgf03', '3oh5Mw86USj', '8NAceEy9JZo', '5mNEXob0nTj', '4j36SVzvP3w', '8PlKuowafe8', '53gCxKq281G', '3yzzwBY7Npj', '4NSq3ZC4ScE', '1onzIv0jH6H', '5XCz1h9Iaw3', 'DDZhogI19W', '6fHw06UmAMW', '7FOIzos6XJX', 'aDayprn6pbH', '3OsLvnSHNTt']}}, 'ImmediateImplementationExperiments': {'prefer_message_channel': True}, 'PromiseUsePolyfillSetImmediateGK': {'www_always_use_polyfill_setimmediate': False}, 'TrustedTypesConfig': {'useTrustedTypes': False, 'reportOnly': True}, 'BootloaderEndpointConfig': {'endpointURI': 'https://www.messenger.com/ajax/bootloader-endpoint/', 'debugNoBatching': False}, 'CurrentCommunityInitialData': {}, 'CurrentUserInitialData': {'USER_ID': '100009066048567', 'ACCOUNT_ID': '100009066048567', 'NAME': 'Moravský Kaleidoskopický Ústav', 'SHORT_NAME': 'Moravský Kaleidoskopický', 'IS_MESSENGER_ONLY_USER': False, 'IS_DEACTIVATED_ALLOWED_ON_MESSENGER': False, 'IS_MESSENGER_CALL_GUEST_USER': False, 'APP_ID': '772021112871879'}, 'MRequestConfig': {'dtsg': {'token': 'AQGOMEu5O0k6:AQEdZ6GR-oZK', 'valid_for': 86400, 'expire': 1595859579}, 'dtsg_ag': {'token': 'AQxoI63YyLynSbvfrpgZ2YV7LPpBVOigDffCxcA1DxcbIg:AQwS38O_paQEjNMkP00JCqxuwhdrAEVGs1OhUkHGn28kKQ', 'valid_for': 604800, 'expire': 1596377979}, 'checkResponseOrigin': True, 'checkResponseToken': True, 'cleanFinishedRequest': False, 'cleanFinishedPrefetchRequests': False, 'ajaxResponseToken': {'secret': 'HgnCi1x1Vlv32rnEngaI2HjAWGZenHVj', 'encrypted': 'AYkbBOupz5K1MBpgISRp4AlO0zQIlUIVQ_BvJESkSIQEQQEdV3QyhuZcxKrpkKKWkrwLHRUcIe0GPgFWGCiBCBKwYGkG3_5dN0YmcxMDmMod4w'}}, 'SprinkleConfig': {'param_name': 'jazoest', 'version': 2, 'should_randomize': False}, 'ISB': {}, 'LSD': {}, 'InitialCookieConsent': {'deferCookies': False, 'noCookies': False, 'shouldShowCookieBanner': True}, 'RunGatingConfig': {'shouldUseBrowserUnload': True}, 'cr:1454227': {'__rc': ['BanzaiBase', 'Aa25Fq2G7hMVfdyXyHDUiZMulwZ3bwsXhdRRgsxoTeDNv257SKUdKH5Ac4CEcm0L0F5HGvyYSPCz5gGI3vUuXFdi39Ln5fqK']}, 'cr:729414': {'__rc': [None, 'Aa0nU_gSWN5WJ6cKTZFK-SLj5EoWWWJEVeKRANF6i82hHhQrsFkXvZydAbDVrG94IagYyNNvjJ-9YHmtaWkW']}, 'cr:692209': {'__rc': ['cancelIdleCallbackBlue', 'Aa35dejJCJyOSnjSXmyFE1K_fVSs5EbtHP-1rbrzj8hP47HSoS-9or_MlRyp9p1SeJU1_-52eLnom59S4zkFyz0']}, 'CookieCoreConfig': {'a11y': {}, 'act': {}, 'c_user': {}, 'cppo': {'t': 86400}, 'dpr': {'t': 604800}, 'js_ver': {'t': 604800}, 'locale': {'t': 604800}, 'm_pixel_ratio': {'t': 604800}, 'noscript': {}, 'pnl_data2': {'t': 2}, 'presence': {}, 'sfau': {}, 'wd': {'t': 604800}, 'x-referer': {}, 'x-src': {'t': 1}, 'm_ls': {}}, 'CookieCoreLoggingConfig': {'maximumIgnorableStallMs': 16.67, 'sampleRate': 9.7e-05, 'sampleRateClassic': 1e-10, 'sampleRateFastStale': 1e-08}, 'MBanzaiConfig': {'MAX_SIZE': 10000, 'MAX_WAIT': 30000, 'RESTORE_WAIT': 30000, 'gks': {'platform_oauth_client_events': True, 'visibility_tracking': True, 'boosted_pagelikes': True, 'mtouch_use_beacon': True}, 'blacklist': ['time_spent']}, 'MJSEnvironment': {'IS_APPLE_WEBKIT_IOS': False, 'IS_TABLET': False, 'IS_ANDROID': True, 'IS_CHROME': False, 'IS_FIREFOX': False, 'IS_WINDOWS_PHONE': False, 'IS_SAMSUNG_DEVICE': False, 'OS_VERSION': 0, 'PIXEL_RATIO': 1, 'BROWSER_NAME': 'Unknown'}, 'UserAgentData': {'browserArchitecture': '32', 'browserFullVersion': '109.0.0.17.70', 'browserMinorVersion': 0, 'browserName': 'Facebook Messenger for Android', 'browserVersion': 109, 'deviceName': 'Unknown', 'engineName': 'Unknown', 'engineVersion': None, 'platformArchitecture': '32', 'platformName': 'Android', 'platformVersion': None, 'platformFullVersion': None}, 'IntlViewerContext': {'GENDER': 1}, 'FbtResultGK': {'shouldReturnFbtResult': True, 'inlineMode': 'NO_INLINE'}, 'IntlHoldoutGK': {'inIntlHoldout': False}, 'IntlNumberTypeConfig': {'impl': 'if (n === 1) { return IntlVariations.NUMBER_ONE; } else { return IntlVariations.NUMBER_OTHER; }'}, 'NumberFormatConfig': {'decimalSeparator': '.', 'numberDelimiter': ',', 'minDigitsForThousandsSeparator': 4, 'standardDecimalPatternInfo': {'primaryGroupSize': 3, 'secondaryGroupSize': 3}, 'numberingSystemData': None}, 'IntlPhonologicalRules': {'meta': {'/_B/': '([.,!?\\s]|^)', '/_E/': '([.,!?\\s]|$)'}, 'patterns': {"/\x01(.*)('|')s\x01(?:'|')s(.*)/": '\x01$1$2s\x01$3', '/_\x01([^\x01]*)\x01/': 'javascript'}}, 'ZeroRewriteRules': {'rewrite_rules': {}, 'whitelist': {'/hr/r': 1, '/hr/p': 1, '/zero/unsupported_browser/': 1, '/zero/policy/optin': 1, '/zero/optin/write/': 1, '/zero/optin/legal/': 1, '/zero/optin/free/': 1, '/about/privacy/': 1, '/about/privacy/update/': 1, '/about/privacy/update': 1, '/zero/toggle/welcome/': 1, '/zero/toggle/nux/': 1, '/fup/interstitial/': 1, '/work/landing': 1, '/work/login/': 1, '/work/email/': 1, '/ai.php': 1, '/js_dialog_resources/dialog_descriptions_android.json': 0, '/connect/jsdialog/MPlatformAppInvitesJSDialog/': 0, '/connect/jsdialog/MPlatformOAuthShimJSDialog/': 0, '/connect/jsdialog/MPlatformLikeJSDialog/': 0, '/qp/interstitial/': 1, '/qp/action/redirect/': 1, '/qp/action/close/': 1, '/zero/support/ineligible/': 1, '/zero_balance_redirect/': 1, '/zero_balance_redirect': 1, '/zero_balance_redirect/l/': 1, '/l.php': 1, '/lsr.php': 1, '/ajax/dtsg/': 1, '/checkpoint/block/': 1, '/exitdsite': 1, '/zero/balance/pixel/': 1, '/zero/balance/': 1, '/zero/balance/carrier_landing/': 1, '/zero/flex/logging/': 1, '/tr': 1, '/tr/': 1, '/sem_campaigns/sem_pixel_test/': 1, '/bookmarks/flyout/body/': 1, '/zero/subno/': 1, '/confirmemail.php': 1, '/policies/': 1, '/mobile/internetdotorg/classifier/': 1, '/zero/dogfooding': 1, '/xti.php': 1, '/zero/fblite/config/': 1, '/hr/zsh/wc/': 1, '/ajax/bootloader-endpoint/': 1, '/4oh4.php': 1, '/autologin.php': 1, '/birthday_help.php': 1, '/checkpoint/': 1, '/contact-importer/': 1, '/cr.php': 1, '/legal/terms/': 1, '/login.php': 1, '/login/': 1, '/mobile/account/': 1, '/n/': 1, '/remote_test_device/': 1, '/upsell/buy/': 1, '/upsell/buyconfirm/': 1, '/upsell/buyresult/': 1, '/upsell/promos/': 1, '/upsell/continue/': 1, '/upsell/h/promos/': 1, '/upsell/loan/learnmore/': 1, '/upsell/purchase/': 1, '/upsell/promos/upgrade/': 1, '/upsell/buy_redirect/': 1, '/upsell/loan/buyconfirm/': 1, '/upsell/loan/buy/': 1, '/upsell/sms/': 1, '/wap/a/channel/reconnect.php': 1, '/wap/a/nux/wizard/nav.php': 1, '/wap/appreg.php': 1, '/wap/birthday_help.php': 1, '/wap/c.php': 1, '/wap/confirmemail.php': 1, '/wap/cr.php': 1, '/wap/login.php': 1, '/wap/r.php': 1, '/zero/datapolicy': 1, '/a/timezone.php': 1, '/a/bz': 1, '/bz/reliability': 1, '/r.php': 1, '/mr/': 1, '/reg/': 1, '/registration/log/': 1, '/terms/': 1, '/f123/': 1, '/expert/': 1, '/experts/': 1, '/terms/index.php': 1, '/terms.php': 1, '/srr/': 1, '/msite/redirect/': 1, '/fbs/pixel/': 1, '/contactpoint/preconfirmation/': 1, '/contactpoint/cliff/': 1, '/contactpoint/confirm/submit/': 1, '/contactpoint/confirmed/': 1, '/contactpoint/login/': 1, '/preconfirmation/contactpoint_change/': 1, '/help/contact/': 1, '/survey/': 1, '/upsell/loyaltytopup/accept/': 1, '/settings/': 1, '/lite/': 1, '/zero_status_update/': 1, '/operator_store/': 1}}, 'ZeroCategoryHeader': {}, 'cr:1094907': {'__rc': [None, 'Aa0H6IiAlZQAjrNG-K0yjWyrRk8oX2mShP7tFlNmLWQ8XnhdX7dnn2CC0JM0vNGI3tQ-wNrGDQbMC0fbpik']}, 'FbtQTOverrides': {'overrides': {'1_b16a2aa153d7b006eb97330e353b1f71': 'How do I monetize my app?', '1_93c672d977c41c923ec851475fa31cd6': 'When will I be paid?', '1_543b3fc3289ef23f33e448921e9b3cf1': 'Update my properties', '1_67fa721a8e55fd26265f463521726aff': 'Why are estimated and final revenue different?', '1_60256b78ba507b02ef8937194ebe62d9': 'My placement is suspended', '1_7a3bba54c9d925a1880413abc3ff4584': 'How to troubleshoot Ad Spaces', '1_f4aec84ce515494a3c9abc6071f89c4d': 'Update my Ad Spaces', '1_526c251b8fe382c2798bbadfeedd8f9f': 'Manage my price settings', '1_6f14283ccdf30654b76fd00ae7952d0a': 'Allow access to my properties', '1_9ece9941327056ebef8571b21935ae28': 'Add my payment information', '1_7422cedbc86cc758071b042968ffe54f': 'Find status of my placements'}}, 'WebConnectionClassServerGuess': {'connectionClass': 'UNKNOWN'}}
Jul 26 16:19:39 matrix mautrix-facebook[17131]: [INFO@mau.init] Startup actions complete in 14.38 seconds, now running forever
Jul 26 16:19:39 matrix mautrix-facebook[17131]: [WARNING@fbchat] Invalid user data {'id': 0, 'firstName': 'Uživatel Facebooku', 'gender': 7, 'name': 'Uživatel Facebooku', 'thumbSrc': 'https://scontent.fprg2-1.fna.fbcdn.net/v/t1.30497-1/cp0/c9.0.32.32a/p32x32/84628273_176159830277856_972693363922829312_n.jpg?_nc_cat=1&_nc_sid=12b3be&_nc_ohc=vXWPFb0PgfUAX_y8A7h&_nc_ht=scontent.fprg2-1.fna&oh=2441ec5aee7346fc9475c3fa5ee3d475&oe=5F425481', 'type': 'user'}
Jul 26 16:19:47 matrix mautrix-facebook[17131]: [WARNING@fbchat] Tried to parse Page as a user.
Jul 26 16:19:49 matrix mautrix-facebook[17131]: [INFO@mau.portal.1327175710<->100001337005250] Backfilled 1 messages through @nesnera_om:vesp.cz
Jul 26 16:19:50 matrix mautrix-facebook[17131]: [INFO@mau.portal.1164860565<->100001337005250] Backfilled 1 messages through @nesnera_om:vesp.cz
Jul 26 16:19:51 matrix mautrix-facebook[17131]: [WARNING@mau.portal.3340485849346433] Got empty name in _update_name call

The bridge was built from the source at 2020-07-25

tulir commented 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

nesnera commented 4 years ago

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):

BTW I have been using Pidgin with purple-facebook for years and I have not encountered such problems.

nesnera commented 4 years ago

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. Matrix-FaceBook-Temporarily_Locked Matrix-FaceBook-Temporarily_Locked-steps

FB opened sessions Matrix-FaceBook-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 Matrix-FaceBook-Sessions_after_service_restart_and_login

Bridging works well now.

tulir commented 4 years ago

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.

nesnera commented 4 years ago

OK. I'll try it.

nesnera commented 4 years ago

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.

nesnera commented 4 years ago

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.

tulir commented 4 years ago

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

nesnera commented 4 years ago

OK. I'll try it.

This is the sequence when FB kicked me out again. (Account is Temporarily Locked).

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!

nesnera commented 4 years ago

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..

tulir commented 4 years ago

Inconsistent state after a login until restarting is probably an actual bug

immanuelfodor commented 3 years ago

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.