Page MenuHomePhabricator

PHP error from Special:ExportTranslations: "get_class() expects parameter 1 to be object, null given"
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

Request URL: /wiki/Special:ExportTranslations? …
Request ID: XSRnzgpAMEsAAIV1JNAAAAAT

message
PHP Warning: get_class() expects parameter 1 to be object, null given
trace
#0 /srv/mediawiki/php-1.34.0-wmf.11/extensions/Translate/ffs/SimpleFFS.php(274): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.34.0-wmf.11/extensions/Translate/ffs/SimpleFFS.php(234): SimpleFFS->tryReadSource(string, MessageCollection)
#2 /srv/mediawiki/php-1.34.0-wmf.11/extensions/Translate/specials/SpecialExportTranslations.php(198): SimpleFFS->writeIntoVariable(MessageCollection)
#3 /srv/mediawiki/php-1.34.0-wmf.11/extensions/Translate/specials/SpecialExportTranslations.php(49): SpecialExportTranslations->doExport()
#4 /srv/mediawiki/php-1.34.0-wmf.11/includes/specialpage/SpecialPage.php(571): SpecialExportTranslations->execute(NULL)
#5 /srv/mediawiki/php-1.34.0-wmf.11/includes/specialpage/SpecialPageFactory.php(581): SpecialPage->run(NULL)
#6 /srv/mediawiki/php-1.34.0-wmf.11/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#7 /srv/mediawiki/php-1.34.0-wmf.11/includes/MediaWiki.php(884): MediaWiki->performRequest()
#8 /srv/mediawiki/php-1.34.0-wmf.11/includes/MediaWiki.php(515): MediaWiki->main()
#9 /srv/mediawiki/php-1.34.0-wmf.11/index.php(42): MediaWiki->run()
#10 /srv/mediawiki/w/index.php(3): require(string)
#11 {main}

Impact

Unable to export translatable pages or aggregate groups (not sure if both are affected) for offline translation if PHP 7.2 is used (it's becoming the default in near future).

Notes

From Logstash:

  • Since at least 1.34.0-wmf.8 (25 days ago)
  • From mediawiki.org, wikidata.org, meta.wikimedia.org, commons.wikimedia.org.
  • Does not affect HHVM, only the PHP 7.2 deployments emit the warning.

Event Timeline

Krinkle created this task.Jul 10 2019, 8:43 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 10 2019, 8:43 PM

Is there a way to force PHP7.2 for testing?

Note: Explicitly passing NULL as the object is no longer allowed as of PHP 7.2.0.

Is there a way to force PHP7.2 for testing?

Manually adding a cookie named PHP_ENGINE with value php7 should work.

Pginer-WMF triaged this task as Medium priority.Jul 16 2019, 7:58 AM
abi_ added a subscriber: abi_.Jul 16 2019, 8:36 AM

The fix should be simple, just check if the group returns null for FFS before comparing the classes.

Change 528729 had a related patch set uploaded (by Abijeet Patro; owner: Abijeet Patro):
[mediawiki/extensions/Translate@master] Fix null warning error thrown by get_class during translation exports

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

Change 528729 merged by jenkins-bot:
[mediawiki/extensions/Translate@master] Fix null warning error thrown by get_class during translation exports

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

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:06 PM
Krinkle closed this task as Resolved.Aug 29 2019, 12:30 AM