Page MenuHomePhabricator

LocalFile.php: Call to a member function getName() on a non-object (null)
Closed, DuplicatePublic

Description

Error

Request URL: commons.wikimedia.org
Request ID: XS8yuApAEMYAAC79-GQAAABQ

message
[{exception_id}] {exception_url}   BadMethodCallException from line 900 of /srv/mediawiki/php-1.34.0-wmf.14/includes/filerepo/file/LocalFile.php: Call to a member function getName() on a non-object (null)
trace
#0 /srv/mediawiki/php-1.34.0-wmf.14/includes/api/ApiQueryImageInfo.php(417): LocalFile->getUser()
#1 /srv/mediawiki/php-1.34.0-wmf.14/includes/api/ApiQueryImageInfo.php(184): ApiQueryImageInfo::getInfo(LocalFile, array, ApiResult, NULL, array)
#2 /srv/mediawiki/php-1.34.0-wmf.14/includes/api/ApiQuery.php(250): ApiQueryImageInfo->execute()
#3 /srv/mediawiki/php-1.34.0-wmf.14/includes/api/ApiMain.php(1583): ApiQuery->execute()
#4 /srv/mediawiki/php-1.34.0-wmf.14/includes/api/ApiMain.php(531): ApiMain->executeAction()
#5 /srv/mediawiki/php-1.34.0-wmf.14/includes/api/ApiMain.php(502): ApiMain->executeActionWithErrorHandling()
#6 /srv/mediawiki/php-1.34.0-wmf.14/api.php(86): ApiMain->execute()
#7 /srv/mediawiki/w/api.php(3): include(string)
#8 {main}

Impact

TBD

Notes

Please tell me if this isn't a train blocker. Thanks!

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 17 2019, 2:44 PM
LarsWirzenius triaged this task as Unbreak Now! priority.Jul 17 2019, 2:57 PM
Restricted Application added a subscriber: Liuxinyu970226. · View Herald TranscriptJul 17 2019, 2:57 PM

getInfo() for an image revision in https://phabricator.wikimedia.org/source/mediawiki/history/master/includes/api/ApiQueryImageInfo.php calls getUser():

			if ( $canShowField( File::DELETED_USER ) ) {
					if ( $user ) {
						$vals['user'] = $file->getUser();
					}

return $this->user->getName() in https://phabricator.wikimedia.org/source/mediawiki/browse/master/includes/filerepo/file/LocalFile.php$900 fails:

	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();
			}
Restricted Application added projects: Commons, Multimedia. · View Herald TranscriptJul 17 2019, 3:36 PM
Restricted Application removed a subscriber: Liuxinyu970226. · View Herald TranscriptJul 17 2019, 6:35 PM
mmodell changed the subtype of this task from "Task" to "Production Error".Wed, Aug 28, 11:05 PM