Charcoal-SE / PulseMonitor

PulseMonitor is the chat interface to Halflife.
MIT License
4 stars 3 forks source link

Can't login #16

Closed tripleee closed 5 years ago

tripleee commented 5 years ago

Looks like the login functionality in chatexchange is no longer operational.

2019-01-08 14:05:40,506:client:Logging in.
Traceback (most recent call last):
  File "./Source/startup.py", line 19, in <module>
    Pulse("PulseMonitor", email, password, rooms=[65945])
  File "/home/ec2-user/PulseMonitor/Source/Pulse.py", line 31, in __init__
    bot = bp.Bot(nick, commands, rooms, [], "stackexchange.com", email, password)
  File "/home/ec2-user/PulseMonitor/hlenv/lib64/python3.6/dist-packages/BotpySE/Bot.py", line 28, in __init__
    super().__init__(host, email, password)
  File "/home/ec2-user/PulseMonitor/hlenv/lib64/python3.6/dist-packages/chatexchange/client.py", line 76, in __init__
    self.login(email, password)
  File "/home/ec2-user/PulseMonitor/hlenv/lib64/python3.6/dist-packages/chatexchange/client.py", line 140, in login
    self._br.login_site(self.host)
  File "/home/ec2-user/PulseMonitor/hlenv/lib64/python3.6/dist-packages/chatexchange/browser.py", line 169, in login_site
    'openid_identifier': 'https://openid.stackexchange.com/'
  File "/home/ec2-user/PulseMonitor/hlenv/lib64/python3.6/dist-packages/chatexchange/browser.py", line 190, in _se_openid_login_with_fkey
    response = self.post(post_url, data, with_chat_root=False)
  File "/home/ec2-user/PulseMonitor/hlenv/lib64/python3.6/dist-packages/chatexchange/browser.py", line 113, in post
    return self._request('post', url, data, headers, with_chat_root)
  File "/home/ec2-user/PulseMonitor/hlenv/lib64/python3.6/dist-packages/chatexchange/browser.py", line 102, in _request
    response.raise_for_status()
  File "/home/ec2-user/PulseMonitor/hlenv/lib64/python3.6/dist-packages/requests/models.py", line 935, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://stackexchange.com/users/authenticate
tripleee commented 5 years ago

Experimentally tried replacing chatexchange with the version Smoke Detector is using, but no go.

double-fault commented 5 years ago

Wait. Is CE not working for all bots or is this a problem just with PM?

double-fault commented 5 years ago

(After seeing the Channels post)

@tripleee The changes required for the OpenID shift have been done in CE, so that surely isn't the problem. I originally suspected that the problem was with Botpy, but another bot which uses it seems to be working fine. Could you try booting PM from a different account? That might solve the problem.

double-fault commented 5 years ago

Also, what version of CE and Botpy are you running?

tripleee commented 5 years ago
ec2-user@ip-172-31-224-113 PulseMonitor]$ pip freeze | fgrep -e Botpy -e Chat
BotpySE==0.6.5
ChatExchange==0.0.3
tripleee commented 5 years ago

I experimentally updated to ChatExchange==0.0.4 and it's looking better, but it's still not working.

Here I'm running from my laptop;

$ sh ./run.PROD
2019-01-09 11:51:39,993:client:Logging in.
Traceback (most recent call last):
  File "./Source/startup.py", line 19, in <module>
    Pulse("PulseMonitor", email, password, rooms=[65945])
  File "/Users/tripleee/charcoal/PulseMonitor/Source/Pulse.py", line 31, in __init__
    bot = bp.Bot(nick, commands, rooms, [], "stackexchange.com", email, password)
  File "/Users/tripleee/charcoal/PulseMonitor/pmenv/lib/python3.5/site-packages/BotpySE/Bot.py", line 28, in __init__
    super().__init__(host, email, password)
  File "/Users/tripleee/charcoal/PulseMonitor/pmenv/lib/python3.5/site-packages/chatexchange/client.py", line 76, in __init__
    self.login(email, password)
  File "/Users/tripleee/charcoal/PulseMonitor/pmenv/lib/python3.5/site-packages/chatexchange/client.py", line 138, in login
    self._br.login_site(self.host, email, password)
  File "/Users/tripleee/charcoal/PulseMonitor/pmenv/lib/python3.5/site-packages/chatexchange/browser.py", line 158, in login_site
    "failed to get `acct` cookie from Stack Exchange OpenID, "
chatexchange.browser.LoginError: failed to get `acct` cookie from Stack Exchange OpenID, check credentials provided for accuracy

The same credentials I have in the file work fine for interactive login, verified with copy+paste.

double-fault commented 5 years ago

Hmm.. I'll try running PM from my comp today or tomorrow and will try to troubleshoot the issue.

tripleee commented 5 years ago

Looks like logging in with MadMoiselle instead of the regular account works fine. Time to divorce PulseMonitor from Thunder?

tripleee commented 5 years ago

As a workaround, MadMoiselle is now running the bot in Charcoal Test.

double-fault commented 5 years ago

FYI, Thunder isn't running right now. There were some problems with my instance and I just couldn't find the time to reboot it, so another user is running it right now on a different account. That means that the problem couldn't be related to an account being shared between PM and Thunder.

tripleee commented 5 years ago

Turned out to be a simple matter of separately have the account join the community on https://meta.stackexchange.com/ in order to be able to log in to rooms which are not linked to another site in the network.

I switched the bot to run on its own dedicated account now.

double-fault commented 5 years ago

Alright, thanks a lot!

double-fault commented 5 years ago

Would it make sense to change the bot name to Halflife now that the bot account is named so, so as to avoid confusion?

tripleee commented 5 years ago

I have been thinking about that, too. There is already a project named halflife which runs the back-end websocket server that the bot listens to, so this is slightly complicated.

tripleee commented 5 years ago

Ref https://github.com/SOBotics/Thunder/issues/12

double-fault commented 5 years ago

Then why don't we just rename the bot account to PulseMonitor, like before? If that isn't an option, I'll look into modifying Botpy to allow multiple bot names for command pings; the changes shouldn't be very complicated, but I'm not sure when I'll be able to get to it.

IMHO, keeping the ping name as PulseMonitor but naming the bot account Halflife will be confusing. Keeping both as aliases should work, but that will require some modification.