Multisite deploy error

When I try to deploy a multisite I run into this error. The local Vagrant environment works fine.
On latest Trellis + head.

TASK [deploy : WordPress Installed?] *******************************************
System info:
  Ansible 2.2.0.0; Linux
  Trellis at "Add myhostname to nsswitch.conf to ensure resolvable hostname"
---------------------------------------------------
WordPress database error Table
'staging_mysite_nl_staging.vanharten_wp_blogs' doesn't
exist for query SELECT  blog_id FROM vanharten_wp_blogs  WHERE domain IN (
'staging.mysite.nl' ) AND path IN ( '/' )  ORDER BY
blog_id ASC LIMIT 1 made by include('phar:///usr/bin/wp/php/boot-phar.php'),
include('phar:///usr/bin/wp/php/wp-cli.php'), WP_CLI\Runner->start,
WP_CLI\Runner->load_wordpress, require('wp-settings.php'), require('wp-
includes/ms-settings.php'), ms_load_current_site_and_network,
get_site_by_path, get_sites, WP_Site_Query->query, WP_Site_Query->get_sites,
WP_Site_Query->get_site_ids
WordPress database error Table
'staging_mysite_nl_staging.vanharten_wp_sitemeta'
doesn't exist for query SELECT meta_value FROM vanharten_wp_sitemeta WHERE
meta_key = 'site_name' AND site_id = 1 made by
include('phar:///usr/bin/wp/php/boot-phar.php'),
include('phar:///usr/bin/wp/php/wp-cli.php'), WP_CLI\Runner->start,
WP_CLI\Runner->load_wordpress, require('wp-settings.php'), require('wp-
includes/ms-settings.php'), WP_Network->__construct,
WP_Network->_set_site_name, get_network_option
WordPress database error Table
'staging_mysite_nl_staging.vanharten_wp_sitemeta'
doesn't exist for query SELECT meta_value FROM vanharten_wp_sitemeta WHERE
meta_key = 'siteurl' AND site_id = 1 made by include('phar:///usr/bin/wp/php
/boot-phar.php'), include('phar:///usr/bin/wp/php/wp-cli.php'),
WP_CLI\Runner->start, WP_CLI\Runner->load_wordpress, require('wp-
settings.php'), wp_cookie_constants, get_site_option, get_network_option
fatal: [my.server.ip]: FAILED! => {"changed": false, "cmd": ["wp", "core", "is-installed", "--network"], "delta": "0:00:00.545868", "end": "2016-11-17 16:46:00.733824", "failed": true, "failed_when_result": true, "rc": 1, "start": "2016-11-17 16:46:00.187956", "stderr": "WordPress database error Table 'staging_mysite_nl_staging.vanharten_wp_blogs' doesn't exist for query SELECT  blog_id FROM vanharten_wp_blogs  WHERE domain IN ( 'staging.mysite.nl' ) AND path IN ( '/' )  ORDER BY blog_id ASC LIMIT 1 made by include('phar:///usr/bin/wp/php/boot-phar.php'), include('phar:///usr/bin/wp/php/wp-cli.php'), WP_CLI\\Runner->start, WP_CLI\\Runner->load_wordpress, require('wp-settings.php'), require('wp-includes/ms-settings.php'), ms_load_current_site_and_network, get_site_by_path, get_sites, WP_Site_Query->query, WP_Site_Query->get_sites, WP_Site_Query->get_site_ids\nWordPress database error Table 'staging_mysite_nl_staging.vanharten_wp_sitemeta' doesn't exist for query SELECT meta_value FROM vanharten_wp_sitemeta WHERE meta_key = 'site_name' AND site_id = 1 made by include('phar:///usr/bin/wp/php/boot-phar.php'), include('phar:///usr/bin/wp/php/wp-cli.php'), WP_CLI\\Runner->start, WP_CLI\\Runner->load_wordpress, require('wp-settings.php'), require('wp-includes/ms-settings.php'), WP_Network->__construct, WP_Network->_set_site_name, get_network_option\nWordPress database error Table 'staging_mysite_nl_staging.vanharten_wp_sitemeta' doesn't exist for query SELECT meta_value FROM vanharten_wp_sitemeta WHERE meta_key = 'siteurl' AND site_id = 1 made by include('phar:///usr/bin/wp/php/boot-phar.php'), include('phar:///usr/bin/wp/php/wp-cli.php'), WP_CLI\\Runner->start, WP_CLI\\Runner->load_wordpress, require('wp-settings.php'), wp_cookie_constants, get_site_option, get_network_option", "stdout": "", "stdout_lines": [], "warnings": []}

wordpress_sites.yml:

  staging.mysite.nl:
    site_hosts:
      - canonical: staging.mysite.nl
        # redirects:
        #   - otherdomain.com
    local_path: ../sites/mysite.nl # path targeting local Bedrock site directory (relative to Ansible root)
    repo: git@gitlab.inorbita.io:path.git # replace with your Git repo URL
    # repo_subtree_path: ../path # relative path to your Bedrock/WP directory in your repo
    branch: master
    multisite:
      enabled: true
      subdomain: false
    ssl:
      enabled: false
      provider: letsencrypt
    cache:
      enabled: false
    env:
      domain_current_site: staging.mysite.nl
      wp_home: http://staging.mysite.nl
      wp_siteurl: http://staging.mysite.nl/wp

Do you have a database set up on the box?

In my experience you need to SSH into the server and use WP CLI to install a new multisite network. I’ve done it enough times I should’ve written a guide by now :confused:

I don’t have a db set up, I assumed Trellis would create an empty default db.

How would I proceed? SSH into the machine and drop the db using wp-cli and create a new db with tables that match the vagrant development db? I realize this is outside of the scope of Trellis support, but any additional help is much appreciated.

Waddayaknow, seems it’s simply:
wp core multisite-install --allow-root --title="Test" --admin_user="admin" --admin_password="admin" --admin_email="admin@example.com"

Found here.

1 Like