Page MenuHomePhabricator

Error trying to enable 2FA on testwiki: "Call to a member function getSecret() on a non-object (array)"
Closed, ResolvedPublicPRODUCTION ERROR

Description

Get the following internal error on trying to enable 2FA (via Special:OATH) on Test Wikipedia.

[XWzSlgpAMFgAAJHPyUAAAABG] /w/index.php?title=Special:Manage_Two-factor_authentication&action=enable&module=totp BadMethodCallException from line 36 of /srv/mediawiki/php-1.34.0-wmf.20/extensions/OATHAuth/src/HTMLForm/TOTPEnableForm.php: Call to a member function getSecret() on a non-object (array)

Backtrace:

#0 /srv/mediawiki/php-1.34.0-wmf.20/extensions/OATHAuth/src/HTMLForm/OATHAuthOOUIHTMLForm.php(44): MediaWiki\Extension\OATHAuth\HTMLForm\TOTPEnableForm->getDescriptors()
#1 /srv/mediawiki/php-1.34.0-wmf.20/extensions/OATHAuth/src/Module/TOTP.php(112): MediaWiki\Extension\OATHAuth\HTMLForm\OATHAuthOOUIHTMLForm->__construct(MediaWiki\Extension\OATHAuth\OATHUser, MediaWiki\Extension\OATHAuth\OATHUserRepository, MediaWiki\Extension\OATHAuth\Module\TOTP)
#2 /srv/mediawiki/php-1.34.0-wmf.20/extensions/OATHAuth/src/Special/OATHManage.php(207): MediaWiki\Extension\OATHAuth\Module\TOTP->getManageForm(string, MediaWiki\Extension\OATHAuth\OATHUser, MediaWiki\Extension\OATHAuth\OATHUserRepository)
#3 /srv/mediawiki/php-1.34.0-wmf.20/extensions/OATHAuth/src/Special/OATHManage.php(169): MediaWiki\Extension\OATHAuth\Special\OATHManage->addModuleCustomForm(MediaWiki\Extension\OATHAuth\Module\TOTP, boolean)
#4 /srv/mediawiki/php-1.34.0-wmf.20/extensions/OATHAuth/src/Special/OATHManage.php(154): MediaWiki\Extension\OATHAuth\Special\OATHManage->addModule(MediaWiki\Extension\OATHAuth\Module\TOTP, boolean)
#5 /srv/mediawiki/php-1.34.0-wmf.20/extensions/OATHAuth/src/Special/OATHManage.php(98): MediaWiki\Extension\OATHAuth\Special\OATHManage->addNotEnabledModules()
#6 /srv/mediawiki/php-1.34.0-wmf.20/includes/specialpage/SpecialPage.php(573): MediaWiki\Extension\OATHAuth\Special\OATHManage->execute(NULL)
#7 /srv/mediawiki/php-1.34.0-wmf.20/includes/specialpage/SpecialPageFactory.php(582): SpecialPage->run(NULL)
#8 /srv/mediawiki/php-1.34.0-wmf.20/includes/MediaWiki.php(296): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#9 /srv/mediawiki/php-1.34.0-wmf.20/includes/MediaWiki.php(892): MediaWiki->performRequest()
#10 /srv/mediawiki/php-1.34.0-wmf.20/includes/MediaWiki.php(523): MediaWiki->main()
#11 /srv/mediawiki/php-1.34.0-wmf.20/index.php(42): MediaWiki->run()
#12 /srv/mediawiki/w/index.php(3): include(string)
#13 {main}

Event Timeline

Aklapper renamed this task from Internal error on trying to enable 2FA on testwiki to Error trying to enable 2FA on testwiki: "Call to a member function getSecret() on a non-object (array)".Sep 2 2019, 9:01 AM
JJMC89 changed the subtype of this task from "Task" to "Production Error".

Change 534415 had a related patch set uploaded (by ItSpiderman; owner: ItSpiderman):
[mediawiki/extensions/OATHAuth@master] Make sure key is of correct type before running operations on it

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

This should do it. Make sure type is actually what we expect, and not just "not null"

Change 534415 merged by jenkins-bot:
[mediawiki/extensions/OATHAuth@master] Make sure key is of correct type before running operations on it

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

Reedy claimed this task.
Reedy reassigned this task from Reedy to ItSpiderman.
Reedy removed a project: Patch-For-Review.

@Reedy, @ItSpiderman can you look into this again, please. While no internal error appears now, I am still unable to to enable 2FA: the message "Failed to validate two-factor credentials" comes up every time. I have tried using both Google Authenticator as well as 2FA Authenticator apps.

@Reedy, @ItSpiderman can you look into this again, please. While no internal error appears now, I am still unable to to enable 2FA: the message "Failed to validate two-factor credentials" comes up every time. I have tried using both Google Authenticator as well as 2FA Authenticator apps.

Yes, we know, that's T233146. It's actually a bigger issue