Skip to content
This repository has been archived by the owner on Mar 2, 2024. It is now read-only.

Can't log in: "Got empty response when trying to check login" #109

Closed
FuzzyMistborn opened this issue Nov 12, 2020 · 18 comments · Fixed by tulir/fbchat-asyncio#28
Closed

Comments

@FuzzyMistborn
Copy link

Getting the following error when I try to log in to FB using login-cookie. Has worked fine before.


[2020-11-12 14:55:53,425] [[email protected]] Failed to log in,
Traceback (most recent call last):,
  File "/usr/lib/python3.8/site-packages/mautrix_facebook/commands/auth.py", line 133, in enter_login_cookies,
    session = await fbchat.Session.from_cookies({,
  File "/usr/lib/python3.8/site-packages/fbchat/_session.py", line 582, in from_cookies,
    raise _exception.FacebookError("Got empty response when trying to check login"),
  File "/usr/lib/python3.8/site-packages/fbchat/_session.py", line 520, in _from_session,
    return await cls._from_session(session=session, domain=domain),
fbchat.FacebookError: Got empty response when trying to check login

Running in Docker, have done a docker pull to make sure I'm on latest image.

@gwiazdorrr
Copy link

gwiazdorrr commented Nov 18, 2020

Same. Login-cookie was the only login option that worked for me.

EDIT: running from source, latest master.

@rufflepot
Copy link

This just started happening to me the other day. Interestingly enough, I have to containers running for two separate Facebook accounts and only one of them ran into this error.

@gwiazdorrr
Copy link

This issue lies not in the bridge itself, but in https://github.com/tulir/fbchat-asyncio (same author). It on the other hand is a fork of fbchat, which has been abandoned recently: fbchat-dev/fbchat#613.

@tulir
Copy link
Member

tulir commented Nov 19, 2020

Cookie login seems to be working fine for me. Are you sure you didn't take cookies from the wrong domain or log out before entering them into the bridge?

@FuzzyMistborn
Copy link
Author

Yes I'm sure on both. Done the same thing I've done several times.

@FuzzyMistborn
Copy link
Author

I was just able to login today successfully, so it's a fleeting issue it looks like.

@rufflepot
Copy link

I succeeded today as well but I tried Chrome instead of Firefox for the first time, so I'm not sure if that was the reason.

@gwiazdorrr
Copy link

Still no luck for me, no matter the browser.

@spantaleev
Copy link

The bridge has been stable for me for many months now, with just the occasional refresh I had to do.

Since today, I can send messages, but can't receive them. Refreshing also responds with the same message. Here's the full exception:

[2020-11-22 08:21:31,582] [[email protected].@USER:DOMAIN Failed to restore session
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/mautrix_facebook/user.py", line 231, in load_session
session = await fbchat.Session.from_cookies(self._session_data,
File "/usr/lib/python3.8/site-packages/fbchat/_session.py", line 582, in from_cookies
return await cls._from_session(session=session, domain=domain)
File "/usr/lib/python3.8/site-packages/fbchat/_session.py", line 520, in _from_session
raise _exception.FacebookError("Got empty response when trying to check login")
fbchat.FacebookError: Got empty response when trying to check login

@Sun-volt
Copy link

It was working fine until yesterday. (with login-cookie and login)

But today I get an identical error "Failed to log in: Got empty response when trying to check login".
I tried all the available methods and different browsers too.
No difference.

@christnt
Copy link

Same here since a couple days ( with login and login-cookie commands).

Message: Failed to log in: Got empty response when trying to check login for both.

Sometimes this: Failed to log in: Failed logging in: https://www.messenger.com/login/checkpoint_interstitial/?next=https%3A%2F%2Fwww.facebook.com%2Fcheckpoint%2Fstart****cookie****step****inst****aid****null****null****.ch.****-rlf_****next%3Dhttps%253A%252F%252Fwww.messenger.com%252F%26hash%3DAWXwrbOUOgm9m-ryEyc, None for login command. I have replace %hex values by **** for privacy concern.

Two-Factor Authentication on or off show the same results. Only less a step with it off.

I have created a brand new Facebook account yesterday for the occasion and successfully logged-in with merely the login command.
When logging-in to my actual FB account, a perpetual "you tried to connect from my actual location. Please confirm." step appears. This is not the case with my brand new temporary FB account I successful log-in with the bridge.

May I suggest that either we are locked-out from connecting with the bridge for "security" reason after too many attempts by Facebook or that an extra step is missing in the bridge for this case scenario where access location has to be confirmed.

@spantaleev
Copy link

Somehow my bridge started working again after restarting it (a few days later). It backfilled some hundreds of messages in various conversations. Interesting..

@gwiazdorrr
Copy link

Started to work for me too.

@christnt
Copy link

christnt commented Nov 25, 2020

For me as well.☺

But I got this message on any command I sent to the bot: This command requires you to be logged in.
Even with ping or refresh.

With login and login-cookie, I got: You're already logged in

I was just trying to get double-puppeting, but login-matrix <my token> also gave This command requires you to be logged in..

EDIT: Thanks to tulir, who told me to restart the bridge, it is working like a charm now.

@christnt
Copy link

The bug is back today 😕. I got disconnected for no reason and I cannot login back again, with neither login nor login-cookie. I have restarted the bridge.

@gwiazdorrr
Copy link

Same here.

spantaleev added a commit to spantaleev/fbchat-asyncio that referenced this issue Dec 1, 2020
Fixes mautrix/facebook#109

Seems like trying to hit `/` results in a 302 redirect,
leading me to some chat (https://www.messenger.com/t/XXXXXXXX/).

Allowing redirects seems to make the bridge work again.

I guess this potentially makes the `if len(html) == 0` check (below) potentially
useless, since it's now unlikely to receive an empty response.
@spantaleev
Copy link

If anyone could confirm that the fix from tulir/fbchat-asyncio#28 works for them, that would probably be helpful.

@christnt
Copy link

christnt commented Dec 1, 2020

EDIT4:
I did the following:

  1. Stopped the bridge;
  2. Changed to the bridge folder and activated with source ./bin/activate;
  3. pip install --upgrade https://github.com/spantaleev/fbchat-asyncio/archive/patch-1.zip;
  4. alembic upgrade head;
  5. Started the bridge.

I am now able to login with login-cookie.

Thanks to @spantaleev.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging a pull request may close this issue.

7 participants