Page MenuHomePhabricator

Scap beta failing on mweval
Closed, ResolvedPublic

Description

03:14:22 10:14:22 Scap failed!: Call to mwscript eval.php returned: 255
03:14:22 10:14:22 stderr: Deprecated: Non-static method Monolog\Logger::setTimezone() should not be called statically in /srv/mediawiki-staging/wmf-config/logging.php on line 393
03:14:22 Fatal error: Uncaught Error: Using $this when not in object context in /srv/mediawiki-staging/php-master/vendor/monolog/monolog/src/Monolog/Logger.php:588
03:14:22 Stack trace:
03:14:22 #0 /srv/mediawiki-staging/wmf-config/logging.php(393): Monolog\Logger::setTimezone(Object(DateTimeZone))
03:14:22 #1 /srv/mediawiki-staging/wmf-config/CommonSettings.php(250): require('/srv/mediawiki-...')
03:14:22 #2 /srv/mediawiki-staging/php-master/LocalSettings.php(5): require('/srv/mediawiki-...')
03:14:22 #3 /srv/mediawiki-staging/php-master/includes/Setup.php(143): require_once('/srv/mediawiki-...')
03:14:22 #4 /srv/mediawiki-staging/php-master/maintenance/doMaintenance.php(90): require_once('/srv/mediawiki-...')
03:14:22 #5 /srv/mediawiki-staging/php-master/maintenance/CommandLineInc.php(74): require('/srv/mediawiki-...')
03:14:22 #6 /srv/mediawiki-staging/php-master/maintenance/eval.php(39): require_once('/srv/mediawiki-...')
03:14:22 #7 /srv/mediawiki-staging/multiversion/MWScript.php(101): require_once('/srv/mediawiki-...')
03:14:22 #8 {main}
03:14:22   thrown in /srv/mediawiki-staging/php-master/vendor/monolog/monolog/src/Monolog/Logger.php on line 588
03:14:22 Fatal error: Uncaught Error: Class 'RequestContext' not found in /srv/mediawiki-staging/php-master/includes/WebRequest.php:333
03:14:22 Stack trace:
03:14:22 #0 /srv/mediawiki-staging/php-master/includes/HeaderCallback.php(70): WebRequest::getRequestId()
03:14:22 #1 [internal function]: MediaWiki\HeaderCallback::callback()
03:14:22 #2 {main}
03:14:22   thrown in /srv/mediawiki-staging/php-master/includes/WebRequest.php on line 333

Looks like this might be related to https://gerrit.wikimedia.org/r/c/mediawiki/vendor/+/579666

Event Timeline

So bd808 added setTimezone in https://github.com/Seldaek/monolog/commit/5d7db08106dc276b6693b64a4a87428ab8c62779 and it was made non static in https://github.com/Seldaek/monolog/commit/6505e02fd3a52dc9c1180a76975403fd377c1a1c as part of monolog 2.0

The timezone is now set per Logger instance and not statically, either via ->setTimezone or passed in the constructor. Calls to Logger::setTimezone should be converted.

Based on the comment of wmgMonologLoggerCalls in logging.php... I think we can use that

Post construction calls to make for new Logger instances

Change 641740 had a related patch set uploaded (by Reedy; owner: Reedy):
[operations/mediawiki-config@master] logging.php: Monolog\Logger::setTimezone is no longer static

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

That's calling a static function non statically... Which I think shouldn't result in any logspam (the other way round would, of course)

At least for wmf-prod transition until monolog 2.0 is out on the wikis

Change 641740 merged by jenkins-bot:
[operations/mediawiki-config@master] logging.php: Monolog\Logger::setTimezone is no longer static

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

Mentioned in SAL (#wikimedia-operations) [2020-11-18T16:38:09Z] <reedy@deploy1001> Synchronized wmf-config/logging.php: T268141 (duration: 01m 06s)

See what the next scap run does

Ok, so now we have a different error...

16:44:29 16:44:29 stderr: Fatal error: Uncaught TypeError: Argument 3 passed to MediaWiki\Logger\Monolog\LogstashFormatter::__construct() must be of the type string, null given, called in /srv/mediawiki-staging/php-master/vendor/wikimedia/object-factory/src/ObjectFactory.php on line 244 and defined in /srv/mediawiki-staging/php-master/includes/debug/logger/monolog/LogstashFormatter.php:39
16:44:29 Stack trace:
16:44:29 #0 /srv/mediawiki-staging/php-master/vendor/wikimedia/object-factory/src/ObjectFactory.php(244): MediaWiki\Logger\Monolog\LogstashFormatter->__construct('mediawiki', 'deployment-depl...', NULL, '', 1)
16:44:29 #1 /srv/mediawiki-staging/php-master/includes/debug/logger/MonologSpi.php(284): Wikimedia\ObjectFactory::getObjectFromSpec(Array)
16:44:29 #2 /srv/mediawiki-staging/php-master/includes/debug/logger/MonologSpi.php(265): MediaWiki\Logger\MonologSpi->getFormatter('cee')
16:44:29 #3 [internal function]: MediaWiki\Logger\MonologSpi->getHandler('logstash-info')
16:44:29 #4 /srv/mediawiki-staging/wmf-config/logging.php(351): array_map(Array, Array)
16:44:29 #5 /srv/mediawiki-staging/php-master/v in /srv/mediawiki-staging/php-master/includes/debug/logger/monolog/LogstashFormatter.php on line 39
16:44:29 Fatal error: Uncaught TypeError: Argument 3 passed to MediaWiki\Logger\Monolog\LogstashFormatter::__construct() must be of the type string, null given, called in /srv/mediawiki-staging/php-master/vendor/wikimedia/object-factory/src/ObjectFactory.php on line 244 and defined in /srv/mediawiki-staging/php-master/includes/debug/logger/monolog/LogstashFormatter.php:39
16:44:29 Stack trace:
16:44:29 #0 /srv/mediawiki-staging/php-master/vendor/wikimedia/object-factory/src/ObjectFactory.php(244): MediaWiki\Logger\Monolog\LogstashFormatter->__construct('mediawiki', 'deployment-depl...', NULL, '', 1)
16:44:29 #1 /srv/mediawiki-staging/php-master/includes/debug/logger/MonologSpi.php(284): Wikimedia\ObjectFactory::getObjectFromSpec(Array)
16:44:29 #2 /srv/mediawiki-staging/php-master/includes/debug/logger/MonologSpi.php(265): MediaWiki\Logger\MonologSpi->getFormatter('cee')
16:44:29 #3 [internal function]: MediaWiki\Logger\MonologSpi->getHandler('logstash-info')
16:44:29 #4 /srv/mediawiki-staging/wmf-config/logging.php(351): array_map(Array, Array)
16:44:29 #5 /srv/mediawiki-staging/php-master/v in /srv/mediawiki-staging/php-master/includes/debug/logger/monolog/LogstashFormatter.php on line 39

Change 641788 had a related patch set uploaded (by Reedy; owner: Reedy):
[operations/mediawiki-config@master] logging.php: Set call to CeeFormatter::__construct to pass '' for

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

Change 641788 merged by jenkins-bot:
[operations/mediawiki-config@master] logging.php: Set call to CeeFormatter::__construct to pass '' for

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

Reedy closed this task as Resolved.EditedNov 18 2020, 5:40 PM
Reedy claimed this task.

Looks to have unblocked scap with the second patch

Resolving for now. Feel free to reopen if it's broken further down for seemingly related issues in scap/beta