The conditional check 'wp_installed.stderr != ""' failed

Hello,
I have provisioned server on my own, I am trying to use trellis only to deploy the code.
However it is failing on TASK [deploy : WordPress Installed?] step with error:

The conditional check 'wp_installed.stderr != ""' failed. The error was: error while evaluating conditional (wp_installed.stderr != ""): 'dict object' has no attribute 'stderr' fatal: [54.93.128.153]: FAILED! => {"failed": true}

Any clues? I am stuck, out of ideas

That’s a pretty strange error to get at that point.

You could try editing roles/deploy/hooks/finalize-before.yml to match this diff:

     chdir: "{{ deploy_helper.new_release_path }}"
   register: wp_installed
   changed_when: false
-  failed_when: wp_installed.stderr != ""
+
+- debug:
+    var: wp_installed

 - name: Get WP theme template and stylesheet roots
   shell: >

This will dump the contents of that wp_installed and maybe provide a clue.

Thanks for the feedback, output is:

[Errno 2] No such file or directory: ‘wp’
The full traceback is:
File “/tmp/ansible_wh0va2nn/ansible_modlib.zip/ansible/module_utils/basic.py”, line 2736, in run_command
cmd = subprocess.Popen(args, **kwargs)
File “/usr/lib/python3.5/subprocess.py”, line 947, in init
restore_signals, start_new_session)
File “/usr/lib/python3.5/subprocess.py”, line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg)

fatal: [52.57.18.238]: FAILED! => {
“changed”: false,
“cmd”: “wp core is-installed --skip-plugins --skip-themes --require=/home/virtual/my-project.com/shared/tmp_multisite_constants.php”,
“failed”: true,
“invocation”: {
“module_args”: {
“_raw_params”: “wp core is-installed --skip-plugins --skip-themes --require=/home/virtual/my-project.com.com/shared/tmp_multisite_constants.php”,
“_uses_shell”: false,
“chdir”: “/home/virtual/my-project.com/releases/20171128120543”,
“creates”: null,
“executable”: null,
“removes”: null,
“stdin”: null,
“warn”: true
}
},
“rc”: 2
}

The thing is, I haven’t provisioned server using trellis, I prepared it on my own. I have also imported wordpress database (as project already exists, I am migrating it to trellis). Is there anything else I should do so trellis knows wordpress was already installed? As far as I can see in releases directories there are wp core files.

Yes, a lot of things probably. But the actual issue you’re running into is you don’t have WP-CLI installed globally (or at all).

[Errno 2] No such file or directory: 'wp’.

So you’ll need to install WP-CLI and then keep working through issues if there are anymore.

1 Like

Thanks Scott!
This was the last thing I was missing, now all works correctly