Page MenuHomePhabricator

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

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

Urbanecm created this task.Mar 31 2019, 5:37 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 31 2019, 5:37 PM
Bawolff updated the task description. (Show Details)Mar 31 2019, 6:10 PM
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
abi_ added a subscriber: abi_.Apr 24 2019, 4:05 AM
abi_ moved this task from Backlog to In Progress on the User-abi_ board.Apr 29 2019, 5:46 AM

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

abi_ claimed this task.Apr 29 2019, 3:12 PM
abi_ added a comment.Apr 29 2019, 3:19 PM

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.

abi_ moved this task from In Progress to Under Review on the User-abi_ board.Apr 29 2019, 3:20 PM

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 moved this task from Under Review to QA on the User-abi_ board.
Nikerabbit removed a project: Patch-For-Review.
Nikerabbit triaged this task as Normal 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.

abi_ moved this task from QA to Done on the User-abi_ board.May 7 2019, 9:09 AM

Marking as done.

Umherirrender closed this task as Resolved.May 9 2019, 7:23 PM

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

Thanks for fix!