Page MenuHomePhabricator

ContentTranslation role broken in vagrant
Open, NormalPublic

Description

https://github.com/wikimedia/mediawiki-extensions-ContentTranslation/commit/bbd5328b3766ffb283372df59567423e9d0b8b0f broke the Vagrant role due the sql file being renamed and split

"Database ContentTranslation not configured" and "Database ExtensionDependencyError: not configured"
default: Notice: /Stage[main]/Contenttranslation/Mysql::Sql[Load ContentTranslation schema]/Exec[Load ContentTranslation schema]/returns: ERROR at line 1: Failed to open file '/vagrant/mediawiki/extensions/ContentTranslation/sql/contenttranslation.sql', error: 2
==> default: Error: /usr/bin/mysql -qfsAe "USE contenttranslation; SOURCE /vagrant/mediawiki/extensions/ContentTranslation/sql/contenttranslation.sql;" returned 1 instead of one of [0]

Event Timeline

Reedy created this task.May 1 2019, 11:33 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 1 2019, 11:33 PM
TheSandDoctor added a subscriber: TheSandDoctor.EditedMay 1 2019, 11:35 PM

I was the one who notified @Reedy of this error. I would be very interested in a fix and am happy to provide more of the log if that would help anyone in resolving this.

Reedy added a comment.May 1 2019, 11:41 PM

I was the one who notified @Reedy of this error. I would be very interested in a fix and am happy to provide more of the log if that would help anyone in resolving this.

No log needed

https://github.com/wikimedia/mediawiki-vagrant/blame/master/puppet/modules/contenttranslation/manifests/init.pp#L122 that line uses a file that doesn't exist. Needs updating and made to load the other files that it was split into

I was the one who notified @Reedy of this error. I would be very interested in a fix and am happy to provide more of the log if that would help anyone in resolving this.

Thank you for showing the desire to fix this. No one on the team which develops Content Translation extension uses Vagrant, so problems like this are likely to happen.
@abi_ is not working on Content Translation, but does use Vagrant and volunteered to try fixing this tomorrow.
@TheSandDoctor your contribution is very welcome as well.

abi_ claimed this task.May 3 2019, 6:40 AM
abi_ added a project: User-abi_.
abi_ moved this task from Backlog to In Progress on the User-abi_ board.
abi_ triaged this task as Normal priority.May 3 2019, 6:42 AM

Change 507980 had a related patch set uploaded (by Abijeet Patro; owner: Abijeet Patro):
[mediawiki/vagrant@master] Fix error caused due to renamed contenttranslation sql file

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

abi_ added a comment.May 3 2019, 3:38 PM

I was able to fix the error encountered by but have encountered other failures when enabling the content translation role. Attached a patch that fixes the following issues,

Database error encountered

==> default: Error: /usr/bin/mysql -qfsAe "USE contenttranslation; SOURCE /vagrant/mediawiki/extensions/ContentTranslation/sql/contenttranslation.sql;" returned 1 instead of one of [0]
==> default: Error: /Stage[main]/Contenttranslation/Mysql::Sql[Load ContentTranslation schema]/Exec[Load ContentTranslation schema]/returns: change from notrun to 0 failed: /usr/bin/mysql -qfsAe "USE contenttranslation; SOURCE /vagrant/mediawiki/extensions/ContentTranslation/sql/contenttranslation.sql;" returned 1 instead of one of [0]

Missing VisualEditor extension

