Page MenuHomePhabricator

Special:OAuth/identify broken (affects pagepile+massviews tools, phab mw.o login, …)
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:
The Page pile tool is currently experiencing an issue. Previously, I used it without any problems to extract the number of views for a group of articles using the mass views tool. However, today the tool is no longer functioning properly. Whenever I try to log in to the site, I'm greeted with a 502 bad gateway message.

What should have happened instead?:
The tool should have worked properly with no problems as before.

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):
Example: https://pageviews.wmcloud.org/massviews/?platform=all-access&agent=user&source=pagepile&start=2023-02-01&end=2023-02-28&target=34555&sort=views&direction=1&view=list&target=34555

Tool site: https://pagepile.toolforge.org/

Event Timeline

error.log has this:

2023-07-12 08:18:51: (mod_fastcgi.c.421) FastCGI-stderr: PHP Fatal error:  Uncaught Exception: Invalid identify response: <!DOCTYPE html>
2023-07-12 08:18:51: (mod_fastcgi.c.421) FastCGI-stderr: <html class="client-nojs vector-feature-language-in-header-disabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-enabled vector-feature-main-menu-pinned-disabled vector-feature-limited-width-enabled vector-feature-limited-width-content-disabled vector-feature-zebra-design-disabled" lang="en" dir="ltr">
2023-07-12 08:18:51: (mod_fastcgi.c.421) FastCGI-stderr: <head>
2023-07-12 08:18:51: (mod_fastcgi.c.421) FastCGI-stderr: <meta charset="UTF-8">
2023-07-12 08:18:51: (mod_fastcgi.c.421) FastCGI-stderr: <title>Error - MediaWiki</title>
2023-07-12 08:18:51: (mod_fastcgi.c.421) FastCGI-stderr: <script>document.documentElement.className="client-js vector-feature-language-in-header-disabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-enabled vector-feature-main-menu-pinned-disabled vector-feature-limited-width-enabled vector-feature-limited-width-content-disabled vecto in /data/project/magnustools/public_html/php/oauth.php on line 372

Apparently the OAuth /identify endpoint is returning an error. The output isn’t super readable because it’s been HTML-escaped, but “conveniently” I actually got the same error when trying to log into Phabricator via MediaWiki.org:

image.png (277×1 px, 45 KB)

[HTTP/400] 
<!DOCTYPE html>
<html class="client-nojs vector-feature-language-in-header-disabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-enabled vector-feature-main-menu-pinned-disabled vector-feature-limited-width-enabled vector-feature-limited-width-content-disabled vector-feature-zebra-design-disabled" lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
<title>Error - MediaWiki</title>
<script>documen...

Seems to be a general OAuth error in the current train.

LucasWerkmeister added a subscriber: Tgr.

Ohhhh, I think I know why… @Tgr I think we need to revert Fail when OAuth is used with a non-API entry point, Special:OAuth/identify is technically a non-API entry point and needs to stay working.

Change 937120 had a related patch set uploaded (by Lucas Werkmeister; author: Lucas Werkmeister):

[mediawiki/extensions/OAuth@master] Revert "Fail when OAuth is used with a non-API entry point"

https://gerrit.wikimedia.org/r/937120

Ohhhh, I think I know why… @Tgr I think we need to revert Fail when OAuth is used with a non-API entry point, Special:OAuth/identify is technically a non-API entry point and needs to stay working.

(Or amend the change, of course, but reverting is easier at first.)

LucasWerkmeister renamed this task from Pagepiles are not working to Special:OAuth/identify broken (affects pagepile+massviews tools, phab mw.o login, …).Jul 12 2023, 8:45 AM

Come to think of it, other Special:OAuth subpages (in the source code, I see Special:OAuth/initiate, Special:OAuth/approve, Special:OAuth/authorize=Special:OAuth/authenticate, Special:OAuth/token, Special:OAuth/verified, Special:OAuth/grants, Special:OAuth/identify and Special:OAuth/rest_redirect) might also be broken, possibly including the OAuth 1.0a authorization flow as a whole. (The OAuth 2 flow uses the REST API, so it’s probably fine.)

LucasWerkmeister triaged this task as Unbreak Now! priority.Jul 12 2023, 2:00 PM

Train blocker ⇒ UBN

Change 937471 had a related patch set uploaded (by Gergő Tisza; author: Lucas Werkmeister):

[mediawiki/extensions/OAuth@wmf/1.41.0-wmf.17] Temporarily allow OAuth on non-API entry points again

https://gerrit.wikimedia.org/r/937471

Change 937120 merged by jenkins-bot:

[mediawiki/extensions/OAuth@master] Temporarily allow OAuth on non-API entry points again

https://gerrit.wikimedia.org/r/937120

Change 937471 merged by jenkins-bot:

[mediawiki/extensions/OAuth@wmf/1.41.0-wmf.17] Temporarily allow OAuth on non-API entry points again

https://gerrit.wikimedia.org/r/937471

Mentioned in SAL (#wikimedia-operations) [2023-07-12T14:41:12Z] <lucaswerkmeister-wmde@deploy1002> Started scap: Backport for [[gerrit:937471|Temporarily allow OAuth on non-API entry points again (T341656)]]

Mentioned in SAL (#wikimedia-operations) [2023-07-12T14:42:44Z] <lucaswerkmeister-wmde@deploy1002> tgr and lucaswerkmeister-wmde: Backport for [[gerrit:937471|Temporarily allow OAuth on non-API entry points again (T341656)]] synced to the testservers: mwdebug2002.codfw.wmnet, mwdebug1001.eqiad.wmnet, mwdebug2001.codfw.wmnet, mwdebug1002.eqiad.wmnet

Mentioned in SAL (#wikimedia-operations) [2023-07-12T14:49:15Z] <lucaswerkmeister-wmde@deploy1002> Finished scap: Backport for [[gerrit:937471|Temporarily allow OAuth on non-API entry points again (T341656)]] (duration: 08m 03s)

LucasWerkmeister claimed this task.
LucasWerkmeister lowered the priority of this task from Unbreak Now! to High.

Alright, the fix is merged and backported (with thanks to @Tgr and the cough random person in #wikimedia-operations doing the deployment), and both the PagePile tool and mw.o login on Phabricator are working again as far as I can tell.

Mentioned in SAL (#wikimedia-cloud) [2023-07-12T15:04:10Z] <wm-bot> <lucaswerkmeister> kubectl rollout restart deployment pagepile (lighttpd was failing to write temp files; “PHP Warning: Unknown: POST data can't be buffered; all data discarded”; cc T341656)

I am sorry, yes it worked. thank you so much. ♥

Thanks @LucasWerkmeister for catching and fixing this quickly!

Come to think of it, other Special:OAuth subpages (in the source code, I see Special:OAuth/initiate, Special:OAuth/approve, Special:OAuth/authorize=Special:OAuth/authenticate, Special:OAuth/token, Special:OAuth/verified, Special:OAuth/grants, Special:OAuth/identify and Special:OAuth/rest_redirect) might also be broken, possibly including the OAuth 1.0a authorization flow as a whole. (The OAuth 2 flow uses the REST API, so it’s probably fine.)

token requires an OAuth signature. The others would not be affected in theory.