Page MenuHomePhabricator

Flow: fatal error with Flow\SpamFilter\AbuseFilter::__construct() when CI runs doMaintenance.php
Closed, ResolvedPublic

Description

I noticed in deployment-bastion:/data/project/logs/fatal.log three failures in the last hour: 25-Jan-2014 06:02:02, 06:32:02 and 7:02:01 in Flow's SpamFilter setup, e.g.:

[25-Jan-2014 07:02:01] Catchable fatal error: Argument 1 passed to Flow\SpamFilter\AbuseFilter::__construct() must be an instance of User, null given, called in /data/project/apache/common-local/php-master/extensions/Flow/container.php on line 432 and defined at /data/project/apache/common-local/php-master/extensions/Flow/includes/SpamFilter/AbuseFilter.php on line 25

these aren't from the beta labs, they are on deployment-jobrunner08. I suspect they are occurring when our Continuous Infrastructure tries to set up an MW environment, but I'm not sure why it didn't happen earlier. The code is

$c['user'] = $GLOBALS['wgUser'];

so maybe there is no wgUser when running a maintenance script. Code could check for this, or avoid setting up a controller.abusefilter when running maintenance scripts.

The most recent backtrace in fatal.log is

[25-Jan-2014 07:02:01] Catchable fatal error: Argument 1 passed to Flow\SpamFilter\AbuseFilter::construct() must be an instance of User, null given, called in /data/project/apache/common-local/php-master/extensions/Flow/container.php on line 432 and defined at /data/project/apache/common-local/php-master/extensions/Flow/includes/SpamFilter/AbuseFilter.php on line 25
Server: deployment-jobrunner08
URL: http://[unknown-host]
Backtrace:
#0 /data/project/apache/common-local/php-master/extensions/Flow/includes/SpamFilter/AbuseFilter.php(25): Flow\SpamFilter\AbuseFilter::
construct()
#1 /data/project/apache/common-local/php-master/extensions/Flow/container.php(432): Flow\SpamFilter\AbuseFilter->__construct(NULL, 'flow')
#2 /data/project/apache/common-local/php-master/extensions/Flow/vendor/Pimple.php(122): {closure}(Object(Flow\Container))
#3 /data/project/apache/common-local/php-master/extensions/Flow/vendor/Pimple.php(83): {closure}(Object(Flow\Container))
#4 /data/project/apache/common-local/php-master/extensions/Flow/includes/Container.php(31): Pimple->offsetGet('controller.abus...')
#5 /data/project/apache/common-local/php-master/extensions/Flow/Hooks.php(23): Flow\Container::get('controller.abus...')
#6 [internal function]: FlowHooks::initFlowExtension()
#7 /data/project/apache/common-local/php-master/includes/Setup.php(599): call_user_func('FlowHooks::init...')
#8 /data/project/apache/common-local/php-master/maintenance/doMaintenance.php(106): require_once('/data/project/a...')
#9 /data/project/apache/common-local/php-master/maintenance/getConfiguration.php(196): require_once('/data/project/a...')
#10 /data/project/apache/common-local/multiversion/MWScript.php(97): require_once('/data/project/a...')
#11 {main}


Version: master
Severity: major

Details

Reference
bz60418

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:01 AM
bzimport set Reference to bz60418.
bzimport added a subscriber: Unknown Object (MLST).
  • Bug 60530 has been marked as a duplicate of this bug. ***

Change 109927 had a related patch set uploaded by EBernhardson:
Use anonymous user in maintenance scripts

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

Change 109927 merged by jenkins-bot:
Use anonymous user in maintenance scripts

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