Page MenuHomePhabricator

PHP fatal error: Argument 1 passed to MessageGroups::isDynamic() must implement interface MessageGroup, null given
Closed, ResolvedPublic

Description

Reported on https://www.mediawiki.org/wiki/Topic:Uo4rqw7efmppoxlo, can reproduce consistently

Editing and saving https://www.mediawiki.org/wiki/Translations:Manual:List_of_MediaWiki_configuration_settings_containing_sensitive_data/4/ja or https://www.mediawiki.org/wiki/Translations:Manual:List_of_MediaWiki_configuration_settings_containing_sensitive_data/Page_display_title/ja gives a fatal error (a white WMF error page):

PHP fatal error:
Argument 1 passed to MessageGroups::isDynamic() must implement interface MessageGroup, null given

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 9 2018, 10:23 AM

Trace from logstash

#0 /srv/mediawiki/php-1.33.0-wmf.3/extensions/Translate/utils/MessageGroupStats.php(78): NO_FUNCTION_GIVEN()
#1 /srv/mediawiki/php-1.33.0-wmf.3/extensions/Translate/utils/MessageGroupStats.php(157): MessageGroupStats::forItem(string, string, integer)
#2 /srv/mediawiki/php-1.33.0-wmf.3/extensions/Translate/TranslateEditAddons.php(234): MessageGroupStats::clear(MessageHandle)
#3 /srv/mediawiki/php-1.33.0-wmf.3/includes/Hooks.php(174): TranslateEditAddons::onSave(WikiPage, User, WikitextContent, string, integer, NULL, NULL, integer, Revision, Status, boolean, integer)
#4 /srv/mediawiki/php-1.33.0-wmf.3/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
#5 /srv/mediawiki/php-1.33.0-wmf.3/includes/Storage/PageUpdater.php(1214): Hooks::run(string, array)
#6 /srv/mediawiki/php-1.33.0-wmf.3/includes/libs/rdbms/database/Database.php(3806): Closure$MediaWiki\Storage\PageUpdater::getAtomicSectionUpdate(Wikimedia\Rdbms\DatabaseMysqli, string)
#7 /srv/mediawiki/php-1.33.0-wmf.3/includes/libs/rdbms/database/DBConnRef.php(49): Wikimedia\Rdbms\Database->doAtomicSection(string, Closure$MediaWiki\Storage\PageUpdater::getAtomicSectionUpdate;1234)
#8 /srv/mediawiki/php-1.33.0-wmf.3/includes/libs/rdbms/database/DBConnRef.php(538): Wikimedia\Rdbms\DBConnRef->__call(string, array)
#9 /srv/mediawiki/php-1.33.0-wmf.3/includes/deferred/AtomicSectionUpdate.php(35): Wikimedia\Rdbms\DBConnRef->doAtomicSection(string, Closure$MediaWiki\Storage\PageUpdater::getAtomicSectionUpdate;1234)
#10 /srv/mediawiki/php-1.33.0-wmf.3/includes/deferred/DeferredUpdates.php(270): AtomicSectionUpdate->doUpdate()
#11 /srv/mediawiki/php-1.33.0-wmf.3/includes/deferred/DeferredUpdates.php(216): DeferredUpdates::runUpdate(AtomicSectionUpdate, Wikimedia\Rdbms\LBFactoryMulti, string, integer)
#12 /srv/mediawiki/php-1.33.0-wmf.3/includes/deferred/DeferredUpdates.php(136): DeferredUpdates::execute(array, string, integer)
#13 /srv/mediawiki/php-1.33.0-wmf.3/includes/MediaWiki.php(599): DeferredUpdates::doUpdates(string, integer)
#14 /srv/mediawiki/php-1.33.0-wmf.3/includes/api/ApiMain.php(548): MediaWiki::preOutputCommit(DerivativeContext)
#15 /srv/mediawiki/php-1.33.0-wmf.3/includes/api/ApiMain.php(502): ApiMain->executeActionWithErrorHandling()
#16 /srv/mediawiki/php-1.33.0-wmf.3/api.php(87): ApiMain->execute()
#17 /srv/mediawiki/w/api.php(3): include(string)
#18 {main}
>>> $title = Title::newFromText( 'Translations:Manual:List_of_MediaWiki_configuration_settings_containing_sensitive_data/4/ja' );
=> Title {
     +mTextform: "Manual:List of MediaWiki configuration settings containing sensitive data/4/ja",
     +mUrlform: "Manual:List_of_MediaWiki_configuration_settings_containing_sensitive_data/4/ja",
     +mDbkeyform: "Manual:List_of_MediaWiki_configuration_settings_containing_sensitive_data/4/ja",
     +mNamespace: 1198,
     +mInterwiki: "",
     +mFragment: "",
     +mArticleID: -1,
     +mRestrictions: [],
     +mCascadeRestriction: null,
     +mCascadingRestrictions: null,
     +mCascadeSources: null,
     +mRestrictionsLoaded: false,
     +prefixedText: null,
     +mTitleProtection: null,
     +mDefaultNamespace: 0,
     +mRedirect: null,
   }
>>> $handle = new MessageHandle( $title );
=> MessageHandle {}
>>> var_dump( $handle->getGroupIds() );
array(2) {
  [0]=>
  string(78) "page-Manual:List of MediaWiki configuration settings containing sensitive data"
  [1]=>
  string(16) "agg-Manual_pages"
}

>>> MessageGroups::getGroup( 'agg-Manual_pages' );
=> AggregateMessageGroup {}
>>> MessageGroups::getGroup( 'page-Manual:List of MediaWiki configuration settings containing sensitive data' );
=> WikiPageMessageGroup {}
>>>

Conclusion: incorrect usage of MessageGroupStats::getDatabaseIdForGroupId.

Change 472943 had a related patch set uploaded (by Nikerabbit; owner: Nikerabbit):
[mediawiki/extensions/Translate@master] Avoid fatal error in MessageGroupStats

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

Nikerabbit triaged this task as High priority.Nov 12 2018, 8:44 AM

This affects all translations of all pages which have names >~70 bytes.

Change 472943 merged by Santhosh:
[mediawiki/extensions/Translate@master] Avoid fatal error in MessageGroupStats

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

No entries in LogStash since 2018-11-13.

Pginer-WMF closed this task as Resolved.Nov 27 2018, 8:37 AM