Multisite (subdomain) deploy: Wordpress Installed?, PHP Fatal error: require() missing files

I have a multisite (subdomain) development environment working fine but, when I attempted to deploy, it fails at Wordpress Installed?
TASK [deploy : WordPress Installed?] ********************************************************************************************************************
task path: /home/sergio/sites/multisite.com/trellis/roles/deploy/hooks/finalize-after.yml:2
Using module file /usr/lib/python2.7/dist-packages/ansible/modules/commands/command.py
<162.243.130.31> ESTABLISH SSH CONNECTION FOR USER: web
<162.243.130.31> SSH: ansible.cfg set ssh_args: (-o)(ForwardAgent=yes)(-o)(ControlMaster=auto)(-o)(ControlPersist=60s)
<162.243.130.31> SSH: ansible_password/ansible_ssh_pass not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)
<162.243.130.31> SSH: ANSIBLE_REMOTE_USER/remote_user/ansible_user/user/-u set: (-o)(User=web)
<162.243.130.31> SSH: ANSIBLE_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)
<162.243.130.31> SSH: PlayContext set ssh_common_args: ()
<162.243.130.31> SSH: PlayContext set ssh_extra_args: ()
<162.243.130.31> SSH: found only ControlPersist; added ControlPath: (-o)(ControlPath=/home/sergio/.ansible/cp/20aa9590ff)
<162.243.130.31> SSH: EXEC ssh -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 -o ControlPath=/home/sergio/.ansible/cp/20aa9590ff 162.243.130.31 ‘/bin/sh -c ‘"’"‘echo ~ && sleep 0’"’"’’
<162.243.130.31> (0, ‘/home/web\n’, ‘OpenSSH_7.3p1 Ubuntu-1, OpenSSL 1.0.2g 1 Mar 2016\r\ndebug1: Reading configuration data /home/sergio/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 8350\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n’)
<162.243.130.31> ESTABLISH SSH CONNECTION FOR USER: web
<162.243.130.31> SSH: ansible.cfg set ssh_args: (-o)(ForwardAgent=yes)(-o)(ControlMaster=auto)(-o)(ControlPersist=60s)
<162.243.130.31> SSH: ansible_password/ansible_ssh_pass not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)
<162.243.130.31> SSH: ANSIBLE_REMOTE_USER/remote_user/ansible_user/user/-u set: (-o)(User=web)
<162.243.130.31> SSH: ANSIBLE_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)
<162.243.130.31> SSH: PlayContext set ssh_common_args: ()
<162.243.130.31> SSH: PlayContext set ssh_extra_args: ()
<162.243.130.31> SSH: found only ControlPersist; added ControlPath: (-o)(ControlPath=/home/sergio/.ansible/cp/20aa9590ff)
<162.243.130.31> SSH: EXEC ssh -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 -o ControlPath=/home/sergio/.ansible/cp/20aa9590ff 162.243.130.31 ‘/bin/sh -c ‘"’"’( umask 77 && mkdir -p “echo /home/web/.ansible/tmp/ansible-tmp-1492645362.48-248327338837571” && echo ansible-tmp-1492645362.48-248327338837571="echo /home/web/.ansible/tmp/ansible-tmp-1492645362.48-248327338837571" ) && sleep 0’"’"’’
<162.243.130.31> (0, ‘ansible-tmp-1492645362.48-248327338837571=/home/web/.ansible/tmp/ansible-tmp-1492645362.48-248327338837571\n’, ‘OpenSSH_7.3p1 Ubuntu-1, OpenSSL 1.0.2g 1 Mar 2016\r\ndebug1: Reading configuration data /home/sergio/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 8350\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n’)
<162.243.130.31> PUT /tmp/tmpTwFqrH TO /home/web/.ansible/tmp/ansible-tmp-1492645362.48-248327338837571/command.py
<162.243.130.31> SSH: ansible.cfg set ssh_args: (-o)(ForwardAgent=yes)(-o)(ControlMaster=auto)(-o)(ControlPersist=60s)
<162.243.130.31> SSH: ansible_password/ansible_ssh_pass not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)
<162.243.130.31> SSH: ANSIBLE_REMOTE_USER/remote_user/ansible_user/user/-u set: (-o)(User=web)
<162.243.130.31> SSH: ANSIBLE_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)
<162.243.130.31> SSH: PlayContext set ssh_common_args: ()
<162.243.130.31> SSH: PlayContext set sftp_extra_args: ()
<162.243.130.31> SSH: found only ControlPersist; added ControlPath: (-o)(ControlPath=/home/sergio/.ansible/cp/20aa9590ff)
<162.243.130.31> SSH: EXEC sftp -b - -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 -o ControlPath=/home/sergio/.ansible/cp/20aa9590ff ‘[162.243.130.31]’
<162.243.130.31> (0, ‘sftp> put /tmp/tmpTwFqrH /home/web/.ansible/tmp/ansible-tmp-1492645362.48-248327338837571/command.py\n’, ‘OpenSSH_7.3p1 Ubuntu-1, OpenSSL 1.0.2g 1 Mar 2016\r\ndebug1: Reading configuration data /home/sergio/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 8350\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug2: Remote version: 3\r\ndebug2: Server supports extension "posix-rename@openssh.com" revision 1\r\ndebug2: Server supports extension "statvfs@openssh.com" revision 2\r\ndebug2: Server supports extension "fstatvfs@openssh.com" revision 2\r\ndebug2: Server supports extension "hardlink@openssh.com" revision 1\r\ndebug2: Server supports extension "fsync@openssh.com" revision 1\r\ndebug3: Sent message fd 5 T:16 I:1\r\ndebug3: SSH_FXP_REALPATH . -> /home/web size 0\r\ndebug3: Looking up /tmp/tmpTwFqrH\r\ndebug3: Sent message fd 5 T:17 I:2\r\ndebug3: Received stat reply T:101 I:2\r\ndebug1: Couldn’t stat remote file: No such file or directory\r\ndebug3: Sent message SSH2_FXP_OPEN I:3 P:/home/web/.ansible/tmp/ansible-tmp-1492645362.48-248327338837571/command.py\r\ndebug3: Sent message SSH2_FXP_WRITE I:4 O:0 S:32768\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 4 32768 bytes at 0\r\ndebug3: Sent message SSH2_FXP_WRITE I:5 O:32768 S:25590\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 5 25590 bytes at 32768\r\ndebug3: Sent message SSH2_FXP_CLOSE I:4\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n’)
<162.243.130.31> ESTABLISH SSH CONNECTION FOR USER: web
<162.243.130.31> SSH: ansible.cfg set ssh_args: (-o)(ForwardAgent=yes)(-o)(ControlMaster=auto)(-o)(ControlPersist=60s)
<162.243.130.31> SSH: ansible_password/ansible_ssh_pass not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)
<162.243.130.31> SSH: ANSIBLE_REMOTE_USER/remote_user/ansible_user/user/-u set: (-o)(User=web)
<162.243.130.31> SSH: ANSIBLE_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)
<162.243.130.31> SSH: PlayContext set ssh_common_args: ()
<162.243.130.31> SSH: PlayContext set ssh_extra_args: ()
<162.243.130.31> SSH: found only ControlPersist; added ControlPath: (-o)(ControlPath=/home/sergio/.ansible/cp/20aa9590ff)
<162.243.130.31> SSH: EXEC ssh -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 -o ControlPath=/home/sergio/.ansible/cp/20aa9590ff 162.243.130.31 ‘/bin/sh -c ‘"’"‘chmod u+x /home/web/.ansible/tmp/ansible-tmp-1492645362.48-248327338837571/ /home/web/.ansible/tmp/ansible-tmp-1492645362.48-248327338837571/command.py && sleep 0’"’"’’
<162.243.130.31> (0, ‘’, ‘OpenSSH_7.3p1 Ubuntu-1, OpenSSL 1.0.2g 1 Mar 2016\r\ndebug1: Reading configuration data /home/sergio/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 8350\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n’)
<162.243.130.31> ESTABLISH SSH CONNECTION FOR USER: web
<162.243.130.31> SSH: ansible.cfg set ssh_args: (-o)(ForwardAgent=yes)(-o)(ControlMaster=auto)(-o)(ControlPersist=60s)
<162.243.130.31> SSH: ansible_password/ansible_ssh_pass not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)
<162.243.130.31> SSH: ANSIBLE_REMOTE_USER/remote_user/ansible_user/user/-u set: (-o)(User=web)
<162.243.130.31> SSH: ANSIBLE_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)
<162.243.130.31> SSH: PlayContext set ssh_common_args: ()
<162.243.130.31> SSH: PlayContext set ssh_extra_args: ()
<162.243.130.31> SSH: found only ControlPersist; added ControlPath: (-o)(ControlPath=/home/sergio/.ansible/cp/20aa9590ff)
<162.243.130.31> SSH: EXEC ssh -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 -o ControlPath=/home/sergio/.ansible/cp/20aa9590ff -tt 162.243.130.31 ‘/bin/sh -c ‘"’"’/usr/bin/python /home/web/.ansible/tmp/ansible-tmp-1492645362.48-248327338837571/command.py; rm -rf “/home/web/.ansible/tmp/ansible-tmp-1492645362.48-248327338837571/” > /dev/null 2>&1 && sleep 0’"’"’’
<162.243.130.31> (0, ‘\r\n{“changed”: true, “end”: “2017-04-19 23:42:43.239314”, “stdout”: “”, “cmd”: [“wp”, “core”, “is-installed”, “–network”], “rc”: 1, “start”: “2017-04-19 23:42:43.134075”, “stderr”: “Error: This does not seem to be a WordPress install.\nPass --path=path/to/wordpress or run wp core download.”, “delta”: “0:00:00.105239”, “invocation”: {“module_args”: {“warn”: true, “executable”: null, “chdir”: “/srv/www/multisite.com/releases/20170419234211”, “_raw_params”: “wp core is-installed --network”, “removes”: null, “creates”: null, “_uses_shell”: false}}, “warnings”: []}\r\n’, ‘OpenSSH_7.3p1 Ubuntu-1, OpenSSL 1.0.2g 1 Mar 2016\r\ndebug1: Reading configuration data /home/sergio/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 8350\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\nShared connection to 162.243.130.31 closed.\r\n’)
System info:
Ansible 2.3.0.0; Linux
Trellis at “Add bin/xdebug-tunnel.sh to manage Xdebug and SSH tunnels on remote hosts”

