Page MenuHomePhabricator

LinksUpdate job fails with TypeError in PurgeJobUtils::invalidatePages()
Closed, ResolvedPublic

Description

MediaWiki	1.31.0-alpha (7da7327)
PHP	7.1.1 (apache2handler)
MariaDB	10.1.21-MariaDB
ICU	57.1

Our integration test picked up the following issue with 1.31 which wasn't an issue 19 days ago with the MW master branch.

TypeError from line 35 of ...\includes\jobqueue\utils\PurgeJobUtils.php: Argument 3 passed to PurgeJobUtils::invalidatePages() must be of the type array, null given, called in ...\includes\deferred\LinksUpdate.php on line 405
Notice: TextContent constructed with $text = NULL! This may indicate an error in the caller's scope. [Called from WikitextContent::__construct in ...\includes\content\WikitextContent.php at line 37] in ...\includes\debug\MWDebug.php on line 309
Notice: TextContent constructed with $text = NULL! This may indicate an error in the caller's scope. [Called from WikitextContent::__construct in ...\includes\content\WikitextContent.php at line 37] in ...\includes\debug\MWDebug.php on line 309
Warning: Invalid argument supplied for foreach() in ...\includes\deferred\LinksUpdate.php on line 138
Warning: Invalid argument supplied for foreach() in ...\includes\deferred\LinksUpdate.php on line 143
Warning: Invalid argument supplied for foreach() in ...\includes\deferred\LinksUpdate.php on line 498
Warning: array_diff_key(): Argument #2 is not an array in ...\includes\deferred\LinksUpdate.php on line 784
Warning: array_diff_key(): Argument #1 is not an array in ...\includes\deferred\LinksUpdate.php on line 545
Warning: Invalid argument supplied for foreach() in ...\includes\deferred\LinksUpdate.php on line 546
Warning: array_keys() expects parameter 1 to be array, null given in ...\includes\deferred\LinksUpdate.php on line 462
Warning: array_chunk() expects parameter 1 to be array, null given in ...\includes\deferred\LinksUpdate.php on line 462
Warning: Invalid argument supplied for foreach() in ...\includes\deferred\LinksUpdate.php on line 463
Warning: array_diff_key(): Argument #1 is not an array in ...\includes\deferred\LinksUpdate.php on line 228
Warning: array_keys() expects parameter 1 to be array, integer given in ...\includes\deferred\LinksUpdate.php on line 405
[7985ea4cd4b7d5f403c2f16a] [no req]   TypeError from line 35 of ...\includes\jobqueue\utils\PurgeJobUtils.php: Argument 3 passed to PurgeJobUtils::invalidatePages() must be of the type array, null given, called in ...\includes\deferred\LinksUpdate.php on line 405
Backtrace:
#0 ...\includes\deferred\LinksUpdate.php(405): PurgeJobUtils::invalidatePages(Wikimedia\Rdbms\DatabaseMysqli, integer, NULL)
#1 ...\includes\deferred\LinksUpdate.php(229): LinksUpdate->invalidateImageDescriptions(integer)
#2 ...\includes\deferred\LinksUpdate.php(176): LinksUpdate->doIncrementalUpdate()
#3 ...\includes\deferred\DeferredUpdates.php(259): LinksUpdate->doUpdate()
#4 ...\includes\deferred\DeferredUpdates.php(222): DeferredUpdates::runUpdate(LinksUpdate, Wikimedia\Rdbms\LBFactorySimple, string, integer)
#5 ...\includes\deferred\DeferredUpdates.php(127): DeferredUpdates::execute(array, string, integer)
#6 ...\includes\deferred\DeferredUpdates.php(291): DeferredUpdates::doUpdates(string)
#7 ...\includes\deferred\DeferredUpdates.php(97): DeferredUpdates::tryOpportunisticExecute(string)
#8 ...\includes\page\WikiPage.php(1978): DeferredUpdates::addUpdate(AtomicSectionUpdate, integer)
#9 ...\includes\page\WikiPage.php(1675): WikiPage->doCreate(WikitextContent, integer, User, string, array)

Event Timeline

The issue is still pending with 1.31 but somehow I get the feeling no one really cares since it has been open for one month without any feedback.

@mwjames: As IMHO usual in free software projects, not every task receives feedback due to the sheer number of tasks and limited developer resources. And as IMHO usual in free software projects, if someone cares (whether that is you or somebody else) they are very welcome to propose a patch.
If you believe that this issue is important enough that it should block releasing the stable 1.31 tarball, feel free to add the tag MW-1.31-release. Thanks.

Kizule subscribed.

I think to I know what is problem. Patch coming.

Change 452913 had a related patch set uploaded (by Zoranzoki21; owner: Zoranzoki21):
[mediawiki/core@master] Fix TypeError from line 35

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

On the commit, @aaron wrote:

This seems like a problem with some caller of the method.

Having more context about the failure would be useful to pinpoint the problem.

Change 452913 abandoned by Zoranzoki21:
Fix TypeError from line 35

Reason:
I am not sure how I can fix this, so I abandoning this patch.

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

Kizule removed Kizule as the assignee of this task.Nov 4 2018, 2:58 PM
Kizule removed projects: Patch-For-Review, User-Kizule.
Kizule removed subscribers: gerritbot, Kizule.
Krinkle renamed this task from 1.31 / TypeError from line 35 of ...\includes\jobqueue\utils\PurgeJobUtils.php: Argument 3 passed to PurgeJobUtils::invalidatePages() must be of the type array, null given, called in ...\includes\deferred\LinksUpdate.php on line 405 to LinksUpdate job fails with TypeError in PurgeJobUtils::invalidatePages().Mon, Mar 18, 11:24 PM
Krinkle updated the task description. (Show Details)
Umherirrender subscribed.

With 5c03b91e3b9cd5d88679e155cc526336e044ed95 the type error is now in another function.

The main error seems "Notice: TextContent constructed with $text = NULL! This may indicate an error in the caller's scope.", without wikitext all is invalid in a LinksUpdate and can cause such issues.

Should not happen any more as code was changed many times since the report.