Ansible error deploying new dev environment in WSL - TASK [wordpress-install : Change site owner to user] ends with RecursionError: maximum recursion depth exceeded

I’m currently trying to deploy a fresh Trellis dev environment in WSL (Ubuntu 18.0.4), and I keep running into the same error:

TASK [wordpress-install : Change site owner to user] ***************************
System info:
  Ansible 2.8.4; Vagrant 2.2.7; Linux
  Trellis Head
---------------------------------------------------
MODULE FAILURE
See stdout/stderr for the exact error
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 "/usr/lib/python3.6/imp.py", line 235, in load_module
    return load_source(name, filename, file)
  File "/usr/lib/python3.6/imp.py", line 170, in load_source
    module = _exec(spec, sys.modules[name])
  File "<frozen importlib._bootstrap>", line 618, in _exec
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in
_call_with_frames_removed
  File "/tmp/ansible_file_payload_3a2glouv/__main__.py", line 921, in
<module>
  File "/tmp/ansible_file_payload_3a2glouv/__main__.py", line 907, in main
  File "/tmp/ansible_file_payload_3a2glouv/__main__.py", line 629, in
ensure_directory
  File "/tmp/ansible_file_payload_3a2glouv/__main__.py", line 344, in
recursive_set_attributes
  File "/tmp/ansible_file_payload_3a2glouv/__main__.py", line 344, in
recursive_set_attributes
  File "/tmp/ansible_file_payload_3a2glouv/__main__.py", line 344, in
recursive_set_attributes
  [Previous line repeated 982 more times]
  File "/tmp/ansible_file_payload_3a2glouv/__main__.py", line 335, in
recursive_set_attributes
  File "/tmp/ansible_file_payload_3a2glouv/ansible_file_payload.zip/ansible/m
odule_utils/basic.py", line 1333, in set_fs_attributes_if_different
  File "/tmp/ansible_file_payload_3a2glouv/ansible_file_payload.zip/ansible/m
odule_utils/basic.py", line 985, in set_owner_if_different
  File "/tmp/ansible_file_payload_3a2glouv/ansible_file_payload.zip/ansible/m
odule_utils/basic.py", line 877, in user_and_group
RecursionError: maximum recursion depth exceeded

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: RecursionError: maximum recursion depth exceeded
failed: [default] (item=example.com) => {"ansible_loop_var": "item", "changed": false, "item": {"key": "example.com", "value": {"admin_email": "admin@example.test", "cache": {"enabled": false}, "local_path": "../site", "multisite": {"enabled": false}, "site_hosts": [{"canonical": "example.test", "redirects": ["www.example.test"]}], "ssl": {"enabled": false, "provider": "self-signed"}}}, "module_stdout": "", "rc": 1}

The documentation suggests that I downgrade to Ansible 2.5.1 and reprovisioning to fix this error (https://roots.io/getting-started/docs/windows-development-environment-trellis/). This solution no longer works, however, as Trellis no longer supports Ansible 2.5.1 (https://github.com/roots/trellis/commit/66d1445b0d72ee81631c4d55b287b8da72e3747f).

I tried the default Ansible version first (2.7.12), as well as 2.7.5 (mentioned in the above linked docs), 2.7.16 (latest 2.7), and 2.8.3 (highest supported).

Manually reverting /trellis/lib/trellis/plugins/vars/version.py to:

version_requirement = '2.5.1'

Fixes the error for me, but the solution is suboptimal. Is there a workaround that doesn’t involve downgrading Ansible to an unsupported and insecure version?

This topic was automatically closed after 42 days. New replies are no longer allowed.