Error: This does not seem to be a WordPress install.
Pass --path=path/to/wordpress or run wp core download.
fatal: [162.243.130.31]: FAILED! => {
“changed”: false,
“cmd”: [
“wp”,
“core”,
“is-installed”,
"–network"
],
“delta”: “0:00:00.105239”,
“end”: “2017-04-19 23:42:43.239314”,
“failed”: true,
“failed_when_result”: true,
“invocation”: {
“module_args”: {
"_raw_params": “wp core is-installed --network”,
"_uses_shell": false,
“chdir”: “/srv/www/multisite.com/releases/20170419234211”,
“creates”: null,
“executable”: null,
“removes”: null,
“warn”: true
}
},
“rc”: 1,
“start”: “2017-04-19 23:42:43.134075”,
“stderr”: “Error: This does not seem to be a WordPress install.\nPass --path=path/to/wordpress or run wp core download.”,
“stderr_lines”: [
“Error: This does not seem to be a WordPress install.”,
“Pass --path=path/to/wordpress or run wp core download.”
],
“stdout”: “”,
“stdout_lines”: []
}
to retry, use: --limit @/home/sergio/sites/multisite.com/trellis/deploy.retry

PLAY RECAP **********************************************************************************************************************************************
162.243.130.31 : ok=18 changed=11 unreachable=0 failed=1
localhost : ok=0 changed=0 unreachable=0 failed=0

