Acorn command causes error when deploying to production

When deploying to production, the acorn optimize command in the build-after.yml hook causes this error:

["Error: The site you have requested is not installed.", "Run `wp core install` to create database tables."]

I’ve deployed with the verbose command but it really does not provide new info.

I’ve ssh’d into the production server, cd’d to the current folder and ran ‘wp’. I get the same error. So for some reason wp-cli thinks wordpress has not been installed. However, it has. All the wp folders are there on the production server.

When I go to the production url, it prompts me with the "welcome to wordpress’ form.

This issue seems directly related to this issue.. So yeah when I comment out this command, the deploy works without errors. When I uncomment, it fails again with the same error.

I have successfully deployed to a staging site, so I have no clue why the deployment to production is causing this issue.

Any ideas what I am missing?

I am using Acorn 2.1 in case that matters.

Is that the installation screen? You have to finish the installation for wp CLI to detect the site as being installed.

I also have to ensure that the WordPress site is installed (as on initial deploy), for installing languages using the wp CLI. See this example for ensuring this during Trellis deploy (in a deploy hook): How to Install WordPress Languages Files | Trellis Docs | Roots

1 Like

Yes I had read that post when trying to solve this issue.

I wound up just running wp core install on the prod server, and it fixed the issue. I hadn’t done – or at least don’t remember doing – that before on first deploy, so I was hesitant to do so.

It may be a good idea to add this to a checklist or add a deploy hook (as described) so that when you deploy to a new instance, this issue will not reoccur.