Page MenuHomePhabricator

ArgumentCountError on action=help&modules=threadaction
Closed, ResolvedPublic

Description

2020-09-30 14:50:35] exception.ERROR: [e162b7f22eae08ce9ad82973] /w/api.php?action=help&recursivesubmodules=1   ArgumentCountError from line 44 of /srv/mediawiki/workdir/includes/api/ApiEditPage.php: Too few arguments to function ApiEditPage::__construct(), 2 passed in /srv/mediawiki/workdir/vendor/wikimedia/object-factory/src/ObjectFactory.php on line 184 and at least 3 expected {"exception":"[object] (ArgumentCountError(code: 0): Too few arguments to function ApiEditPage::__construct(), 2 passed in /srv/mediawiki/workdir/vendor/wikimedia/object-factory/src/ObjectFactory.php on line 184 and at least 3 expected at /srv/mediawiki/workdir/includes/api/ApiEditPage.php:44)
[stacktrace]
#0 /srv/mediawiki/workdir/vendor/wikimedia/object-factory/src/ObjectFactory.php(184): ApiEditPage->__construct(Object(ApiMain), 'threadaction')
#1 /srv/mediawiki/workdir/vendor/wikimedia/object-factory/src/ObjectFactory.php(102): Wikimedia\\ObjectFactory::getObjectFromSpec(Array, Array)
#2 /srv/mediawiki/workdir/includes/api/ApiModuleManager.php(183): Wikimedia\\ObjectFactory->createObject(Array, Array)
#3 /srv/mediawiki/workdir/includes/api/ApiModuleManager.php(155): ApiModuleManager->instantiateModule('threadaction', Array)
#4 /srv/mediawiki/workdir/includes/api/ApiBase.php(546): ApiModuleManager->getModule('threadaction')
#5 /srv/mediawiki/workdir/includes/api/ApiBase.php(1780): ApiBase->getModuleFromPath('threadaction')
#6 /srv/mediawiki/workdir/includes/api/ApiHelp.php(452): ApiBase->getFinalParamDescription()
#7 /srv/mediawiki/workdir/includes/api/ApiHelp.php(167): ApiHelp::getHelpInternal(Object(DerivativeContext), Array, Array, Array)
#8 /srv/mediawiki/workdir/includes/api/ApiHelp.php(54): ApiHelp::getHelp(Object(DerivativeContext), Array, Array)
#9 /srv/mediawiki/workdir/includes/api/ApiMain.php(1570): ApiHelp->execute()
#10 /srv/mediawiki/workdir/includes/api/ApiMain.php(550): ApiMain->executeAction()
#11 /srv/mediawiki/workdir/includes/api/ApiMain.php(521): ApiMain->executeActionWithErrorHandling()
#12 /srv/mediawiki/workdir/api.php(90): ApiMain->execute()
#13 /srv/mediawiki/workdir/api.php(45): wfApiMain()
#14 {main}
","exception_id":"e162b7f22eae08ce9ad82973","exception_url":"/w/api.php?action=help&recursivesubmodules=1","caught_by":"entrypoint"} []

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Also seeing this with the same URL now:

2020-09-30 14:50:35] exception.ERROR: [e162b7f22eae08ce9ad82973] /w/api.php?action=help&recursivesubmodules=1   ArgumentCountError from line 44 of /srv/mediawiki/workdir/includes/api/ApiEditPage.php: Too few arguments to function ApiEditPage::__construct(), 2 passed in /srv/mediawiki/workdir/vendor/wikimedia/object-factory/src/ObjectFactory.php on line 184 and at least 3 expected {"exception":"[object] (ArgumentCountError(code: 0): Too few arguments to function ApiEditPage::__construct(), 2 passed in /srv/mediawiki/workdir/vendor/wikimedia/object-factory/src/ObjectFactory.php on line 184 and at least 3 expected at /srv/mediawiki/workdir/includes/api/ApiEditPage.php:44)
[stacktrace]
#0 /srv/mediawiki/workdir/vendor/wikimedia/object-factory/src/ObjectFactory.php(184): ApiEditPage->__construct(Object(ApiMain), 'threadaction')
#1 /srv/mediawiki/workdir/vendor/wikimedia/object-factory/src/ObjectFactory.php(102): Wikimedia\\ObjectFactory::getObjectFromSpec(Array, Array)
#2 /srv/mediawiki/workdir/includes/api/ApiModuleManager.php(183): Wikimedia\\ObjectFactory->createObject(Array, Array)
#3 /srv/mediawiki/workdir/includes/api/ApiModuleManager.php(155): ApiModuleManager->instantiateModule('threadaction', Array)
#4 /srv/mediawiki/workdir/includes/api/ApiBase.php(546): ApiModuleManager->getModule('threadaction')
#5 /srv/mediawiki/workdir/includes/api/ApiBase.php(1780): ApiBase->getModuleFromPath('threadaction')
#6 /srv/mediawiki/workdir/includes/api/ApiHelp.php(452): ApiBase->getFinalParamDescription()
#7 /srv/mediawiki/workdir/includes/api/ApiHelp.php(167): ApiHelp::getHelpInternal(Object(DerivativeContext), Array, Array, Array)
#8 /srv/mediawiki/workdir/includes/api/ApiHelp.php(54): ApiHelp::getHelp(Object(DerivativeContext), Array, Array)
#9 /srv/mediawiki/workdir/includes/api/ApiMain.php(1570): ApiHelp->execute()
#10 /srv/mediawiki/workdir/includes/api/ApiMain.php(550): ApiMain->executeAction()
#11 /srv/mediawiki/workdir/includes/api/ApiMain.php(521): ApiMain->executeActionWithErrorHandling()
#12 /srv/mediawiki/workdir/api.php(90): ApiMain->execute()
#13 /srv/mediawiki/workdir/api.php(45): wfApiMain()
#14 {main}
","exception_id":"e162b7f22eae08ce9ad82973","exception_url":"/w/api.php?action=help&recursivesubmodules=1","caught_by":"entrypoint"} []

Just FYI, there is another error I found today seemingly also related to LiquidThreads. I think there is a slim change they are related, but noting for completeness: T264198: PHP warnings from ParserOptions::optionsHash

Change 631024 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Revert "ApiEditPage: Show existing watchlist expiry if status is not being changed."

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

@Nikerabbit I don't have liquid threads installed locally, nor is it enabled on patch demo. Can you test if the revert fixes the issue locally (if you have the extension installed locally)?

I also noticed this is causing test failures in MassMessage, i.e. it is a merge blocker as well: https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-php72-noselenium-docker/38696/console

@DannyS712 when I was testing locally, I got the error in the task description after reverting rMW07e547f47cae: ApiEditPage: Show existing watchlist expiry if status is not being changed.. So I think there might be two related or unrelated errors. I don't know what is causing the other one.

I also noticed this is causing test failures in MassMessage, i.e. it is a merge blocker as well: https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-php72-noselenium-docker/38696/console

@DannyS712 when I was testing locally, I got the error in the task description after reverting rMW07e547f47cae: ApiEditPage: Show existing watchlist expiry if status is not being changed.. So I think there might be two related or unrelated errors. I don't know what is causing the other one.

MassMessage sends liquid threads posts with the threadaction api, which is an api module that extends ApiEditPage but doesn't have the dependencies it needs injected. Any attempts to create an instance of that api class should be triggering this error

To reduce confusion, I am repurposing this task for the error in my first comment, and file a new task for the other error.

Nikerabbit renamed this task from Scalar parameter must be a string, number, or MessageValue; got boolean to ArgumentCountError on action=help&modules=threadaction.Sep 30 2020, 3:55 PM
Nikerabbit updated the task description. (Show Details)

Could we solicit some help to get LiquidThreads fixed?

Could we solicit some help to get LiquidThreads fixed?

Might take some time, since extension lacks a code steward T187487: LiquidThreads: code stewardship review

Change 631024 merged by jenkins-bot:
[mediawiki/core@master] Revert "ApiEditPage: Show existing watchlist expiry if status is not being changed."

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

Filed T264213: ApiThreadAction extends ApiEditPage for the underlying issue with LiquidThread. Sending a patch to add a note to ApiEditPage that it is currently being extended and that anything that would break LiquidThreads would break WMF production and thus should not be done

Change 631025 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] ApiEditPage: Document that it is extended

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

Change 631222 had a related patch set uploaded (by Ammarpad; owner: Ammarpad):
[mediawiki/core@master] Revert "Revert "ApiEditPage: Show existing watchlist expiry if status is not being changed.""

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

Change 631222 merged by jenkins-bot:
[mediawiki/core@master] Revert "Revert "ApiEditPage: Show existing watchlist expiry if status is not being changed.""

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

Ammarpad lowered the priority of this task from Unbreak Now! to Medium.

Change 631025 merged by jenkins-bot:
[mediawiki/core@master] ApiEditPage: Document that it is extended

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

DannyS712 raised the priority of this task from Medium to Unbreak Now!.Oct 6 2020, 8:33 PM

UBN was the proper priority, since this was a train blocker

1.36.0-wmf.12 has been cancelled and will not be deployed. We will do wmf.11 next week. See https://lists.wikimedia.org/pipermail/wikitech-l/2020-October/093944.html