error.log:
2017/04/20 00:24:23 [error] 28733#28733: *18 FastCGI sent in stderr: “PHP message: PHP Warning: require(/srv/www/multisite.com/releases/20170419234211/web/wp/wp-blog-header.php): failed to open stream: No such file or directory in /srv/www/multisite.com/releases/20170419234211/web/index.php on line 5
PHP message: PHP Fatal error: require(): Failed opening required ‘/srv/www/multisite.com/releases/20170419234211/web/wp/wp-blog-header.php’ (include_path=’.:/usr/share/php’) in /srv/www/multisite.com/releases/20170419234211/web/index.php on line 5” while reading response header from upstream, client: 172.222.145.195, server: multisite.com, request: “GET / HTTP/2.0”, upstream: “fastcgi://unix:/var/run/php-fpm-wordpress.sock:”, host: “multisite.com

Not sure this is related, but I checked on the DO droplet and it seems that the /srv/www/multisite.com/releases/20170419234211/web/wp folder only contains a composer.json and README.md file

Thinking of backing up the themes and database and starting from scratch, though I’d like to avoid it if possible.

Could you try these remote server steps just to rule that out first?

No luck.Things of note:
composer require johnpbloch/wordpress:4.7.3 installed johnpbloch/wordpress-core that was not there before.
composer clear-cache was missing(?) Cache directory does not exist (cache-vcs-dir)

Also, this would be the initial deploy.

Make sure the composer.json and composer.lock committed to the repo have johnpbloch/wordpress 4.7.3 (vs. some older version) and that you have pushed that change to the git remote.

It looks like your Trellis version is from roughly Nov 2016. You’ll probably want to update your Trellis to take advantage of a fix for multisite deploys and Ansible 2.3 compatibility.

I’m not yet sure what is causing the problem, but maybe the notes and steps above will help as you keep working on it.

Would Best practices to update trellis be the way to update? What would be the recommended way to update a, semi :slight_smile:, existing setup?

That was rough, for my level of knowledge! I hear it over and over on here. Roots pushes you to learn and become better at every turn.

I set up a new stack as per the previous link. Fingers crossed…

1 Like

Nice job @Sergio! Hopefully that approach will serve you well. Even if you don’t stick with that approach in the long run, I think it’s a valuable git experience to have under your belt.

I’m attracted to the @hooverlunch git subtree approach mentioned in that thread, but I haven’t tried it yet. It looks like once it is set up, maybe it would be easier to maintain. Some people also find cherry-picking useful for their needs.

Thanks @fullyint. So much to learn about git!

I got the provisioning done and deployed just fine.
Now, though, the main domain page (mypage.com) takes me to https://mypage.com/wp-signup.php?new=mypage.com and if I go to any of the subdomains, existing or not, I get a warning about Error code: SSL_ERROR_BAD_CERT_DOMAIN

When I connect to the production database ( I know it should be staging, just testing things) via MYSQL Workbench, I see the database created, but empty. wp db export/import?

I should start a new thread…