==> default: Notice: /Stage[main]/Contenttranslation/Mysql::Sql[Create translations table]/Exec[Create translations table]/returns: executed successfully
==> default: Notice: /Stage[main]/Contenttranslation/Mysql::Sql[Create translators table]/Exec[Create translators table]/returns: executed successfully
==> default: Notice: /Stage[main]/Contenttranslation/Mysql::Sql[Create lists table]/Exec[Create lists table]/returns: executed successfully
==> default: Notice: /Stage[main]/Contenttranslation/Mysql::Sql[Create suggestions table]/Exec[Create suggestions table]/returns: executed successfully
==> default: Notice: /Stage[main]/Contenttranslation/Mysql::Sql[Create corpora table]/Exec[Create corpora table]/returns: executed successfully
==> default: Notice: /Stage[main]/Role::Parsoid/Mediawiki::Import::Text[VagrantRoleParsoid]/File[/srv/pages/wiki/wiki/VagrantRoleParsoid]/ensure: defined content as '{md5}3ca0f319e7eb6334776e9faaa78a3e62'
==> default: Info: /Stage[main]/Role::Parsoid/Mediawiki::Import::Text[VagrantRoleParsoid]/File[/srv/pages/wiki/wiki/VagrantRoleParsoid]: Scheduling refresh of Exec[add page devwiki/VagrantRoleParsoid]
==> default: Notice: /Stage[main]/Role::Centralauth/Mediawiki::Maintenance[Pass 0 of CentralAuth]/Exec[Pass 0 of CentralAuth]/returns: PHP Fatal error:  Uncaught ExtensionDependencyError: ContentTranslation requires VisualEditor to be installed.

After fixing the above issues, I came across the following issue,

==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: -----------------------------------------------------------------
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: zhwiki
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: -----------------------------------------------------------------
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: zhwiki:  #!/usr/bin/env php
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: PHP Fatal error:  Uncaught ExtensionDependencyError: ContentTranslation requires VisualEditor to be installed.
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns:  in /vagrant/mediawiki/includes/registration/ExtensionRegistry.php:323
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: Stack trace:
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #0 /vagrant/mediawiki/includes/registration/ExtensionRegistry.php(172): ExtensionRegistry->readFromQueue(Array)
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #1 /vagrant/mediawiki/includes/Setup.php(127): ExtensionRegistry->loadFromQueue()
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #2 /vagrant/mediawiki/maintenance/doMaintenance.php(81): require_once('/vagrant/mediaw...')
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #3 /vagrant/mediawiki/maintenance/update.php(266): require_once('/vagrant/mediaw...')
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #4 /var/www/w/MWScript.php(98): require_once('/vagrant/mediaw...')
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: #5 {main}
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns:   thrown in /vagrant/mediawiki/includes/registration/ExtensionRegistry.php on line 323
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: zhwiki:  
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: zhwiki:  Fatal error: Uncaught ExtensionDependencyError: ContentTranslation requires VisualEditor to be installed.
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: zhwiki:   in /vagrant/mediawiki/includes/registration/ExtensionRegistry.php on line 323
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: zhwiki:  
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: zhwiki:  ExtensionDependencyError: ContentTranslation requires VisualEditor to be installed.
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: zhwiki:   in /vagrant/mediawiki/includes/registration/ExtensionRegistry.php on line 323
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: zhwiki:  
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: zhwiki:  Call Stack:
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: zhwiki:      0.0002     400008   1. {main}() /var/www/w/MWScript.php:0
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: zhwiki:      0.0054     486112   2. require_once('/vagrant/mediawiki/maintenance/update.php') /var/www/w/MWScript.php:98
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: zhwiki:      0.0082     778232   3. require_once('/vagrant/mediawiki/maintenance/doMaintenance.php') /vagrant/mediawiki/maintenance/update.php:266
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: zhwiki:      0.0097     954032   4. require_once('/vagrant/mediawiki/includes/Setup.php') /vagrant/mediawiki/maintenance/doMaintenance.php:81
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: zhwiki:      0.0787    4335576   5. ExtensionRegistry->loadFromQueue() /vagrant/mediawiki/includes/Setup.php:127
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: zhwiki:      0.0888    4618176   6. ExtensionRegistry->readFromQueue() /vagrant/mediawiki/includes/registration/ExtensionRegistry.php:172
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]/returns: zhwiki:

See the attached file for the full log. It seems to be trying to provision a number of wikis (see commit) in different languages, but fails maybe because visualeditor is not multiwiki aware?

Will need help to proceed further.

Was VE added as dependency for CX role? How did you do it?

abi_ added a comment.May 12 2019, 4:13 PM

Was VE added as dependency for CX role? How did you do it?

Added include ::role::visualeditor under the file /modules/role/manifests/contenttranslation.pp which caused the issues mentioned in the log.

The patch I submitted does not add this yet, I wanted to have a proper fix before submitting this.

abi_ moved this task from In Progress to Backlog on the User-abi_ board.Jun 28 2019, 7:44 AM