Page MenuHomePhabricator

SpecialPages and Actions that call PermissionManager::isBlockedFrom should pass through the appropriate rigor level
Closed, ResolvedPublic

Description

Several special pages and actions call PermissionManager::isBlockedFrom directly, without specifying whether to use the primary or replica database, and therefore defaulting to primary. When executing actions via a POST request, this is the correct thing to do, but when simply loading the UI via a GET request, the replicas should be checked instead.

At the time of writing, about 25,000 warnings were logged in the last 24 hours satisfying the following filters:

  • normalized_message.keyword: Expectation (masterConns <=) 0 by MediaWiki::main not met (actual: {actual}): {query}
  • http_method: GET
  • exception.trace: MediaWiki\Permissions\PermissionManager->isBlockedFrom

They are all accounted for by the following:

  • SpecialRevisionDelete::execute
  • SpecialEditTags::execute
  • NewEntitySchema::checkBlocked (EntitySchema extension)
  • SpecialMergeLexemes::checkBlocked (WikibaseLexeme extension)
  • Action::checkCanExecute
  • EditPage::showIntro
  • Article::showMissingArticle
  • AbstractRestoreAction::checkPermissions (EntitySchema extension)

These are also the only sources of similar warnings for the last month.

Event Timeline

Tchanders renamed this task from SpecialPages that call PermissionManager::isBlockedFrom should pass through the appropriate rigor level to SpecialPages and Actions that call PermissionManager::isBlockedFrom should pass through the appropriate rigor level.May 21 2021, 6:27 PM
Tchanders updated the task description. (Show Details)

Change 693620 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/core@master] Specify DB to query when checking if a user is blocked from a page

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

Change 693621 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/extensions/EntitySchema@master] Specify DB to query when checking if a user is blocked from a page

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

Change 693622 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/extensions/WikibaseLexeme@master] Specify DB to query when checking if a user is blocked from a page

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

Change 693621 merged by jenkins-bot:

[mediawiki/extensions/EntitySchema@master] Specify DB to query when checking if a user is blocked from a page

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

Change 693622 merged by jenkins-bot:

[mediawiki/extensions/WikibaseLexeme@master] Specify DB to query when checking if a user is blocked from a page

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

Change 693620 merged by jenkins-bot:

[mediawiki/core@master] Specify DB to query when checking if a user is blocked from a page

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

(EDIT: I removed my comment; what I reported is in fact T283265.)