VIP Support user creation fails with errors under wp core install #87
Description
Line 67 of vip-support/class-vip-support-role.php generates a stream of WordPress database error Table 'wordpress.wp_options' doesn't exist for query INSERT INTO 'wp_options' ...
errors when you run wp core install (see wp-core-install.log for the full list of errors).
vip-support/class-vip-support-role.php
Line 67 in f613ab7
Line 67 calls action_init
, which simply calls self::add_role();
to create the VIP support user. I assume the problem is a race condition and that the init hook is being fired before the database tables have been created.
Steps to reproduce
I am using Chris Zarate's Docker-based VIP Go development environment - https://github.com/chriszarate/docker-wordpress-vip-go. The setup process:
- Downloads Docker images for Wordpress and MariaDB
- Clones the VIP plugins from https://github.com/Automattic/vip-go-mu-plugins into wp-content/mu-plugins.
- Runs
wp core install --title="Project" --admin_user="wordpress" --admin_password="wordpress" --admin_email="[email protected]" --url="http://project.test" ---skip-email
If I run the setup unchanged I get 41 database errors on running wp core install
. If I comment out line 67 of vip-support/class-vip-support-role.php then I get no database errors.