Page MenuHomePhabricator

Special:CXStats fails to load if there is no published translations
Open, Needs TriagePublic

Description

Found while helping @Jpita to setup his local dev environment. When trying to visit Special:CXStats, page never loads. With debug=1 flag, following trace is logged in console:

"Wikimedia\Rdbms\DBQueryError at /Users/josepita/code/mediawiki/core/includes/libs/rdbms/database/Database.php(1586)
#0 /Users/josepita/code/mediawiki/core/includes/libs/rdbms/database/Database.php(1554): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, integer, string, string)
#1 /Users/josepita/code/mediawiki/core/includes/libs/rdbms/database/Database.php(1274): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
#2 /Users/josepita/code/mediawiki/core/includes/libs/rdbms/database/Database.php(1782): Wikimedia\Rdbms\Database->query(string, string)
#3 /Users/josepita/code/mediawiki/core/extensions/ContentTranslation/includes/Translation.php(363): Wikimedia\Rdbms\Database->select(array, array, array, string, array)
#4 /Users/josepita/code/mediawiki/core/extensions/ContentTranslation/api/ApiQueryContentTranslationLanguageTrend.php(43): ContentTranslation\Translation::getDeletionTrend(string)
#5 /Users/josepita/code/mediawiki/core/includes/api/ApiQuery.php(250): ApiQueryContentTranslationLanguageTrend->execute()
#6 /Users/josepita/code/mediawiki/core/includes/api/ApiMain.php(1595): ApiQuery->execute()
#7 /Users/josepita/code/mediawiki/core/includes/api/ApiMain.php(531): ApiMain->executeAction()
#8 /Users/josepita/code/mediawiki/core/includes/api/ApiMain.php(502): ApiMain->executeActionWithErrorHandling()
#9 /Users/josepita/code/mediawiki/core/api.php(87): ApiMain->execute()
#10 {main}"

This happens when there are no edits on local wiki. After publishing some translation with CX and visiting Special:CXStats loads correctly.

Event Timeline

Petar.petkovic moved this task from Needs Triage to Bugs on the ContentTranslation board.

Yes, I think that line is the culprit for this error. There is similar query and error being caught in another API as well.
If I setup new wiki sometimes, I'll try remembering to fix this.

Jpita added a comment.Jun 13 2019, 8:35 AM

Yes, I think that line is the culprit for this error. There is similar query and error being caught in another API as well.
If I setup new wiki sometimes, I'll try remembering to fix this.

you can't "reset" the environment?

you can't "reset" the environment?

One can do a fresh install by dropping the database. But on the other hand, at least my own development and testing environment has accumulated a bunch of content over time that has been useful to have around when testing stuff.