Page MenuHomePhabricator

Special:CXStats fails to load if there is no published translations
Closed, ResolvedPublic

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

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.

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.

Change 587486 had a related patch set uploaded (by Nikerabbit; owner: Nikerabbit):
[mediawiki/extensions/ContentTranslation@master] Avoid query errors in Translation::getDeletionTrend

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

Change 587486 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Avoid query errors in Translation::getDeletionTrend

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