Page MenuHomePhabricator

Flow/TemplateHelper: Trying to access array offset on value of type null
Open, Needs TriagePublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   PHP Notice: Trying to access array offset on value of type null
exception.trace
from /srv/mediawiki/php-1.40.0-wmf.8/extensions/Flow/includes/TemplateHelper.php(578)
#0 /srv/mediawiki/php-1.40.0-wmf.8/extensions/Flow/includes/TemplateHelper.php(578): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 [internal function]: Flow\TemplateHelper::diffRevision(NULL, array)
#2 /srv/mediawiki/php-1.40.0-wmf.8/vendor/zordius/lightncandy/src/Runtime.php(706): call_user_func_array(string, array)
#3 /srv/mediawiki/php-1.40.0-wmf.8/vendor/zordius/lightncandy/src/Runtime.php(597): LightnCandy\Runtime::exch(array, string, array, array)
#4 /srv/mediawiki/php-1.40.0-wmf.8/extensions/Flow/handlebars/compiled/flow_block_topicsummary_diff_view.handlebars.php(47): LightnCandy\Runtime::hbch(array, string, array, string, array)
#5 /srv/mediawiki/php-1.40.0-wmf.8/extensions/Flow/includes/TemplateHelper.php(114): Flow\TemplateHelper->{closure}(array, array)
#6 /srv/mediawiki/php-1.40.0-wmf.8/extensions/Flow/includes/TemplateHelper.php(192): Flow\TemplateHelper::Flow\{closure}(array, array)
#7 /srv/mediawiki/php-1.40.0-wmf.8/extensions/Flow/includes/TemplateHelper.php(275): Flow\TemplateHelper::processTemplate(string, array)
#8 [internal function]: Flow\TemplateHelper::block(array, array)
#9 /srv/mediawiki/php-1.40.0-wmf.8/vendor/zordius/lightncandy/src/Runtime.php(706): call_user_func_array(string, array)
#10 /srv/mediawiki/php-1.40.0-wmf.8/vendor/zordius/lightncandy/src/Runtime.php(597): LightnCandy\Runtime::exch(array, string, array, array)
#11 /srv/mediawiki/php-1.40.0-wmf.8/extensions/Flow/handlebars/compiled/flow_block_loop.handlebars.php(33): LightnCandy\Runtime::hbch(array, string, array, string, array)
#12 /srv/mediawiki/php-1.40.0-wmf.8/vendor/zordius/lightncandy/src/Runtime.php(413): Flow\TemplateHelper->{closure}(array, array)
#13 /srv/mediawiki/php-1.40.0-wmf.8/extensions/Flow/handlebars/compiled/flow_block_loop.handlebars.php(34): LightnCandy\Runtime::sec(array, array, NULL, array, boolean, Closure)
#14 /srv/mediawiki/php-1.40.0-wmf.8/extensions/Flow/includes/TemplateHelper.php(114): Flow\TemplateHelper->{closure}(array, array)
#15 /srv/mediawiki/php-1.40.0-wmf.8/extensions/Flow/includes/View.php(376): Flow\TemplateHelper::Flow\{closure}(array)
#16 /srv/mediawiki/php-1.40.0-wmf.8/extensions/Flow/includes/View.php(87): Flow\View->renderApiResponse(array, array)
#17 /srv/mediawiki/php-1.40.0-wmf.8/extensions/Flow/includes/Actions/FlowAction.php(107): Flow\View->show(Flow\WorkflowLoader, string)
#18 /srv/mediawiki/php-1.40.0-wmf.8/extensions/Flow/includes/Actions/FlowAction.php(50): Flow\Actions\FlowAction->showForAction(string)
#19 /srv/mediawiki/php-1.40.0-wmf.8/includes/MediaWiki.php(543): Flow\Actions\FlowAction->show()
#20 /srv/mediawiki/php-1.40.0-wmf.8/includes/MediaWiki.php(323): MediaWiki->performAction(Article, Title)
#21 /srv/mediawiki/php-1.40.0-wmf.8/includes/MediaWiki.php(905): MediaWiki->performRequest()
#22 /srv/mediawiki/php-1.40.0-wmf.8/includes/MediaWiki.php(563): MediaWiki->main()
#23 /srv/mediawiki/php-1.40.0-wmf.8/index.php(50): MediaWiki->run()
#24 /srv/mediawiki/php-1.40.0-wmf.8/index.php(46): wfIndexMain()
#25 /srv/mediawiki/w/index.php(3): require(string)
#26 {main}
Impact

Seems fairly rare.

Notes

Seems like flow_block_topicsummary_diff_view.handlebars is invoked without passing in any data?

Details

Request URL
https://www.mediawiki.org/w/index.php?action=*&title=*&topicsummary_newRevision=*

Event Timeline

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

Seems impossible (if I read the trace correctly, it would imply that TemplateHelper::processTemplate() is invoked with a null args, but it's type-hinted so it can't be null), rare enough that it's not really worth tracking down.

Still happening as of 1.41.0-wmf.5

The error is reproducible by hitting e.g. https://www.mediawiki.org/w/index.php?action=compare-post-revisions&title=Topic:Vxjd6shbjtv9v568&topic_newRevision=vxjmiu6ym6iiljcc&topic_oldRevision=vxjhnm3w7d0z0b2x Each hit to an affected URL generates six log entries.

