Page MenuHomePhabricator

QR codes for 2-factor auth setup often missing or broken
Closed, ResolvedPublic

Description

As found on https://wikitech.wikimedia.org/ -- the QR-code generation for 2fa setup with OATHAuth extension seems to be intermittently broken.

From logstash filtering by host:silver:

Expectation (writes <= 0) by MediaWiki::main not met:
query-m: INSERT INTO `oathauth_users` (id,secret,scratch_tokens,is_validated) VALUES ('X') [TRX#xxxxxxxxx]
TransactionProfiler.php line 311 calls wfBacktrace()
TransactionProfiler.php line 200 calls TransactionProfiler->reportExpectationViolated()
Database.php line 1006 calls TransactionProfiler->recordQueryCompletion()
Database.php line 1935 calls DatabaseBase->query()
OATHUser.php line 251 calls DatabaseBase->insert()
SpecialOATH.php line 57 calls OATHUser->enable()
SpecialOATH.php line 38 calls SpecialOATH->enable()
SpecialPage.php line 384 calls SpecialOATH->execute()
SpecialPageFactory.php line 553 calls SpecialPage->run()
MediaWiki.php line 280 calls SpecialPageFactory::executePath()
MediaWiki.php line 704 calls MediaWiki->performRequest()
MediaWiki.php line 506 calls MediaWiki->main()
index.php line 41 calls MediaWiki->run()
index.php line 3 calls require()

Event Timeline

brooke raised the priority of this task from to Needs Triage.
brooke updated the task description. (Show Details)
brooke subscribed.

Anyone working on this instead of https://phabricator.wikimedia.org/T105690 will earn the frowning of a lifetime

(I take that back -- I was thinking this was a wikitech-specific issue.)

Can confirm :-}

After entering the token I am redirected to Special:OATH which caused my browser to show nothing (not even a blank page). Refreshed and got a Special page essentially blank. Came back to the page and entered another token and it that second time it worked fine.

hashar set Security to None.

Wow I wonder if we have two unrelated bugs here? On initial setup everything _worked_ but I got no QR codes, just text codes to input manually.

Ditto I had no QR codes. Even after reloading the page entirely :\

[22:11:27] <Krenair> Uncaught TypeError: jQuery(...).qrcode is not a function

Change 252868 had a related patch set uploaded (by Legoktm):
Fix QR code generation by using ResourceLoader::makeInlineScript()

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

Change 252868 merged by jenkins-bot:
Fix QR code generation by using ResourceLoader::makeInlineScript()

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

Change 252868 merged by jenkins-bot:
Fix QR code generation by using ResourceLoader::makeInlineScript()

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

Is that enough to fix it?

Is that enough to fix it?

No, it should wait until the qrcode module is loaded.

Change 253299 had a related patch set uploaded (by Gergő Tisza):
Fix QR code generation module dependency

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

Change 253299 merged by jenkins-bot:
Fix QR code generation module dependency

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

Legoktm claimed this task.
Legoktm subscribed.

Confirmed working on wikitech now.