Page MenuHomePhabricator

ttmserver/ElasticSearchTTMServer.php: Call to a member function getAggregations() on null
Closed, ResolvedPublicPRODUCTION ERROR

Description

This query is not working, while a slightly different query with same settings is

[XKD4EwpAAD0AAHUEhW8AAABY] /w/index.php?title=Special:SearchTranslations&match=all&query=stop+wathing+this&language=cs&filter=translated   Error from line 757 of /srv/mediawiki/php-1.33.0-wmf.23/extensions/Translate/ttmserver/ElasticSearchTTMServer.php: Call to a member function getAggregations() on null
#0 /srv/mediawiki/php-1.33.0-wmf.23/extensions/Translate/specials/SpecialSearchTranslations.php(132): ElasticSearchTTMServer->getFacets(NULL)
#1 /srv/mediawiki/php-1.33.0-wmf.23/includes/specialpage/SpecialPage.php(569): SpecialSearchTranslations->execute(NULL)
#2 /srv/mediawiki/php-1.33.0-wmf.23/includes/specialpage/SpecialPageFactory.php(558): SpecialPage->run(NULL)
#3 /srv/mediawiki/php-1.33.0-wmf.23/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#4 /srv/mediawiki/php-1.33.0-wmf.23/includes/MediaWiki.php(867): MediaWiki->performRequest()
#5 /srv/mediawiki/php-1.33.0-wmf.23/includes/MediaWiki.php(517): MediaWiki->main()
#6 /srv/mediawiki/php-1.33.0-wmf.23/index.php(42): MediaWiki->run()
#7 /srv/mediawiki/w/index.php(3): require(string)
#8 {main}

Event Timeline

Krinkle added a subscriber: Krinkle.

12 reports from wmf.23 in Logstash. 1 report from wmf.22 in Logstash.

ElasticSearchTTMServer::getFacets needs a resultset to call getAggregations.

The result set in SpecialSearchTranslations::execute should be set when no exception is thrown.

It is set from CrossLanguageTranslationSearchQuery::getResultSet or SearchableTTMServer::search, both calling many other functions, that makes it hard to follow the whole code path. I have no idea what the search is returning, when nothing is found. It is okay to use showEmptySearch in case of null result set?

Reedy renamed this task from /ttmserver/ElasticSearchTTMServer.php: Call to a member function getAggregations() on null to ttmserver/ElasticSearchTTMServer.php: Call to a member function getAggregations() on null.Apr 23 2019, 9:55 PM

Change 507033 had a related patch set uploaded (by Abijeet Patro; owner: Abijeet Patro):
[mediawiki/extensions/Translate@master] Fix exception thrown when no hits are found during translation search

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

I had the Translate extension with ElasticSearch as the TTM backend setup on my machine. I was able to reproduce the issue and have submitted a patch that fixes the problem. The resultset was being set only if there are records returned matching the search, causing it to remain null when there were no hits.

Change 507033 merged by jenkins-bot:
[mediawiki/extensions/Translate@master] Fix exception thrown when no hits are found during translation search

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

Nikerabbit triaged this task as Medium priority.Apr 30 2019, 8:29 AM
Nikerabbit added a subscriber: Nikerabbit.

Looks like this was included in 1.34.0-wmf.3. Last log entry in logstash is from 2019-04-30T17:40:08 which I believe is before the train ran. Because of that I think we can call this done.

Marking as done.

Looks like this was included in 1.34.0-wmf.3. Last log entry in logstash is from 2019-04-30T17:40:08 which I believe is before the train ran. Because of that I think we can call this done.

Included in (as of now): master, wmf/1.34.0-wmf.3, wmf/1.34.0-wmf.4

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