Page MenuHomePhabricator

Internal error when suggestions requested for a language pair with no data
Closed, ResolvedPublic1 Story Points

Description

https://pt.wikipedia.org/w/api.php?action=query&format=json&list=contenttranslationsuggestions&from=en&to=es
throws

{"servedby":"mw1191","error":{"code":"internal_api_error_MWException","info":"[3606522c] Exception Caught: DatabaseBase::makeList: empty input for field translation_source_title"}}

We did not fill suggestions for en->es. But it should not cause internal error.
A result similar to this is expected

{"batchcomplete":"","query":{"contenttranslationsuggestions":{"lists":{"1":{"displayName":"cx-suggestionlist-featured","name":"cx-suggestionlist-featured","type":"1","suggestions":[]}}}}}

Details

Related Gerrit Patches:
mediawiki/extensions/ContentTranslation : masterFix internal API error when suggestion requested for empty language pair

Event Timeline

santhosh created this task.Sep 18 2015, 4:24 AM
santhosh claimed this task.
santhosh raised the priority of this task from to High.
santhosh updated the task description. (Show Details)
santhosh added a subscriber: santhosh.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 18 2015, 4:24 AM
Krenair added a subscriber: Krenair.
2015-09-18 02:56:46 mw1191 ptwiki exception ERROR: [3606522c] /w/api.php?action=query&format=json&list=contenttranslationsuggestions&from=en&to=es   MWException from line 2089 of /srv/mediawiki/php-1.26wmf23/includes/db/Database.php: DatabaseBase::makeList: empty input for field translation_source_title {"exception_id":"3606522c"} 
[Exception MWException] (/srv/mediawiki/php-1.26wmf23/includes/db/Database.php:2089) DatabaseBase::makeList: empty input for field translation_source_title
  #0 /srv/mediawiki/php-1.26wmf23/includes/db/Database.php(1662): DatabaseBase->makeList(array, integer)
  #1 /srv/mediawiki/php-1.26wmf23/includes/db/Database.php(1610): DatabaseBase->selectSQLText(string, string, array, string, array, array)
  #2 /srv/mediawiki/php-1.26wmf23/includes/db/DBConnRef.php(39): DatabaseBase->select(string, string, array, string)
  #3 /srv/mediawiki/php-1.26wmf23/includes/db/DBConnRef.php(222): DBConnRef->__call(string, array)
  #4 /srv/mediawiki/php-1.26wmf23/extensions/ContentTranslation/includes/Translation.php(105): DBConnRef->select(string, string, array, string)
  #5 /srv/mediawiki/php-1.26wmf23/extensions/ContentTranslation/api/ApiQueryContentTranslationSuggestions.php(104): ContentTranslation\Translation::find(string, string, array)
  #6 /srv/mediawiki/php-1.26wmf23/extensions/ContentTranslation/api/ApiQueryContentTranslationSuggestions.php(66): ApiQueryContentTranslationSuggestions->getOngoingTranslations(array)
  #7 /srv/mediawiki/php-1.26wmf23/extensions/ContentTranslation/api/ApiQueryContentTranslationSuggestions.php(26): ApiQueryContentTranslationSuggestions->run()
  #8 /srv/mediawiki/php-1.26wmf23/includes/api/ApiQuery.php(286): ApiQueryContentTranslationSuggestions->execute()
  #9 /srv/mediawiki/php-1.26wmf23/includes/api/ApiMain.php(1270): ApiQuery->execute()
  #10 /srv/mediawiki/php-1.26wmf23/includes/api/ApiMain.php(466): ApiMain->executeAction()
  #11 /srv/mediawiki/php-1.26wmf23/includes/api/ApiMain.php(438): ApiMain->executeActionWithErrorHandling()
  #12 /srv/mediawiki/php-1.26wmf23/api.php(88): ApiMain->execute()
  #13 /srv/mediawiki/w/api.php(3): include(string)
  #14 {main}
santhosh moved this task from Backlog to In Review on the LE-CX6-Sprint 4 board.Sep 18 2015, 4:31 AM

Change 239316 had a related patch set uploaded (by Santhosh):
Fix internal API error when suggestion requested for empty language pair

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

Change 239316 merged by jenkins-bot:
Fix internal API error when suggestion requested for empty language pair

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

Amire80 moved this task from Needs Triage to CX6 on the ContentTranslation board.Sep 18 2015, 12:52 PM
santhosh set Security to None.Sep 22 2015, 3:13 AM
santhosh edited a custom field.
santhosh moved this task from In Review to QA on the LE-CX6-Sprint 4 board.
Arrbee moved this task from QA to Done on the LE-CX6-Sprint 4 board.Sep 22 2015, 7:27 AM