Page MenuHomePhabricator

Investigate search ErrorExceptions in prefixsearch
Closed, DuplicatePublic

Description

Our reading web Logstash board is very noisy due to various ErrorExceptions that look like this:

[WM-3@QpAANIAAAMPg8YAAADD] /w/api.php?action=query&format=json&generator=prefixsearch&gpssearch=Ma&gpsnamespace=0&gpslimit=12&prop=pageimages&piprop=thumbnail&pithumbsize=96&pilimit=12&list=prefixsearch&pssearch=Ma&pslimit=12 ErrorException from line 38

Do we know what's causing this?
Can we fix it?

Event Timeline

2017-03-21 13:39:22 [WNEtCgpAAEkAAS5A0fIAAADR] mw1278 frwiki 1.29.0-wmf.16 exception ERROR: [WNEtCgpAAEkAAS5A0fIAAADR] /w/api.php?action=query&format=json&prop=pageprops%7Cpageprops%7Cpageimages%7Cpageterms&generator=prefixsearch&ppprop=displaytitle&piprop=thumbnail&pithumbsize=80&pilimit=15&wbptterms=description&redirects=&gpssearch=R%C3%A9sum%C3%A9+du+&gpsnamespace=0&gpslimit=15   Wikimedia\Assert\ParameterAssertionException from line 63 of /srv/mediawiki/php-1.29.0-wmf.16/vendor/wikimedia/assert/src/Assert.php: Bad value for parameter $dbkey: invalid DB key 'Résumé_des_principales_intrigues_de_Plus_belle_la_' {"exception_id":"WNEtCgpAAEkAAS5A0fIAAADR","caught_by":"other"}
[Exception Wikimedia\Assert\ParameterAssertionException] (/srv/mediawiki/php-1.29.0-wmf.16/vendor/wikimedia/assert/src/Assert.php:63) Bad value for parameter $dbkey: invalid DB key 'Résumé_des_principales_intrigues_de_Plus_belle_la_'
  #0 /srv/mediawiki/php-1.29.0-wmf.16/includes/title/TitleValue.php(82): Wikimedia\Assert\Assert::parameter(boolean, string, string)
  #1 /srv/mediawiki/php-1.29.0-wmf.16/includes/cache/LinkBatch.php(176): TitleValue->__construct(integer, string)
  #2 /srv/mediawiki/php-1.29.0-wmf.16/includes/cache/LinkBatch.php(140): LinkBatch->addResultToCache(LinkCache, Wikimedia\Rdbms\ResultWrapper)
  #3 /srv/mediawiki/php-1.29.0-wmf.16/includes/cache/LinkBatch.php(127): LinkBatch->executeInto(LinkCache)
  #4 /srv/mediawiki/php-1.29.0-wmf.16/includes/search/SearchEngine.php(557): LinkBatch->execute()
  #5 /srv/mediawiki/php-1.29.0-wmf.16/includes/search/SearchEngine.php(497): SearchEngine->processCompletionResults(string, SearchSuggestionSet)
  #6 /srv/mediawiki/php-1.29.0-wmf.16/extensions/CirrusSearch/includes/CirrusSearch.php(639): SearchEngine->completionSearch(string)
  #7 /srv/mediawiki/php-1.29.0-wmf.16/includes/api/ApiQueryPrefixSearch.php(54): CirrusSearch->completionSearchWithVariants(string)
  #8 /srv/mediawiki/php-1.29.0-wmf.16/includes/api/ApiQueryPrefixSearch.php(41): ApiQueryPrefixSearch->run(ApiPageSet)
  #9 /srv/mediawiki/php-1.29.0-wmf.16/includes/api/ApiPageSet.php(178): ApiQueryPrefixSearch->executeGenerator(ApiPageSet)
  #10 /srv/mediawiki/php-1.29.0-wmf.16/includes/api/ApiPageSet.php(142): ApiPageSet->executeInternal(boolean)
  #11 /srv/mediawiki/php-1.29.0-wmf.16/includes/api/ApiQuery.php(236): ApiPageSet->execute()
  #12 /srv/mediawiki/php-1.29.0-wmf.16/includes/api/ApiMain.php(1543): ApiQuery->execute()
  #13 /srv/mediawiki/php-1.29.0-wmf.16/includes/api/ApiMain.php(544): ApiMain->executeAction()
  #14 /srv/mediawiki/php-1.29.0-wmf.16/includes/api/ApiMain.php(515): ApiMain->executeActionWithErrorHandling()
  #15 /srv/mediawiki/php-1.29.0-wmf.16/api.php(83): ApiMain->execute()
  #16 /srv/mediawiki/w/api.php(3): include(string)
  #17 {main}

Thanks @MaxSem I'm still wrestling with the logstash UI but it seems any api requests which contain prop=pageimages show up in our dashboard :)

The stacktrace seems to disagree...

Looks like the problem is the title ends in _, and TitleValue ctor hates that. Not sure where the title comes from or why it is so, will look.

The original page seems to be this: https://fr.wikipedia.org/wiki/R%C3%A9sum%C3%A9_des_principales_intrigues_de_Plus_belle_la_vie
So it looks like it got cut off somehow?