Page MenuHomePhabricator

Error examining edit in management interface: "includes/Views/AbuseFilterViewExamine.php: Call to a member function dumpAllVars() on null"
Closed, ResolvedPublicPRODUCTION ERROR

Description

Special:AbuseFilter/examine/76582973 on English Wiktionary shows an error: [17775ae6-a6a5-4e42-831c-3b8a15382cc5] 2020-06-16 23:07:20: Fatal exception of type "Error". (The hex part changes each time I reload the page.) This does not happen if I increment or decrement the revision number: Special:AbuseFilter/examine/76582972, Special:AbuseFilter/examine/76582974. This error occurred when I tried to examine revision #59551761.

Details

Request ID
55c4d3c9-7ef8-414b-b6ea-9c5310aa62c
Request URL
https://en.wiktionary.org/wiki/Special:AbuseFilter/examine/76582973
Stack Trace

[17775ae6-a6a5-4e42-831c-3b8a15382cc5] /wiki/Special:AbuseFilter/examine/76582973 Error from line 134 of /srv/mediawiki/php-1.35.0-wmf.36/extensions/AbuseFilter/includes/Views/AbuseFilterViewExamine.php: Call to a member function dumpAllVars() on null
#0 /srv/mediawiki/php-1.35.0-wmf.36/extensions/AbuseFilter/includes/Views/AbuseFilterViewExamine.php(41): AbuseFilterViewExamine->showExaminerForRC(string)
#1 /srv/mediawiki/php-1.35.0-wmf.36/extensions/AbuseFilter/includes/special/SpecialAbuseFilter.php(139): AbuseFilterViewExamine->show()
#2 /srv/mediawiki/php-1.35.0-wmf.36/includes/specialpage/SpecialPage.php(580): SpecialAbuseFilter->execute(string)
#3 /srv/mediawiki/php-1.35.0-wmf.36/includes/specialpage/SpecialPageFactory.php(634): SpecialPage->run(string)
#4 /srv/mediawiki/php-1.35.0-wmf.36/includes/MediaWiki.php(307): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#5 /srv/mediawiki/php-1.35.0-wmf.36/includes/MediaWiki.php(986): MediaWiki->performRequest()
#6 /srv/mediawiki/php-1.35.0-wmf.36/includes/MediaWiki.php(543): MediaWiki->main()
#7 /srv/mediawiki/php-1.35.0-wmf.36/index.php(47): MediaWiki->run()
#8 /srv/mediawiki/w/index.php(3): require(string)
#9 {main}

Event Timeline

DannyS712 changed the subtype of this task from "Bug Report" to "Production Error".Jun 16 2020, 11:15 PM
Aklapper renamed this task from Error when examining edit in Abuse Filter management interface to Error examining edit in management interface: "includes/Views/AbuseFilterViewExamine.php: Call to a member function dumpAllVars() on null".Jun 17 2020, 7:56 AM
Aklapper set Request URL to https://en.wiktionary.org/wiki/Special:AbuseFilter/examine/76582973.
Aklapper set Request ID to 55c4d3c9-7ef8-414b-b6ea-9c5310aa62c.
Daimona set Phatality ID to 35c168043e4385705d5b3aa39a3ebb353d552cdbb7fc3acf40bb7fa9101fdce4.

Uhm, apparently it fixed itself??!! I began investigating locally, but couldn't reproduce the issue. I tried querying enwiktionary_p.recentchanges, but the row isn't available on replicas:

select rc_id from recentchanges where rc_id between 76582971 and 76582975

rc_id
76582971
76582972
76582974
76582975

I think this might happen because the entry is deleted, so I tried deleting a revision locally, but the examiner still works. I also tried /examine for a RC entry that doesn't exist, but I got "The change you requested could not be found" and no error. I then tried visiting the original URL in the task description, and I'm now getting "The change you requested could not be found." there as well.

Was the edit deleted in the meanwhile? What's stored in recentchanges with rc_id == 76582973?

It is also not shown by api (https://en.wiktionary.org/w/api.php?action=query&list=recentchanges&rclimit=10&rcstart=2020-06-16T22:22:30Z)

It fails on the dumpAllVars here:

		$vars = new AbuseFilterVariableHolder();
		$varGenerator = new RCVariableGenerator( $vars, $rc );
		$vars = $varGenerator->getVars();
		$out->addJsConfigVars( [
			'wgAbuseFilterVariables' => $vars->dumpAllVars( true ),
			'abuseFilterExamine' => [ 'type' => 'rc', 'id' => $rcid ]
		] );

Returning null from $varGenerator->getVars() was also possible before my patch set (rEABF82f549bed9ed), but for all logs types not upload/newusers/delete/move it is now done always. Maybe before there was always taken as edit, because getAssociatedRevId was returning non null value?

Change 606227 had a related patch set uploaded (by Umherirrender; owner: Umherirrender):
[mediawiki/extensions/AbuseFilter@master] Handle null from VariableGenerator::getVars in AbuseFilterViewExamine

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

Yeah, I think the only way is to run a query on the actual DB. I'd also like to know what the RC entry was in the first place (@Erutuon).

Returning null from $varGenerator->getVars() was also possible before my patch set (rEABF82f549bed9ed), but for all logs types not upload/newusers/delete/move it is now done always. Maybe before there was always taken as edit, because getAssociatedRevId was returning non null value?

It's possible. Either way, answers to the questions above should help clarify.

Change 606227 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Handle null from VariableGenerator::getVars in AbuseFilterViewExamine

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

Umherirrender claimed this task.