Page MenuHomePhabricator

ApiQuerySearch.php: Call to a member function getTotalHits() on a non-object (boolean)
Closed, DuplicatePublic

Description

2016-10-28 03:48:12 [WBLKfApAMDoAAD6lW8UAAACT] mw1223 enwiki 1.28.0-wmf.23 exception ERROR: [WBLKfApAMDoAAD6lW8UAAACT] /w/api.php?action=query&list=search&format=xml&srsear
ch=%22REDACTED%22&srnamespace=0&srwhat=text&srinfo=totalhits&sroffset=11744&srlimit=1   BadMethodCallException from line 120 of /srv/mediawiki/php-1.28.0-wmf.23/includes/
api/ApiQuerySearch.php: Call to a member function getTotalHits() on a non-object (boolean) {"exception_id":"WBLKfApAMDoAAD6lW8UAAACT"} 
[Exception BadMethodCallException] (/srv/mediawiki/php-1.28.0-wmf.23/includes/api/ApiQuerySearch.php:120) Call to a member function getTotalHits() on a non-object (boolean)
  #0 /srv/mediawiki/php-1.28.0-wmf.23/includes/api/ApiQuerySearch.php(43): ApiQuerySearch->run()
  #1 /srv/mediawiki/php-1.28.0-wmf.23/includes/api/ApiQuery.php(251): ApiQuerySearch->execute()
  #2 /srv/mediawiki/php-1.28.0-wmf.23/includes/api/ApiMain.php(1435): ApiQuery->execute()
  #3 /srv/mediawiki/php-1.28.0-wmf.23/includes/api/ApiMain.php(510): ApiMain->executeAction()
  #4 /srv/mediawiki/php-1.28.0-wmf.23/includes/api/ApiMain.php(481): ApiMain->executeActionWithErrorHandling()
  #5 /srv/mediawiki/php-1.28.0-wmf.23/api.php(83): ApiMain->execute()
  #6 /srv/mediawiki/w/api.php(3): include(string)
  #7 {main}

Event Timeline

Legoktm created this task.Oct 28 2016, 4:05 AM
Restricted Application added projects: Discovery, Discovery-Search. · View Herald TranscriptOct 28 2016, 4:05 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Anomie added a subscriber: Anomie.Oct 28 2016, 1:58 PM

It appears something is returning a boolean for at least one of SearchEngine::searchText(), SearchEngine::searchTitle(), or SearchNearMatcher::getNearMatchResultSet(). None of those methods is documented as returning boolean, the only documented return values are SearchResultSet, Status, or null, all of which ApiQuerySearch handles properly.

Deskana triaged this task as Low priority.Nov 3 2016, 10:13 PM
Deskana added a subscriber: Deskana.

When there are new log errors popping up, it often means we broke something. We should look in to this soon.

Actually, we fixed this one!

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:11 PM