Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chatexchange.browser.LoginError: failed to get acct cookie from Stack Exchange OpenID, check credentials provided for accuracy #173

Open
TvoozMagnificent opened this issue Jun 2, 2022 · 2 comments

Comments

@TvoozMagnificent
Copy link

I ran the command

make

As said. However, it threw an error:

chatexchange.browser.LoginError: failed to get `acct` cookie from Stack Exchange OpenID, check credentials provided for accuracy

Full Python Message:

Traceback (most recent call last):
  File "/Users/luchang/Desktop/ChatBot/examples/chat.py", line 80, in <module>
    main()
  File "/Users/luchang/Desktop/ChatBot/examples/chat.py", line 34, in main
    client.login(email, password)
  File "/Users/luchang/Desktop/ChatBot/chatexchange/client.py", line 169, in login
    cookies = self._br.login_site(self.host, email, password)
  File "/Users/luchang/Desktop/ChatBot/chatexchange/browser.py", line 160, in login_site
    raise LoginError(
chatexchange.browser.LoginError: failed to get `acct` cookie from Stack Exchange OpenID, check credentials provided for accuracy
sys:1: ResourceWarning: unclosed <ssl.SSLSocket fd=7, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('10.4.137.37', 52375), raddr=('151.101.193.69', 443)>
make: *** [run-example] Error 1

Full Output:

# This also creates a link to `chatexchange/` in the Python
# environment, which is neccessary for the other files to be
# able to find it.
rm -rf src/*.egg-info
python3.9 -m pip install -e .
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
Obtaining file:///Users/luchang/Desktop/ChatBot
Requirement already satisfied: beautifulsoup4>=4.3.2 in /usr/local/lib/python3.9/site-packages (from ChatExchange==0.0.3) (4.11.1)
Requirement already satisfied: requests>=2.2.1 in /usr/local/lib/python3.9/site-packages (from ChatExchange==0.0.3) (2.27.1)
Requirement already satisfied: websocket-client>=0.13.0 in /usr/local/lib/python3.9/site-packages (from ChatExchange==0.0.3) (1.3.2)
Requirement already satisfied: soupsieve>1.2 in /usr/local/lib/python3.9/site-packages (from beautifulsoup4>=4.3.2->ChatExchange==0.0.3) (2.3.1)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.9/site-packages (from requests>=2.2.1->ChatExchange==0.0.3) (3.2)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.9/site-packages (from requests>=2.2.1->ChatExchange==0.0.3) (1.26.7)
Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.9/site-packages (from requests>=2.2.1->ChatExchange==0.0.3) (2.0.6)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/site-packages (from requests>=2.2.1->ChatExchange==0.0.3) (2021.5.30)
Installing collected packages: ChatExchange
  Attempting uninstall: ChatExchange
    Found existing installation: ChatExchange 0.0.3
    Uninstalling ChatExchange-0.0.3:
      Successfully uninstalled ChatExchange-0.0.3
  Running setup.py develop for ChatExchange
Successfully installed ChatExchange-0.0.3
WARNING: You are using pip version 21.2.4; however, version 22.1.2 is available.
You should consider upgrading via the '/usr/local/opt/python@3.9/bin/python3.9 -m pip install --upgrade pip' command.
python3.9 -W default::Warning -m pytest
===================================================================== test session starts ======================================================================
platform darwin -- Python 3.9.7, pytest-7.1.2, pluggy-1.0.0
rootdir: /Users/luchang/Desktop/ChatBot
plugins: timeout-2.1.0
collected 6 items                                                                                                                                              

tests/test_browser.py ..                                                                                                                                 [ 33%]
tests/test_events.py ...                                                                                                                                 [ 83%]
tests/test_markdown.py .                                                                                                                                 [100%]

====================================================================== 6 passed in 0.66s =======================================================================
python3.9 -W default::Warning examples/chat.py
Email: SNIP
Password: SNIP
INFO:chatexchange.client.Client:Logging in.
Traceback (most recent call last):
  File "SNIP/examples/chat.py", line 80, in <module>
    main()
  File "SNIP/examples/chat.py", line 34, in main
    client.login(email, password)
  File "SNIP/chatexchange/client.py", line 169, in login
    cookies = self._br.login_site(self.host, email, password)
  File "SNIP/chatexchange/browser.py", line 160, in login_site
    raise LoginError(
chatexchange.browser.LoginError: failed to get `acct` cookie from Stack Exchange OpenID, check credentials provided for accuracy
sys:1: ResourceWarning: unclosed <ssl.SSLSocket fd=7, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('10.4.137.37', 52375), raddr=('151.101.193.69', 443)>
make: *** [run-example] Error 1

As you can see I manipulated the makefile to use python3.9.

client.log logfile:

SNIP,893: INFO: MainThread: Logging in.
@tripleee
Copy link
Contributor

tripleee commented Jun 2, 2022

This usually means that you had the wrong email address and/or password. Occasionally there is also a CAPTCHA involved; if you are certain that you have the right user name and password, try logging in manually with those and jump through the necessary hoops to prove that you are a human. (IIRC the error message in that case is slightly different.)

@Peter-developer01
Copy link

@tripleee's comment helps me, thank you!

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

No branches or pull requests

3 participants