Page MenuHomePhabricator

Rebuild Wikispore Vagrant box on Buster
Closed, ResolvedPublic

Description

Event Timeline

Plan:

  1. (on guest) mysqldump --add-drop-database --databases `mysql -rNe 'show databases' | ack -v '^(mysql|information_schema|performance_schema)$'` > /vagrant/dump.sql
  2. (on guest) sudo tar --absolute-names -cvzf /vagrant/wikispore-wiki-20221031-files.tgz /srv/images
  3. (on host, in main vagrant dir) git pull --rebase
  4. (on host, in main vagrant dir) cherry-pick 850642
  5. (on host) vagrant destroy -f; vagrant up
  6. (on host) vagrant git-update
  7. (on guest) mysql < /vagrant/dump.sql
  8. (on guest) sudo tar -C / --same-owner -xvf /vagrant/wikispore-wiki-20221031-files.tgz
  9. (on host) vagrant reload (to clear the cache)
  10. (on guest) mwscript update.php --quick
  11. (on guest) mwscript extensions/WSOAuth/maintenance/multiAuthMigrate.php --provider mediawiki

With the patch from T321984: Make MediaWiki-Vagrant LXC provider work with a Buster base image, provisioning/updating works, but OAuth login seems broken.

Change 850660 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/vagrant@master] Add mediawiki::server_protocol hiera setting

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

Change 850661 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/vagrant@master] wsoauth: Update configuration format

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

Change 850660 merged by jenkins-bot:

[mediawiki/vagrant@master] Add mediawiki::server_protocol hiera setting

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

Change 850661 merged by jenkins-bot:

[mediawiki/vagrant@master] wsoauth: Update configuration format

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

Failed on prod with

==> default: Notice: /Stage[main]/Mediawiki/Exec[composer update /vagrant/mediawiki]/returns: Do not run Composer as root/super user! See https://getcomposer.org/root for details
==> default: Notice: /Stage[main]/Mediawiki/Exec[composer update /vagrant/mediawiki]/returns: The "wikimedia/composer-merge-plugin" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.3.0"). You may need to run composer update with the "--no-plugins" option.
==> default: Notice: /Stage[main]/Mediawiki/Exec[composer update /vagrant/mediawiki]/returns: > ComposerHookHandler::onPreUpdate
==> default: Notice: /Stage[main]/Mediawiki/Exec[composer update /vagrant/mediawiki]/returns: Script ComposerHookHandler::onPreUpdate handling the pre-update-cmd event terminated with an exception
==> default: Notice: /Stage[main]/Mediawiki/Exec[composer update /vagrant/mediawiki]/returns: 
==> default: Notice: /Stage[main]/Mediawiki/Exec[composer update /vagrant/mediawiki]/returns: In Package.php line 703:
==> default: Notice: /Stage[main]/Mediawiki/Exec[composer update /vagrant/mediawiki]/returns:                                                                                
==> default: Notice: /Stage[main]/Mediawiki/Exec[composer update /vagrant/mediawiki]/returns:   Package::setProvides must be called with a map of lowercased package name =  
==> default: Notice: /Stage[main]/Mediawiki/Exec[composer update /vagrant/mediawiki]/returns:   > Link object, got a indexed array, this is deprecated and you should fix y  
==> default: Notice: /Stage[main]/Mediawiki/Exec[composer update /vagrant/mediawiki]/returns:   our usage.                                                                   
==> default: Notice: /Stage[main]/Mediawiki/Exec[composer update /vagrant/mediawiki]/returns:                                                                                
==> default: Notice: /Stage[main]/Mediawiki/Exec[composer update /vagrant/mediawiki]/returns: 
==> default: Notice: /Stage[main]/Mediawiki/Exec[composer update /vagrant/mediawiki]/returns: update [--with WITH] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-dev] [--lock] [--no-install] [--no-audit] [--audit-format AUDIT-FORMAT] [--no-autoloader] [--no-suggest] [--no-progress] [-w|--with-dependencies] [-W|--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>...]
==> default: Error: /Stage[main]/Mediawiki/Exec[composer update /vagrant/mediawiki]: Failed to call refresh: '/usr/local/bin/composer update --no-progress' returned 1 instead of one of [0]
==> default: Error: /Stage[main]/Mediawiki/Exec[composer update /vagrant/mediawiki]: '/usr/local/bin/composer update --no-progress' returned 1 instead of one of [0]

Not sure which of these are warnings and which is the one that actually broke provisioning. Also not sure why this didn't happen on test.

On test:

vagrant@mediawiki-vagrant:/vagrant/mediawiki$ /usr/local/bin/composer --version
Composer version 2.4.4 2022-10-27 14:39:29

vagrant@mediawiki-vagrant:/vagrant/mediawiki$ /usr/local/bin/composer update --no-progress
> ComposerHookHandler::onPreUpdate
Loading composer repositories with package information
...

On prod:

vagrant@mediawiki-vagrant:/vagrant/mediawiki$ /usr/local/bin/composer --version
Composer version 2.4.4 2022-10-27 14:39:29

vagrant@mediawiki-vagrant:/vagrant/mediawiki$ /usr/local/bin/composer update --no-progress
The "wikimedia/composer-merge-plugin" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.3.0"). You may need to run composer update with the "--no-plugins" option.
> ComposerHookHandler::onPreUpdate
Script ComposerHookHandler::onPreUpdate handling the pre-update-cmd event terminated with an exception

In Package.php line 703:
                                                                                                                                                                    
  Package::setProvides must be called with a map of lowercased package name => Link object, got a indexed array, this is deprecated and you should fix your usage.  
                                                                                                                                                                    

update [--with WITH] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-dev] [--lock] [--no-install] [--no-audit] [--audit-format AUDIT-FORMAT] [--no-autoloader] [--no-suggest] [--no-progress] [-w|--with-dependencies] [-W|--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>...]

MediaWiki was too old to work with modern composer. Running vagrant git-update fixed the issue. There were a number of small ways in which prod was out of sync (uncommitted changes to PageForms, messed up file permissions) but those were easily fixable.

The installation works now in theory (e.g. maintenance scripts run without any problem). The current issue is that for some reason Vagrant cannot match the domain name to the wiki database name and throws up the "no such wiki" page instead.

Apparently PHP (under Apache only, not CLI) does not see the /vagrant directory (an NFS share). But only on that one box, not the identically set up wikispore-test :/

As a short-term fix, I disabled NFS (vagrant config nfs_shares no; vagrant reload). This probably has a performance cost.

Tgr claimed this task.
Tgr moved this task from Next-up to Done on the Wikispore board.

Filed T322975: NFS broken on Wikispore about the NFS weirdness, but otherwise this is done.