Page MenuHomePhabricator

TypeError: Argument 5 passed to MediaWiki\Extension\AbuseFilter\Parser\ParserStatus::__construct() must be of the type integer, null given, called in /srv/mediawiki/php-1.37.0-wmf.23/extensions/AbuseFilter/includes/Parser/ParserStatus.php on line 107
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   TypeError: Argument 5 passed to MediaWiki\Extension\AbuseFilter\Parser\ParserStatus::__construct() must be of the type integer, null given, called in /srv/mediawiki/php-1.37.0-wmf.23/extensions/AbuseFilter/includes/Parser/Parse
exception.trace
from /srv/mediawiki/php-1.37.0-wmf.23/extensions/AbuseFilter/includes/Parser/ParserStatus.php(27)
#0 /srv/mediawiki/php-1.37.0-wmf.23/extensions/AbuseFilter/includes/Parser/ParserStatus.php(107): MediaWiki\Extension\AbuseFilter\Parser\ParserStatus->__construct(boolean, boolean, NULL, array, NULL)
#1 [internal function]: MediaWiki\Extension\AbuseFilter\Parser\ParserStatus::fromArray(array)
#2 /srv/mediawiki/php-1.37.0-wmf.23/extensions/AbuseFilter/includes/RunnerData.php(147): array_map(array, array)
#3 /srv/mediawiki/php-1.37.0-wmf.23/extensions/AbuseFilter/includes/FilterRunner.php(218): MediaWiki\Extension\AbuseFilter\RunnerData::fromArray(array)
#4 /srv/mediawiki/php-1.37.0-wmf.23/extensions/AbuseFilter/includes/Hooks/Handlers/FilteredActionsHandler.php(142): MediaWiki\Extension\AbuseFilter\FilterRunner->run()
#5 /srv/mediawiki/php-1.37.0-wmf.23/extensions/AbuseFilter/includes/Hooks/Handlers/FilteredActionsHandler.php(88): MediaWiki\Extension\AbuseFilter\Hooks\Handlers\FilteredActionsHandler->filterEdit(DerivativeContext, User, WikitextContent, string, string)
#6 /srv/mediawiki/php-1.37.0-wmf.23/includes/HookContainer/HookContainer.php(160): MediaWiki\Extension\AbuseFilter\Hooks\Handlers\FilteredActionsHandler->onEditFilterMergedContent(DerivativeContext, WikitextContent, Status, string, User, boolean)
#7 /srv/mediawiki/php-1.37.0-wmf.23/includes/HookContainer/HookRunner.php(1478): MediaWiki\HookContainer\HookContainer->run(string, array)
#8 /srv/mediawiki/php-1.37.0-wmf.23/includes/editpage/Constraint/EditFilterMergedContentHookConstraint.php(90): MediaWiki\HookContainer\HookRunner->onEditFilterMergedContent(DerivativeContext, WikitextContent, Status, string, User, boolean)
#9 /srv/mediawiki/php-1.37.0-wmf.23/includes/editpage/Constraint/EditConstraintRunner.php(88): MediaWiki\EditPage\Constraint\EditFilterMergedContentHookConstraint->checkConstraint()
#10 /srv/mediawiki/php-1.37.0-wmf.23/includes/EditPage.php(2264): MediaWiki\EditPage\Constraint\EditConstraintRunner->checkConstraints()
#11 /srv/mediawiki/php-1.37.0-wmf.23/includes/EditPage.php(1685): EditPage->internalAttemptSave(NULL, boolean)
#12 /srv/mediawiki/php-1.37.0-wmf.23/includes/EditPage.php(665): EditPage->attemptSave(NULL)
#13 /srv/mediawiki/php-1.37.0-wmf.23/includes/actions/EditAction.php(71): EditPage->edit()
#14 /srv/mediawiki/php-1.37.0-wmf.23/includes/actions/SubmitAction.php(38): EditAction->show()
#15 /srv/mediawiki/php-1.37.0-wmf.23/includes/MediaWiki.php(538): SubmitAction->show()
#16 /srv/mediawiki/php-1.37.0-wmf.23/includes/MediaWiki.php(320): MediaWiki->performAction(Article, Title)
#17 /srv/mediawiki/php-1.37.0-wmf.23/includes/MediaWiki.php(925): MediaWiki->performRequest()
#18 /srv/mediawiki/php-1.37.0-wmf.23/includes/MediaWiki.php(559): MediaWiki->main()
#19 /srv/mediawiki/php-1.37.0-wmf.23/index.php(53): MediaWiki->run()
#20 /srv/mediawiki/php-1.37.0-wmf.23/index.php(46): wfIndexMain()
#21 /srv/mediawiki/w/index.php(3): require(string)
#22 {main}
Impact

Production logspam

Notes

similar to T270514 perhaps?

Details

MediaWiki Version
1.37.0-wmf.23
Request URL
https://fi.wikipedia.org/w/index.php?title=*&action=submit

Event Timeline

I think this might be a caching issue, and the cache key needs to be updated.

Change 721379 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/extensions/AbuseFilter@master] Bump EditStashCache version

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

FTR, this would just be a temporary issue: you'd see a spike when rolling out the new version, and it would stop shortly (because it only happens for edits that were initiated before the upgraded, and saved afterwards). Nonetheless, it has a quick fix that can avoid the logspam.

Change 721312 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/extensions/AbuseFilter@wmf/1.37.0-wmf.23] Bump EditStashCache version

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

I can attest to seeing a huge spike in errors.

Change 721379 merged by jenkins-bot:

[mediawiki/extensions/AbuseFilter@master] Bump EditStashCache version

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

