Page MenuHomePhabricator

Flow/TemplateHelper: Trying to access array offset on value of type null
Open, LowPublicPRODUCTION 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=*
Related Changes in Gerrit:

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

brennen subscribed.

Still, unsurprisingly, a thing in 1.44.0-wmf.8 (T375667).

Still, unsurprisingly, a thing in 1.44.0-wmf.8 (T375667).

logstash link shows errors on testwiki and idwiki. I looked at one of the url on testwiki wmf.8 - https://test.wikipedia.org/w/index.php?action=compare-post-revisions&title=Topic:Tiickkn4twpce2xx&topic_newRevision=ujp0b4nd89sn23sk&topic_oldRevision=ufsvzmittut0lkj0.

Screen Shot 2024-12-23 at 11.20.47 AM.png (714×2 px, 117 KB)
. The History states that the topics were deleted.

The example on idwiki can be viewed here.. The logstash error is easily triggered by visiting such pages and clicking on the links "Version by from".

Error
normalized_message
[{reqId}] {exception_url}   PHP Notice: Trying to access array offset on value of type null
FrameLocationCall
from/srv/mediawiki/php-1.44.0-wmf.19/extensions/Flow/includes/TemplateHelper.php(576)
#0/srv/mediawiki/php-1.44.0-wmf.19/extensions/Flow/includes/TemplateHelper.php(576)MWExceptionHandler::handleError(int, string, string, int, array)
#1[internal function]Flow\TemplateHelper::diffRevision(null, array)
#2/srv/mediawiki/php-1.44.0-wmf.19/vendor/zordius/lightncandy/src/Runtime.php(706)call_user_func_array(string, array)
#3/srv/mediawiki/php-1.44.0-wmf.19/vendor/zordius/lightncandy/src/Runtime.php(597)LightnCandy\Runtime::exch(array, string, array, array)
#4/srv/mediawiki/php-1.44.0-wmf.19/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.44.0-wmf.19/extensions/Flow/includes/TemplateHelper.php(114)Flow\TemplateHelper->{closure}(array, array)
#6/srv/mediawiki/php-1.44.0-wmf.19/extensions/Flow/includes/TemplateHelper.php(192)Flow\TemplateHelper::Flow\{closure}(array, array)
#7/srv/mediawiki/php-1.44.0-wmf.19/extensions/Flow/includes/TemplateHelper.php(275)Flow\TemplateHelper::processTemplate(string, array)
#8[internal function]Flow\TemplateHelper::block(array, array)
#9/srv/mediawiki/php-1.44.0-wmf.19/vendor/zordius/lightncandy/src/Runtime.php(706)call_user_func_array(string, array)
#10/srv/mediawiki/php-1.44.0-wmf.19/vendor/zordius/lightncandy/src/Runtime.php(597)LightnCandy\Runtime::exch(array, string, array, array)
#11/srv/mediawiki/php-1.44.0-wmf.19/extensions/Flow/handlebars/compiled/flow_block_loop.handlebars.php(33)LightnCandy\Runtime::hbch(array, string, array, string, array)
#12/srv/mediawiki/php-1.44.0-wmf.19/vendor/zordius/lightncandy/src/Runtime.php(413)Flow\TemplateHelper->{closure}(array, array)
#13/srv/mediawiki/php-1.44.0-wmf.19/extensions/Flow/handlebars/compiled/flow_block_loop.handlebars.php(34)LightnCandy\Runtime::sec(array, array, null, array, bool, Closure)
#14/srv/mediawiki/php-1.44.0-wmf.19/extensions/Flow/includes/TemplateHelper.php(114)Flow\TemplateHelper->{closure}(array, array)
#15/srv/mediawiki/php-1.44.0-wmf.19/extensions/Flow/includes/View.php(376)Flow\TemplateHelper::Flow\{closure}(array)
#16/srv/mediawiki/php-1.44.0-wmf.19/extensions/Flow/includes/View.php(88)Flow\View->renderApiResponse(array, array)
#17/srv/mediawiki/php-1.44.0-wmf.19/extensions/Flow/includes/Actions/FlowAction.php(100)Flow\View->show(Flow\WorkflowLoader, string)
#18/srv/mediawiki/php-1.44.0-wmf.19/extensions/Flow/includes/Actions/FlowAction.php(48)Flow\Actions\FlowAction->showForAction(string)
#19/srv/mediawiki/php-1.44.0-wmf.19/includes/actions/ActionEntryPoint.php(732)Flow\Actions\FlowAction->show()
#20/srv/mediawiki/php-1.44.0-wmf.19/includes/actions/ActionEntryPoint.php(509)MediaWiki\Actions\ActionEntryPoint->performAction(Article, MediaWiki\Title\Title)
#21/srv/mediawiki/php-1.44.0-wmf.19/includes/actions/ActionEntryPoint.php(145)MediaWiki\Actions\ActionEntryPoint->performRequest()
#22/srv/mediawiki/php-1.44.0-wmf.19/includes/MediaWikiEntryPoint.php(202)MediaWiki\Actions\ActionEntryPoint->execute()
#23/srv/mediawiki/php-1.44.0-wmf.19/index.php(58)MediaWiki\MediaWikiEntryPoint->run()
#24/srv/mediawiki/w/index.php(3)require(string)
#25{main}
Impact
Notes

^ Note that that is slightly different to the original flow_block_topicsummary_diff_view vs flow_block_topic_diff_view.handlebars

