I am getting the following error when attempting to deploy my multi-site setup. I’ve successfully deployed in the past but now I’m attempting to setup domain mapping to the sub-site and now I get this error:
Error: Site 'domainofsubsite.com/' not found. Verify DOMAIN_CURRENT_SITE
matches an existing site or use `--url=<url>` to override. failed: [XXX.XX.XX.XXXX]
(item=template_root) =>
{"changed": false, "cmd": " wp site list --field=url | xargs -I {} bash -c 'export url=\"{}\"; echo -n \"$url \"
&& wp option get template_root --skip-plugins --skip-themes --url=$url || echo'\n ", "delta":
"0:00:00.194381", "end": "2018-03-19 22:05:12.966420", "failed": true, "failed_when_result": true, "item":
"template_root", "rc": 0, "start": "2018-03-19 22:05:12.772039", "stderr": "Error: Site
'domainofsubsite.com/' not found. Verify DOMAIN_CURRENT_SITE matches an existing site or use `--
url=<url>` to override.", "stdout": "", "stdout_lines": [], "warnings": []}
I am lost as to why this is happening.
The domain with the ending “/” cannot be found anywhere in my database or in any of the code for the site. My searching of the web doesn’t bring any solutions.
That task only needs to run if you are using one of the themes from WP core. If you are using Sage or a custom theme, try this note from roots/trellis#854:
To disable: Multisite operators who wish to avoid the processing time may define update_wp_theme_paths: false in a group_vars file or on the fly:
Otherwise, you could add -vvv to your deploy command and see the exact wp-cli command the task is running, ssh in to the server as web_user, cd /srv/www/example.com/current and run the command, and troubleshoot from there.
You could also double-check the multisite docs for any missed detail (I miss those details all the time).