There was a brief uptick shortly after the deployment of wmf.5 to group 2 this morning, however all instances of the error happen on mediawiki, which is part of group 0 and received wmf.5 on Tuesday. Interestingly, the revision history of the discussion page for the affected pages looks mangled right now: https://www.mediawiki.org/w/index.php?title=Talk:How_to_contribute&action=history The revision history for the page itself seems unaffected. The discussion revision history of other pages in mediawiki also looks healthy: https://www.mediawiki.org/w/index.php?title=Talk:Sites_using_MediaWiki&action=history

I saw a burst of these today, shortly after rolling the 1.43.0-wmf.7 train to group0. Looks like they come in batches of 6 per request. Each has a different line number in the range 556-578.

Error
normalized_message
[{reqId}] {exception_url}   PHP Notice: Trying to access array offset on value of type null
exception.trace
from /srv/mediawiki/php-1.43.0-wmf.7/extensions/Flow/includes/TemplateHelper.php(578)
#0 /srv/mediawiki/php-1.43.0-wmf.7/extensions/Flow/includes/TemplateHelper.php(578): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 [internal function]: Flow\TemplateHelper::diffRevision(NULL, array)
#2 /srv/mediawiki/php-1.43.0-wmf.7/vendor/zordius/lightncandy/src/Runtime.php(706): call_user_func_array(string, array)
#3 /srv/mediawiki/php-1.43.0-wmf.7/vendor/zordius/lightncandy/src/Runtime.php(597): LightnCandy\Runtime::exch(array, string, array, array)
#4 /srv/mediawiki/php-1.43.0-wmf.7/extensions/Flow/handlebars/compiled/flow_block_topic_diff_view.handlebars.php(39): LightnCandy\Runtime::hbch(array, string, array, string, array)
#5 /srv/mediawiki/php-1.43.0-wmf.7/extensions/Flow/includes/TemplateHelper.php(114): Flow\TemplateHelper->{closure}(array, array)
#6 /srv/mediawiki/php-1.43.0-wmf.7/extensions/Flow/includes/TemplateHelper.php(192): Flow\TemplateHelper::Flow\{closure}(array, array)
#7 /srv/mediawiki/php-1.43.0-wmf.7/extensions/Flow/includes/TemplateHelper.php(275): Flow\TemplateHelper::processTemplate(string, array)
#8 [internal function]: Flow\TemplateHelper::block(array, array)
#9 /srv/mediawiki/php-1.43.0-wmf.7/vendor/zordius/lightncandy/src/Runtime.php(706): call_user_func_array(string, array)
#10 /srv/mediawiki/php-1.43.0-wmf.7/vendor/zordius/lightncandy/src/Runtime.php(597): LightnCandy\Runtime::exch(array, string, array, array)
#11 /srv/mediawiki/php-1.43.0-wmf.7/extensions/Flow/handlebars/compiled/flow_block_loop.handlebars.php(33): LightnCandy\Runtime::hbch(array, string, array, string, array)
#12 /srv/mediawiki/php-1.43.0-wmf.7/vendor/zordius/lightncandy/src/Runtime.php(413): Flow\TemplateHelper->{closure}(array, array)
#13 /srv/mediawiki/php-1.43.0-wmf.7/extensions/Flow/handlebars/compiled/flow_block_loop.handlebars.php(34): LightnCandy\Runtime::sec(array, array, NULL, array, boolean, Closure)
#14 /srv/mediawiki/php-1.43.0-wmf.7/extensions/Flow/includes/TemplateHelper.php(114): Flow\TemplateHelper->{closure}(array, array)
#15 /srv/mediawiki/php-1.43.0-wmf.7/extensions/Flow/includes/View.php(376): Flow\TemplateHelper::Flow\{closure}(array)
#16 /srv/mediawiki/php-1.43.0-wmf.7/extensions/Flow/includes/View.php(88): Flow\View->renderApiResponse(array, array)
#17 /srv/mediawiki/php-1.43.0-wmf.7/extensions/Flow/includes/Actions/FlowAction.php(103): Flow\View->show(Flow\WorkflowLoader, string)
#18 /srv/mediawiki/php-1.43.0-wmf.7/extensions/Flow/includes/Actions/FlowAction.php(50): Flow\Actions\FlowAction->showForAction(string)
#19 /srv/mediawiki/php-1.43.0-wmf.7/includes/actions/ActionEntryPoint.php(731): Flow\Actions\FlowAction->show()
#20 /srv/mediawiki/php-1.43.0-wmf.7/includes/actions/ActionEntryPoint.php(508): MediaWiki\Actions\ActionEntryPoint->performAction(Article, MediaWiki\Title\Title)
#21 /srv/mediawiki/php-1.43.0-wmf.7/includes/actions/ActionEntryPoint.php(145): MediaWiki\Actions\ActionEntryPoint->performRequest()
#22 /srv/mediawiki/php-1.43.0-wmf.7/includes/MediaWikiEntryPoint.php(200): MediaWiki\Actions\ActionEntryPoint->execute()
#23 /srv/mediawiki/php-1.43.0-wmf.7/index.php(58): MediaWiki\MediaWikiEntryPoint->run()
#24 /srv/mediawiki/w/index.php(3): require(string)
#25 {main}
Impact
Notes

Seems like this happens whenever someone uses compare-post-revisions on a Flow page. The net result is a page that shows something like:

This page shows the changes between two versions of a post by in the topic "[ ]" on [ ]. You can see other versions of this post at its [ history page].

Seeing lots of spikes of these recently, any investigation here appreciated <3