Page MenuHomePhabricator

Login broken
Closed, ResolvedPublic

Description

I git stash'd the changes (as root) on quarry-web-01.quarry.eqiad1.wikimedia.cloud, and then restarted the service

Feb 15 19:15:32 quarry-web-01 uwsgi-quarry-web[2055]: [2021-02-15 19:15:32,677] ERROR in app: Exception on /login [GET]
Feb 15 19:15:32 quarry-web-01 uwsgi-quarry-web[2055]: Traceback (most recent call last):
Feb 15 19:15:32 quarry-web-01 uwsgi-quarry-web[2055]:   File "/srv/quarry/venv/lib/python3.5/site-packages/flask/app.py", line 2292, in wsgi_app
Feb 15 19:15:32 quarry-web-01 uwsgi-quarry-web[2055]:     response = self.full_dispatch_request()
Feb 15 19:15:32 quarry-web-01 uwsgi-quarry-web[2055]:   File "/srv/quarry/venv/lib/python3.5/site-packages/flask/app.py", line 1815, in full_dispatch_request
Feb 15 19:15:32 quarry-web-01 uwsgi-quarry-web[2055]:     rv = self.handle_user_exception(e)
Feb 15 19:15:32 quarry-web-01 uwsgi-quarry-web[2055]:   File "/srv/quarry/venv/lib/python3.5/site-packages/flask/app.py", line 1718, in handle_user_exception
Feb 15 19:15:32 quarry-web-01 uwsgi-quarry-web[2055]:     reraise(exc_type, exc_value, tb)
Feb 15 19:15:32 quarry-web-01 uwsgi-quarry-web[2055]:   File "/srv/quarry/venv/lib/python3.5/site-packages/flask/_compat.py", line 35, in reraise
Feb 15 19:15:32 quarry-web-01 uwsgi-quarry-web[2055]:     raise value
Feb 15 19:15:32 quarry-web-01 uwsgi-quarry-web[2055]:   File "/srv/quarry/venv/lib/python3.5/site-packages/flask/app.py", line 1813, in full_dispatch_request
Feb 15 19:15:32 quarry-web-01 uwsgi-quarry-web[2055]:     rv = self.dispatch_request()
Feb 15 19:15:32 quarry-web-01 uwsgi-quarry-web[2055]:   File "/srv/quarry/venv/lib/python3.5/site-packages/flask/app.py", line 1799, in dispatch_request
Feb 15 19:15:32 quarry-web-01 uwsgi-quarry-web[2055]:     return self.view_functions[rule.endpoint](**req.view_args)
Feb 15 19:15:32 quarry-web-01 uwsgi-quarry-web[2055]:   File "./quarry/web/login.py", line 34, in login
Feb 15 19:15:32 quarry-web-01 uwsgi-quarry-web[2055]:     session['request_token'] = request_token
Feb 15 19:15:32 quarry-web-01 uwsgi-quarry-web[2055]: NameError: name 'request_token' is not defined

Event Timeline

Mentioned in SAL (#wikimedia-cloud) [2021-02-15T19:22:07Z] <Reedy> T274815 filed with the login failure traceback

Mentioned in SAL (#wikimedia-cloud) [2021-02-15T19:24:34Z] <Reedy> stash'd patch saved to quarry-web-01.quarry.eqiad1.wikimedia.cloud:/root/T274815.patch T274815

diff --git a/quarry/web/login.py b/quarry/web/login.py
index f1de2ee..afd019d 100644
--- a/quarry/web/login.py
+++ b/quarry/web/login.py
@@ -31,7 +31,6 @@ def login():
         oauth_token,
         user_agent=user_agent
     )
-    redirect_url, request_token = handshaker.initiate()
     session['request_token'] = request_token
     session['return_to_url'] = request.args.get('next', '/')
     return redirect(redirect_url)

I'm not sure why that change was made, it seems unrelated to the apparent Sentry changes of the rest of the commit

Framawiki assigned this task to Reedy.

Thanks for the revert reedy.
Tried to fix recent Oauth errors with a loop to retry login, but some connections were still failing. Will commit that properly.