Reedy triaged this task as Low priority.Mar 13 2025, 5:23 PM

And is maybe more common, depending on page usage, and maybe because of the Flow board migration...

30 in the last hour, for example

This callstack isn't directly caused by Flow cleanup bot (which is still running manually churning through the big pile of edge cases). But it might be me viewing more Flow boards than usual to make sure that the bot is behaving correctly. Or it might be unrelated.

I saw a burst of similar errors today. These are logged as PHP Warning rather than PHP Notice:

PHP Warning: Trying to access array offset on value of type null

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

Error
normalized_message
[{reqId}] {exception_url}   PHP Warning: Trying to access array offset on value of type null
FrameLocationCall
from/srv/mediawiki/php-1.45.0-wmf.2/extensions/Flow/includes/TemplateHelper.php(578)
#0/srv/mediawiki/php-1.45.0-wmf.2/extensions/Flow/includes/TemplateHelper.php(578)MediaWiki\Exception\MWExceptionHandler::handleError(int, string, string, int)
#1[internal function]Flow\TemplateHelper::diffRevision(null, array)
#2/srv/mediawiki/php-1.45.0-wmf.2/vendor/zordius/lightncandy/src/Runtime.php(706)call_user_func_array(string, array)
#3/srv/mediawiki/php-1.45.0-wmf.2/vendor/zordius/lightncandy/src/Runtime.php(597)LightnCandy\Runtime::exch(array, string, array, array)
#4/srv/mediawiki/php-1.45.0-wmf.2/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.45.0-wmf.2/extensions/Flow/includes/TemplateHelper.php(115)Flow\TemplateHelper->{closure}(array, array)
#6/srv/mediawiki/php-1.45.0-wmf.2/extensions/Flow/includes/TemplateHelper.php(193)Flow\TemplateHelper::Flow\{closure}(array, array)
#7/srv/mediawiki/php-1.45.0-wmf.2/extensions/Flow/includes/TemplateHelper.php(276)Flow\TemplateHelper::processTemplate(string, array)
#8[internal function]Flow\TemplateHelper::block(array, array)
#9/srv/mediawiki/php-1.45.0-wmf.2/vendor/zordius/lightncandy/src/Runtime.php(706)call_user_func_array(string, array)
#10/srv/mediawiki/php-1.45.0-wmf.2/vendor/zordius/lightncandy/src/Runtime.php(597)LightnCandy\Runtime::exch(array, string, array, array)
#11/srv/mediawiki/php-1.45.0-wmf.2/extensions/Flow/handlebars/compiled/flow_block_loop.handlebars.php(33)LightnCandy\Runtime::hbch(array, string, array, string, array)
#12/srv/mediawiki/php-1.45.0-wmf.2/vendor/zordius/lightncandy/src/Runtime.php(413)Flow\TemplateHelper->{closure}(array, array)
#13/srv/mediawiki/php-1.45.0-wmf.2/extensions/Flow/handlebars/compiled/flow_block_loop.handlebars.php(34)LightnCandy\Runtime::sec(array, array, null, array, bool, Closure)
#14/srv/mediawiki/php-1.45.0-wmf.2/extensions/Flow/includes/TemplateHelper.php(115)Flow\TemplateHelper->{closure}(array, array)
#15/srv/mediawiki/php-1.45.0-wmf.2/extensions/Flow/includes/View.php(376)Flow\TemplateHelper::Flow\{closure}(array)
#16/srv/mediawiki/php-1.45.0-wmf.2/extensions/Flow/includes/View.php(88)Flow\View->renderApiResponse(array, array)
#17/srv/mediawiki/php-1.45.0-wmf.2/extensions/Flow/includes/Actions/FlowAction.php(100)Flow\View->show(Flow\WorkflowLoader, string)
#18/srv/mediawiki/php-1.45.0-wmf.2/extensions/Flow/includes/Actions/FlowAction.php(48)Flow\Actions\FlowAction->showForAction(string)
#19/srv/mediawiki/php-1.45.0-wmf.2/includes/actions/ActionEntryPoint.php(728)Flow\Actions\FlowAction->show()
#20/srv/mediawiki/php-1.45.0-wmf.2/includes/actions/ActionEntryPoint.php(505)MediaWiki\Actions\ActionEntryPoint->performAction(MediaWiki\Page\Article, MediaWiki\Title\Title)
#21/srv/mediawiki/php-1.45.0-wmf.2/includes/actions/ActionEntryPoint.php(143)MediaWiki\Actions\ActionEntryPoint->performRequest()
#22/srv/mediawiki/php-1.45.0-wmf.2/includes/MediaWikiEntryPoint.php(198)MediaWiki\Actions\ActionEntryPoint->execute()
#23/srv/mediawiki/php-1.45.0-wmf.2/index.php(58)MediaWiki\MediaWikiEntryPoint->run()
#24/srv/mediawiki/w/index.php(3)require(string)
#25{main}

These arrive in batches of 6 at different line numbers (making it particularly spammy for log watchers).

Change #1169728 had a related patch set uploaded (by Ahmon Dancy; author: Ahmon Dancy):

[operations/puppet@production] logspam.pl: Consolidate T322462 log messages

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

Change #1169728 merged by Dzahn:

[operations/puppet@production] logspam.pl: Consolidate T322462 log messages

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

Still occurring in 1.46.0-wmf.19 (T413810). Rate seems slightly elevated since wmf.16 or so, for whatever reason.