Roots Discourse

Letsencrypt fails vagrant up / provision

trying to build a new trellis dev enviroument, the vagrant provisioning proccess is stuck with an error on letsencrypt_contact_emails …
I was using fresh treliis from github, just as in docs, and also tried bumping ansible to 2.9.6 as seen in the output here. Also tried bumping ntp, composer to older versions as suggested on a similar thread. However it got me nowhere…

worth mentioning:
the errors here say python 3.8 , but if i vagrant ssh and run python --version it says 2,7, same with pip. I now realize that inside vagrant there is also python3.
My host system is ubuntu 20.04.1, i have composer 2.0.8 on it, i wonder if that matters

TASK [wordpress-install : Setup composer authentications - mifl.com] *********
skipping: [default] => (item=None) 
skipping: [default]

TASK [wordpress-install : Install Dependencies with Composer] ******************
System info:
  Ansible 2.9.8; Vagrant 2.2.14; Linux
  Trellis version (per changelog): "Validate that `letsencrypt_contact_emails` is a list"
---------------------------------------------------
MODULE FAILURE
See stdout/stderr for the exact error
Traceback (most recent call last):
  File "<stdin>", line 102, in <module>
  File "<stdin>", line 94, in _ansiballz_main
  File "<stdin>", line 40, in invoke_module
  File "/usr/lib/python3.8/runpy.py", line 207, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_composer_payload_owx5j6r6/ansible_composer_payload.zip/a
nsible/modules/packaging/language/composer.py", line 271, in <module>
  File "/tmp/ansible_composer_payload_owx5j6r6/ansible_composer_payload.zip/a
nsible/modules/packaging/language/composer.py", line 217, in main
  File "/tmp/ansible_composer_payload_owx5j6r6/ansible_composer_payload.zip/a
nsible/modules/packaging/language/composer.py", line 170, in
get_available_options
  File "/tmp/ansible_composer_payload_owx5j6r6/ansible_composer_payload.zip/a
nsible/module_utils/basic.py", line 2022, in from_json
  File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 1)
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: json.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 1)
failed: [default] (item=mifl.com) => {"ansible_loop_var": "item", "changed": false, "item": {"key": "mifl.com", "value": {"admin_email": "admin@mifl.com", "cache": {"enabled": false}, "local_path": "../site", "multisite": {"enabled": false}, "site_hosts": [{"canonical": "mifl.test", "redirects": ["www.mifl.test"]}], "ssl": {"enabled": false, "provider": "self-signed"}}}, "module_stdout": "", "rc": 1}

PLAY RECAP *********************************************************************
default                    : ok=116  changed=3    unreachable=0    failed=1    skipped=40   rescued=0    ignored=0   

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

If you have ssl enabled in trellis/group_vars/your_env/wordpress_sites.yml but letsencrypt_contact_emails not defined, then you will likely see something in that fashion.

Look for those settings, and if the problem remains, please provide some more details.

ssl is set to enabled: false, and i also tried adding letsencrypt_contact_emails to main.yml and still got this error.

What more details can i provide?

It seems there are a number of similar recent posts on the forum: https://discourse.roots.io/search?q=Validate%20that%20`letsencrypt_contact_emails`%20is%20a%20list

Sorry I can’t be of more help right now than pointing to those posts.

Had the same issue, turns out it had nothing to do with letsencrypt at all:

This issue turned out to be a deprecated PHP option that was added in a recent merge. This was corrected as of this morning, so installing a fresh version of Trellis should fix your problem.

1 Like

Awesome news!

However it is still failing for after a new trellis install…

this is the output from vagrant provision -vvvv
[after vagrant destroy, new install, vagrant up [which failed in the same way]

TASK [ntp : Populate service facts.] *******************************************
System info:
  Ansible 2.8.0; Vagrant 2.2.14; Linux
  Trellis version (per changelog): "Fix #1263 - Remove deprecated PHP option `track_errors`"
---------------------------------------------------
Malformed output discovered from systemd list-unit-files: accounts-
daemon.service                enabled         enabled
fatal: [default]: FAILED! => {"changed": false}

RUNNING HANDLER [fail2ban : restart fail2ban] **********************************
changed: [default]

RUNNING HANDLER [ferm : restart ferm] ******************************************
skipping: [default]

PLAY RECAP *********************************************************************
default                    : ok=30   changed=11   unreachable=0    failed=1    skipped=16   rescued=0    ignored=0   

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

See https://github.com/roots/trellis/issues/1263 for details on the original Composer failure which has been fixed in https://github.com/roots/trellis/pull/1264.

Closing this thread since it will get confusing with other unrelated issues.