pantheon-systems / localdev-issues

Issue tracking for Pantheon localdev
6 stars 2 forks source link

Localdev fails building wordpress environment if table prefix other than default "wp_" is used. #120

Open jasonrwasser opened 2 years ago

jasonrwasser commented 2 years ago

I've been able to consistently reproduce this error across about 5 different sites. These sites are ones we've inherited and they were all configured to use a non-default table prefix.

This is configured correctly in the wp-config.php file.

Local dev will fail when importing the database and then destroy the build.

To get around this issue until it is resolved do the following

Use the advanced initialization options and enable "Allow Failures". The next time you attempt to build the environment, it will still say that it failed, but will still start up just fine and with the database intact.

Note that there are several other causes for localdev to fail the build and destroy itself, this specifically only applies if your database is not using the default "wp_" as the table prefix.

This is what the console output looked like before failing. It says its checking for expected tables, I suspect its failing because it expects the standard table prefix. Ideally it would defer to the configured table prefix when looking for these tables

Pulling your database... This miiiiight take a minute [warning] This environment is in read-only Git mode. If you want to make changes to the codebase of this site (e.g. updating modules or plugins), you will need to toggle into read/write SFTP mode first. [notice] Command: [site name] -- wp db export [Exit: 0] Checking db pull for expected tables... Database pull failed...

mIIwaukee commented 2 years ago

Thanks, this worked.