Change 721312 merged by jenkins-bot:

[mediawiki/extensions/AbuseFilter@wmf/1.37.0-wmf.23] Bump EditStashCache version

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

Mentioned in SAL (#wikimedia-operations) [2021-09-16T11:41:08Z] <urbanecm> [urbanecm@deploy1002 /srv/mediawiki-staging/php-1.37.0-wmf.23/extensions/AbuseFilter (wmf/1.37.0-wmf.23 u=)]$ git co 0d2bc7ca17b9f767ae5753db7e4e41fd9e7d3531 # reset repo to expected state, fixing incorrect deploy of a backport in T291123

Mentioned in SAL (#wikimedia-operations) [2021-09-16T11:41:55Z] <urbanecm> [urbanecm@deploy1002 /srv/mediawiki-staging/php-1.37.0-wmf.23 (wmf/1.37.0-wmf.23 * u+2-2)]$ git rebase && git submodule update extensions/AbuseFilter/ # fixing an incorrect deployment that happened in T291123

Mentioned in SAL (#wikimedia-operations) [2021-09-16T11:43:48Z] <urbanecm@deploy1002> Synchronized php-1.37.0-wmf.23/extensions/AbuseFilter/: Fixing incorrect deployment of rEABF01e4450f32bc for T291123. This is supposed to be a no-op. (duration: 01m 05s)

I'm not sure how you deployed it, but today, when I wanted to deploy a wmf.23 patch for growthexperiments, this patch jumped in front of me as a sign of the undeployed code problem. That being said, appservers have the new code.

[urbanecm@deploy1002 /srv/mediawiki-staging/php-1.37.0-wmf.23 (wmf/1.37.0-wmf.23 * u+2-2)]$ git log -p HEAD..@{u}
commit 38b3697b180332c8e9dcde88fd83f2cbedd77562 (origin/wmf/1.37.0-wmf.23)
Author: Martin Urbanec <martin.urbanec@wikimedia.cz>
Date:   Thu Sep 16 13:30:28 2021 +0200

    Update git submodules

    * Update extensions/GrowthExperiments from branch 'wmf/1.37.0-wmf.23'
      to 9e0f6f84240bf621e97806a94a0e786817001668
      - UncachedMenteeOverviewDataProvider: Do not fatal with zero mentees

        filterMenteesByLastEdit needs to verify $allUserIds is not empty.

        Bug: T291088
        Change-Id: I7496a285f2902523c31abec1c9063b3c41f66acf
        (cherry picked from commit 4d35fc6fec26034722b14b07c3415ddb92c4744b)

diff --git a/extensions/GrowthExperiments b/extensions/GrowthExperiments
index a15cee4a36..9e0f6f8424 160000
--- a/extensions/GrowthExperiments
+++ b/extensions/GrowthExperiments
@@ -1 +1 @@
-Subproject commit a15cee4a362884f43e7abb0e6b57a574db444fc2
+Subproject commit 9e0f6f84240bf621e97806a94a0e786817001668

commit 15dcad24653f0a5ad6166d11bf9583e60381d53f
Author: Daimona Eaytoy <daimona.wiki@gmail.com>
Date:   Wed Sep 15 21:38:47 2021 +0200

    Update git submodules

    * Update extensions/AbuseFilter from branch 'wmf/1.37.0-wmf.23'
      to 01e4450f32bc4098c36aca4865bcf542ff74ca87
      - Bump EditStashCache version

        I0a30e044877c6c858af3ff73f819d5ec7c4cc769 added a new param to
        ParserStatus.

        Bug: T291123
        Change-Id: Ie82d01d85a189081b45a1d34a0f5390536163ee4

diff --git a/extensions/AbuseFilter b/extensions/AbuseFilter
index 0d2bc7ca17..01e4450f32 160000
--- a/extensions/AbuseFilter
+++ b/extensions/AbuseFilter
@@ -1 +1 @@
-Subproject commit 0d2bc7ca17b9f767ae5753db7e4e41fd9e7d3531
+Subproject commit 01e4450f32bc4098c36aca4865bcf542ff74ca87
[urbanecm@deploy1002 /srv/mediawiki-staging/php-1.37.0-wmf.23 (wmf/1.37.0-wmf.23 * u+2-2)]$ git status
On branch wmf/1.37.0-wmf.23
Your branch and 'origin/wmf/1.37.0-wmf.23' have diverged,
and have 2 and 2 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   extensions/AbuseFilter (new commits)
        (redacted)

no changes added to commit (use "git add" and/or "git commit -a")
[urbanecm@deploy1002 /srv/mediawiki-staging/php-1.37.0-wmf.23 (wmf/1.37.0-wmf.23 * u+2-2)]$ cd extensions/AbuseFilter/
[urbanecm@deploy1002 /srv/mediawiki-staging/php-1.37.0-wmf.23/extensions/AbuseFilter (wmf/1.37.0-wmf.23 u=)]$ cd ../NearbyPages/
[urbanecm@deploy1002 /srv/mediawiki-staging/php-1.37.0-wmf.23/extensions/NearbyPages ((622dd04...))]$

According to my investigation you can see above, it appears you checkouted the wmf.23 branch in the AbuseFilter submodule? If that's the right guess, please note that's not the correct way to deploy a backport, see docs. As noted in SAL entries above, I reset that repo to an expected state, and re-synced it. I marked it as a no-op operation, as the few appservers I checked do have the new version of code.

Although I consider myself an experienced deployer, this state of the staging dir confused me a lot, and it took me some time to figure out what happened and how to switch the state back to an expected one.