Page MenuHomePhabricator

Cannot create or edit or delete pages on betacluster (Cache not updated with SFS Data)
Closed, ResolvedPublic

Description

https://commons.wikimedia.beta.wmflabs.org/w/index.php?title=User_talk:Exampleusername&action=edit&redlink=1

Internal error

[X-ye1qwQBHcAABOB5QYAAAAQ] /w/index.php?title=User_talk:Exampleusername&action=edit&redlink=1 Exception from line 63 of /srv/mediawiki/php-master/extensions/StopForumSpam/includes/DenyListManager.php: Cache not updated with SFS Data.

Backtrace:

#0 /srv/mediawiki/php-master/extensions/StopForumSpam/includes/Hooks.php(142): MediaWiki\StopForumSpam\DenyListManager::isDenyListed(string)
#1 /srv/mediawiki/php-master/includes/HookContainer/HookContainer.php(333): MediaWiki\StopForumSpam\Hooks::onGetUserPermissionsErrorsExpensive(Title, User, string, string)
#2 /srv/mediawiki/php-master/includes/HookContainer/HookContainer.php(140): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)
#3 /srv/mediawiki/php-master/includes/HookContainer/HookRunner.php(2022): MediaWiki\HookContainer\HookContainer->run(string, array)
#4 /srv/mediawiki/php-master/includes/Permissions/PermissionManager.php(507): MediaWiki\HookContainer\HookRunner->onGetUserPermissionsErrorsExpensive(Title, User, string, string)
#5 /srv/mediawiki/php-master/includes/Permissions/PermissionManager.php(457): MediaWiki\Permissions\PermissionManager->checkPermissionHooks(string, User, array, string, boolean, Title)
#6 /srv/mediawiki/php-master/includes/Permissions/PermissionManager.php(307): MediaWiki\Permissions\PermissionManager->getPermissionErrorsInternal(string, User, Title, string)
#7 /srv/mediawiki/php-master/includes/EditPage.php(732): MediaWiki\Permissions\PermissionManager->getPermissionErrors(string, User, Title, string)
#8 /srv/mediawiki/php-master/includes/EditPage.php(591): EditPage->getEditPermissionErrors(string)
#9 /srv/mediawiki/php-master/includes/actions/EditAction.php(71): EditPage->edit()
#10 /srv/mediawiki/php-master/includes/MediaWiki.php(532): EditAction->show()
#11 /srv/mediawiki/php-master/includes/MediaWiki.php(316): MediaWiki->performAction(Article, Title)
#12 /srv/mediawiki/php-master/includes/MediaWiki.php(944): MediaWiki->performRequest()
#13 /srv/mediawiki/php-master/includes/MediaWiki.php(548): MediaWiki->main()
#14 /srv/mediawiki/php-master/index.php(53): MediaWiki->run()
#15 /srv/mediawiki/php-master/index.php(46): wfIndexMain()
#16 /srv/mediawiki/w/index.php(3): require(string)
#17 {main}

https://en.wikipedia.beta.wmflabs.org/w/index.php?title=Wikipedia:Village_pump&action=edit

[X-y2z6wQBHcAABOB8VIAAAAH] /w/index.php?title=Wikipedia:Village_pump&action=edit Exception from line 63 of /srv/mediawiki/php-master/extensions/StopForumSpam/includes/DenyListManager.php: Cache not updated with SFS Data.

Backtrace:

#0 /srv/mediawiki/php-master/extensions/StopForumSpam/includes/Hooks.php(142): MediaWiki\StopForumSpam\DenyListManager::isDenyListed(string)
#1 /srv/mediawiki/php-master/includes/HookContainer/HookContainer.php(333): MediaWiki\StopForumSpam\Hooks::onGetUserPermissionsErrorsExpensive(Title, User, string, string)
#2 /srv/mediawiki/php-master/includes/HookContainer/HookContainer.php(140): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)
#3 /srv/mediawiki/php-master/includes/HookContainer/HookRunner.php(2022): MediaWiki\HookContainer\HookContainer->run(string, array)
#4 /srv/mediawiki/php-master/includes/Permissions/PermissionManager.php(507): MediaWiki\HookContainer\HookRunner->onGetUserPermissionsErrorsExpensive(Title, User, string, string)
#5 /srv/mediawiki/php-master/includes/Permissions/PermissionManager.php(457): MediaWiki\Permissions\PermissionManager->checkPermissionHooks(string, User, array, string, boolean, Title)
#6 /srv/mediawiki/php-master/includes/Permissions/PermissionManager.php(307): MediaWiki\Permissions\PermissionManager->getPermissionErrorsInternal(string, User, Title, string)
#7 /srv/mediawiki/php-master/includes/EditPage.php(732): MediaWiki\Permissions\PermissionManager->getPermissionErrors(string, User, Title, string)
#8 /srv/mediawiki/php-master/includes/EditPage.php(591): EditPage->getEditPermissionErrors(string)
#9 /srv/mediawiki/php-master/includes/actions/EditAction.php(71): EditPage->edit()
#10 /srv/mediawiki/php-master/includes/MediaWiki.php(532): EditAction->show()
#11 /srv/mediawiki/php-master/includes/MediaWiki.php(316): MediaWiki->performAction(Article, Title)
#12 /srv/mediawiki/php-master/includes/MediaWiki.php(944): MediaWiki->performRequest()
#13 /srv/mediawiki/php-master/includes/MediaWiki.php(548): MediaWiki->main()
#14 /srv/mediawiki/php-master/index.php(53): MediaWiki->run()
#15 /srv/mediawiki/php-master/index.php(46): wfIndexMain()
#16 /srv/mediawiki/w/index.php(3): require(string)
#17 {main}

Expected behavior: I see the edit form and can create a page
What happen instead: I am presented an error

Event Timeline

AlexisJazz renamed this task from Cannot create pages on betacommons (Cache not updated with SFS Data) to Cannot create or edit pages on betacommons (Cache not updated with SFS Data).Jan 11 2021, 7:00 PM
AlexisJazz renamed this task from Cannot create or edit pages on betacommons (Cache not updated with SFS Data) to Cannot create or edit or delete pages on betacommons (Cache not updated with SFS Data).Jan 11 2021, 7:05 PM
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

No edits possible on BC 12 hours before the cut -> High, maybe UBN.

DenyListManager
// attempt to rebuild in cache
$dlu = new DenyListUpdate();
if ( !$dlu->doUpdate() ) {
	throw new \Exception( "Cache not updated with SFS Data." );
}
DenyListUpdate
public function doUpdate() {
	global $wgSFSIPListLocation;
	if ( $wgSFSIPListLocation === false ) {
		wfDebugLog( 'StopForumSpam', '$wgSFSIPListLocation has not been configured properly.' );
		return false;
	}
	return self::loadDenyListIPs(); // Apparently, this can only return an array
}

So either the global is not configured (doesn't seem to be the case looking at the WMF config), or it's getting an empty list (definitely unexpected, perhaps some error further down the chain).

While it won't fix the issue, I think that doUpdate() should throw an exception, rather than logging and silently returning false, and then it can be typehinted as returning an array. At which point, if the result is falsey in DenyListManager it means that the list is empty and it should just return false.
Even less helpful but I think worth mentioning, throwing plain Exceptions (which happens several times in DenyListUpdate) can be problematic because it's easy to catch them by mistake. Using SPL exception classes is a much stronger choice if creating dedicated exception classes is an overkill.

The problem is it's not respecting the outbound proxy

Change 655499 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/extensions/StopForumSpam@master] Add outbound proxy support for requests

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

AlexisJazz renamed this task from Cannot create or edit or delete pages on betacommons (Cache not updated with SFS Data) to Cannot create or edit or delete pages on betacluster (Cache not updated with SFS Data).Jan 11 2021, 8:37 PM
AlexisJazz removed a project: Commons.
AlexisJazz updated the task description. (Show Details)

Change 655499 merged by jenkins-bot:
[mediawiki/extensions/StopForumSpam@master] Add outbound proxy support for requests

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

Change 655503 had a related patch set uploaded (by SBassett; owner: SBassett):
[operations/mediawiki-config@master] Temporarily disable StopForumSpam on the beta cluster

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

Doesn't look like https://gerrit.wikimedia.org/r/655499 fixed the issue, entirely. There are obviously a few more bugs that need to be worked out with the extension, so I'm just going to disable it on beta for now.

Change 655503 merged by jenkins-bot:
[operations/mediawiki-config@master] Temporarily disable StopForumSpam on the beta cluster

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

sbassett claimed this task.
sbassett moved this task from Backlog to Done on the MediaWiki-extensions-StopForumSpam board.

Sorry about the interruption - should be fixed now.