Roots Discourse

Deploy issue

Hi guys,
I can’t go through deploying to DigitalOcean. I’ve got error (below):
I have repo on bitbucket, my local setup:
[✓] Vagrant [>= 2.1.0]: 2.2.7
[✓] VirtualBox [>= 4.3.10]: 5.2.20r125813
ansible 2.9.4
Homebrew 2.2.5
Mac os 10.15.2 Catalina

TASK [deploy : Clone project files] ********************************************************************************************************************************************
System info:
  Ansible 2.9.4; Darwin
  Trellis Head
---------------------------------------------------
fatal: [142.93.237.43]: FAILED! => {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result", "changed": false}
...ignoring

TASK [deploy : Remove untracked files from project folder] *********************************************************************************************************************
System info:
  Ansible 2.9.4; Darwin
  Trellis Head
---------------------------------------------------
The conditional check 'not not(git_clean.stdout)' failed. The error was:
error while evaluating conditional (not not(git_clean.stdout)): 'dict object'
has no attribute 'stdout'
fatal: [142.93.237.43]: FAILED! => {}

PLAY RECAP *********************************************************************************************************************************************************************
142.93.237.43              : ok=5    changed=0    unreachable=0    failed=1    skipped=12   rescued=0    ignored=1

Also don’t know if it’s related but I have some warnings at the beginning of the process:

PLAY [Ensure necessary variables are defined] **********************************************************************************************************************************
[WARNING]: You Ansible version is 2.9.4 but this version of Trellis has only been tested for compatability with Ansible 2.7.12 -> 2.8.4. It is advisable to check for Trellis
updates or downgrade your Ansible version.

/usr/local/Cellar/ansible/2.9.4/libexec/lib/python3.8/site-packages/Crypto/Random/Fortuna/FortunaGenerator.py:28: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if sys.version_info[0] is 2 and  sys.version_info[1] is 1:
/usr/local/Cellar/ansible/2.9.4/libexec/lib/python3.8/site-packages/Crypto/Random/Fortuna/FortunaGenerator.py:28: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if sys.version_info[0] is 2 and  sys.version_info[1] is 1:

TASK [Ensure environment is defined] *******************************************************************************************************************************************
[WARNING]: Failure using method (v2_runner_on_start) in callback plugin (<ansible.plugins.callback.output.CallbackModule object at 0x114525cd0>): 'show_per_host_start'

[WARNING]: Skipping plugin (/usr/local/Cellar/ansible/2.9.4/libexec/lib/python3.8/site-packages/ansible/plugins/filter/gcp_kms_filters.py) as it seems to be invalid: expected
str, bytes or os.PathLike object, not NoneType

/usr/local/Cellar/ansible/2.9.4/libexec/lib/python3.8/site-packages/netaddr/strategy/__init__.py:189: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if word_sep is not '':
/usr/local/Cellar/ansible/2.9.4/libexec/lib/python3.8/site-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if x is 0 or x is 1:
/usr/local/Cellar/ansible/2.9.4/libexec/lib/python3.8/site-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if x is 0 or x is 1:
/usr/local/Cellar/ansible/2.9.4/libexec/lib/python3.8/site-packages/jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif y is 0 or y is 1:
/usr/local/Cellar/ansible/2.9.4/libexec/lib/python3.8/site-packages/jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif y is 0 or y is 1:
/usr/local/Cellar/ansible/2.9.4/libexec/lib/python3.8/site-packages/jmespath/visitor.py:260: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if original_result is 0:
skipping: [localhost]
[WARNING]: Skipping plugin (/usr/local/Cellar/ansible/2.9.4/libexec/lib/python3.8/site-packages/ansible/plugins/filter/gcp_kms_filters.py) as it seems to be invalid: expected
str, bytes or os.PathLike object, not NoneType

I encountered this recently but can’t remember for the life of me how I resolved it. I think the first step is to install the correct Ansible version that it specifies for you there.

sudo pip uninstall ansible && sudo pip install ansible==2.8.4
1 Like

Thanks @Galaxianz I did that, rolled back to 2.8.4

but I’ve got the same error while trying to deploy it trellis deploy staging staging.krytpokasyna.com, I even tried to destroy and re-deploy a new droplet.

TASK [deploy : Add known_hosts] ************************************************
ok: [167.172.111.171] => (item=github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==)
ok: [167.172.111.171] => (item=bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==)
ok: [167.172.111.171] => (item=gitlab.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAfuCHKVTjquxvt6CM6tdG4SLp1Btn/nOeHHE5UOzRdf)
ok: [167.172.111.171] => (item=gitlab.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCsj2bNKTBSpIYDEGk9KxsGh3mySTRgMtXL583qmBpzeQ+jqCMRgBqB98u3z++J1sKlXHWfM9dyhSevkMwSbhoR8XIq/U0tCNyokEi/ueaBMCvbcTHhO7FcwzY92WK4Yt0aGROY5qX2UKSeOvuP4D6TPqKF1onrSzH9bx9XUf2lEdWT/ia1NEKjunUqu1xOB/StKDHMoX4/OKyIzuS0q/T1zOATthvasJFoPrAjkohTyaDUz2LN5JoH839hViyEG82yB+MjcFV5MU3N1l1QL3cVUCh93xSaua1N85qivl+siMkPGbO5xR/En4iEY6K2XPASUEMaieWVNTRCtJ4S8H+9)

TASK [deploy : Clone project files] ********************************************
System info:
  Ansible 2.8.4; Darwin
  Trellis Head
---------------------------------------------------
fatal: [167.172.111.171]: FAILED! => {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result", "changed": false}
...ignoring

TASK [deploy : Remove untracked files from project folder] *********************
System info:
  Ansible 2.8.4; Darwin
  Trellis Head
---------------------------------------------------
The conditional check 'not not(git_clean.stdout)' failed. The error was:
error while evaluating conditional (not not(git_clean.stdout)): 'dict object'
has no attribute 'stdout'
fatal: [167.172.111.171]: FAILED! => {}

If it helps I did provisioning for staging and finished without problems (only deprecation warnings).

TASK [wordpress-setup : Enable WordPress site] *********************************************************************************************************************************
ok: [167.172.111.171] => (item=staging.kryptokasyna.com)

TASK [wordpress-setup : Setup WP system cron] **********************************************************************************************************************************
ok: [167.172.111.171] => (item=staging.kryptokasyna.com)

TASK [wordpress-setup : Setup WP Multisite system cron] ************************************************************************************************************************
ok: [167.172.111.171] => (item=staging.kryptokasyna.com)

PLAY RECAP *********************************************************************************************************************************************************************
167.172.111.171            : ok=124  changed=6    unreachable=0    failed=0    skipped=46   rescued=0    ignored=0

I’m new to setting up trellis and WordPress for deployment but I got the same error as you @tjedrak, solved it when I realised I forgot to add the repo address here.

Hope that help :wink:

Hey @britotiagos no, that’s not the case. I have my bitbucket repo in my configs.

I added issue to #1146

Also in verbose mode:

TASK [deploy : Remove untracked files from project folder] **************************************************************************************************
task path: /Users/tomaszjedrak/Wordpress/kryptokasyna/trellis/roles/deploy/tasks/update.yml:27
Using module file /Library/Python/2.7/site-packages/ansible/modules/commands/command.py
Pipelining is enabled.
<staging.kryptokasyna.com> ESTABLISH SSH CONNECTION FOR USER: web
<staging.kryptokasyna.com> SSH: EXEC ssh -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="web"' -o ConnectTimeout=10 -o ControlPath=/Users/tomaszjedrak/.ansible/cp/9e79ed61d4 staging.kryptokasyna.com '/bin/sh -c '"'"'/usr/bin/python && sleep 0'"'"''
<staging.kryptokasyna.com> (1, '', 'Traceback (most recent call last):\n  File "<stdin>", line 114, in <module>\n  File "<stdin>", line 106, in _ansiballz_main\n  File "<stdin>", line 49, in invoke_module\n  File "/tmp/ansible_command_payload_fsFCB_/__main__.py", line 327, in <module>\n  File "/tmp/ansible_command_payload_fsFCB_/__main__.py", line 263, in main\nOSError: [Errno 2] No such file or directory: \'/srv/www/staging.kryptokasyna.com/shared/source\'\n')
<staging.kryptokasyna.com> Failed to connect to the host via ssh: Traceback (most recent call last):
  File "<stdin>", line 114, in <module>
  File "<stdin>", line 106, in _ansiballz_main
  File "<stdin>", line 49, in invoke_module
  File "/tmp/ansible_command_payload_fsFCB_/__main__.py", line 327, in <module>
  File "/tmp/ansible_command_payload_fsFCB_/__main__.py", line 263, in main
OSError: [Errno 2] No such file or directory: '/srv/www/staging.kryptokasyna.com/shared/source'
System info:
  Ansible 2.8.4; Darwin
  Trellis Head
---------------------------------------------------
The conditional check 'not not(git_clean.stdout)' failed. The error was:
error while evaluating conditional (not not(git_clean.stdout)): 'dict object'
has no attribute 'stdout'
fatal: [staging.kryptokasyna.com]: FAILED! => {}
1 Like

Guys, we can close this topic, apparently I made mistake in config. I used staging branch without having it on bitbucket.

1 Like

There was a bug related to this which was fixed as well. See https://github.com/roots/trellis/pull/1151

Maybe that was also causing issues @tjedrak

Thanks @swalkinshaw, but it was my mistake with config :slight_smile: