There are 278 BadMethodCallExceptions reported in our Logstash. They take the following form:
t exception.class BadMethodCallException t exception.code 0 t exception.file /srv/mediawiki/php-1.34.0-wmf.1/includes/filerepo/file/LocalFile.php:890 t exception.message Call to a member function getName() on a non-object (null) t exception.trace #0 /srv/mediawiki/php-1.34.0-wmf.1/includes/api/ApiQueryImageInfo.php(416): LocalFile->getUser() #1 /srv/mediawiki/php-1.34.0-wmf.1/includes/api/ApiQueryImageInfo.php(183): ApiQueryImageInfo::getInfo(LocalFile, array, ApiResult, NULL, array) #2 /srv/mediawiki/php-1.34.0-wmf.1/includes/api/ApiQuery.php(249): ApiQueryImageInfo->execute() #3 /srv/mediawiki/php-1.34.0-wmf.1/includes/api/ApiMain.php(1593): ApiQuery->execute() #4 /srv/mediawiki/php-1.34.0-wmf.1/includes/api/ApiMain.php(531): ApiMain->executeAction() #5 /srv/mediawiki/php-1.34.0-wmf.1/includes/api/ApiMain.php(502): ApiMain->executeActionWithErrorHandling() #6 /srv/mediawiki/php-1.34.0-wmf.1/api.php(87): ApiMain->execute() #7 /srv/mediawiki/w/api.php(3): include(string) #8 {main} t exception_id XL8QbgpAIDsAACePKCgAAACV t exception_url /w/api.php?action=query&format=json&prop=imageinfo|pageimages&piprop=name|thumbnail&iiprop=timestamp|user|url|userid|canonicaltitle|size|dimensions|mime|thumbmime|extmetadata|archivename|uploadwarning|badfile&titles=Image:%E4%B8%AD%E5%9B%BD&pilicense=free&pithumbsize=600 t message [XL8QbgpAIDsAACePKCgAAACV] /w/api.php?action=query&format=json&prop=imageinfo|pageimages&piprop=name|thumbnail&iiprop=timestamp|user|url|userid|canonicaltitle|size|dimensions|mime|thumbmime|extmetadata|archivename|uploadwarning|badfile&titles=Image:%E4%B8%AD%E5%9B%BD&pilicense=free&pithumbsize=600 BadMethodCallException from line 890 of /srv/mediawiki/php-1.34.0-wmf.1/includes/filerepo/file/LocalFile.php: Call to a member function getName() on a non-object (null)
The source appears to be incoherent $type and $user state in LocalFile.php:
/** * Returns user who uploaded the file * * @param string $type 'text', 'id', or 'object' * @return int|string|User * @since 1.31 Added 'object' */ function getUser( $type = 'text' ) { $this->load(); if ( $type === 'object' ) { return $this->user; } elseif ( $type === 'text' ) { return $this->user->getName(); } elseif ( $type === 'id' ) { return $this->user->getId(); } throw new MWException( "Unknown type '$type'." ); }