Database error on deploy

I’m attempting a multi-site, sub-directory deploy to production and am getting a database error:

$ ./ production

TASK [deploy : WordPress Installed?] *******************************************
System info:
  Ansible; Darwin
  Trellis 0.9.8: August 14th, 2016
    WordPress database error Table 'example_com_production.wp_blogs' doesn't exist for query SELECT * FROM wp_blogs
    WHERE domain = '' AND path = '/' made by
    include('phar:///usr/bin/wp/php/wp-cli.php'), WP_CLI\Runner->start,
    WP_CLI\Runner->load_wordpress, require('phar:///usr/bin/wp/php/wp-settings-
    cli.php'), require('wp-includes/ms-settings.php'), get_site_by_path

My wordpress_sites.yml file:

      - canonical:
    local_path: ../site # path targeting local Bedrock site directory (relative to Ansible root)
    repo: # replace with your Git repo URL
    branch: master
      enabled: true
      subdomains: false
      enabled: true
      provider: letsencrypt
      enabled: false

and in bedrock config/application.php

/* Multisite */
define('WP_ALLOW_MULTISITE', true);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false); // Set to false if using subdirectories
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

If that’s your first deploy then you’ll need to actually install WordPress because provisioning/deploying doesn’t install it.

@cfx It is my first deploy. I’ve successfully used Trellis to install a single-site instance. When I did that I provisioned, then deployed, then went through the install process via the browser. Here I couldn’t do that as there was a db connection error.

I just redid the provision and deployment steps and get the same result. I can connect to the db using sequel pro and see the database has been created (example_com_production), but there are no tables.

Anyone have any ideas?

I recommend either installing WP using WP-CLI on your remote, or copying your local db and running search-replace.

1 Like

I did a db-migrate from the local version and loaded that onto production using sequel pro - did the trick. I tried this last night as well but for some reason it didn’t work and I figured I had bigger issues. Anyway, thanks for the input @cfx.

This looks the same as this known issue: