Roots Discourse

Trellis on Win10 + WSL2 - Vagrant up seems to fail because of pip / ansible?

Hi there,

I recently posted on my Initial attempt to install Trellis on Win10 + WSL2.

Here is the beginning of my story :

It occurs I had a problem with my vagrant version.

Once the problem solvedI managed to get a bit further. Doing a vagrant up --provision was going well until an other problem append :

Ansible seems to unroll its tasks up to that point :

TASK [wordpress-install : Change site owner to user] ***************************
System info:
  Ansible 2.8.0; Vagrant 2.2.10; Linux
  Trellis version (per changelog): "Validate that `letsencrypt_contact_emails` is a list"
---------------------------------------------------
MODULE FAILURE
See stdout/stderr for the exact error
<stdin>:18: DeprecationWarning: the imp module is deprecated in favour of
importlib; see the module's documentation for alternative uses
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.8/imp.py", line 234, in load_module
    return load_source(name, filename, file)
  File "/usr/lib/python3.8/imp.py", line 169, in load_source
    module = _exec(spec, sys.modules[name])
  File "<frozen importlib._bootstrap>", line 604, in _exec
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in
_call_with_frames_removed
  File "/tmp/ansible_file_payload_0bs85_9u/__main__.py", line 921, in
<module>
  File "/tmp/ansible_file_payload_0bs85_9u/__main__.py", line 907, in main
  File "/tmp/ansible_file_payload_0bs85_9u/__main__.py", line 629, in
ensure_directory
  File "/tmp/ansible_file_payload_0bs85_9u/__main__.py", line 344, in
recursive_set_attributes
  File "/tmp/ansible_file_payload_0bs85_9u/__main__.py", line 344, in
recursive_set_attributes
  File "/tmp/ansible_file_payload_0bs85_9u/__main__.py", line 344, in
recursive_set_attributes
  [Previous line repeated 980 more times]
  File "/tmp/ansible_file_payload_0bs85_9u/__main__.py", line 335, in
recursive_set_attributes
  File "/tmp/ansible_file_payload_0bs85_9u/ansible_file_payload.zip/ansible/m
odule_utils/basic.py", line 1332, in set_fs_attributes_if_different
  File "/tmp/ansible_file_payload_0bs85_9u/ansible_file_payload.zip/ansible/m
odule_utils/basic.py", line 985, in set_owner_if_different
  File "/tmp/ansible_file_payload_0bs85_9u/ansible_file_payload.zip/ansible/m
odule_utils/basic.py", line 877, in user_and_group
  File "/tmp/ansible_file_payload_0bs85_9u/ansible_file_payload.zip/ansible/m
odule_utils/_text.py", line 116, in to_bytes
RecursionError: maximum recursion depth exceeded while calling a Python
object

failed: [default] (item=ipsum.com) => {"ansible_loop_var": "item", "changed": false, "item": {"key": "ipsum.com", "va
lue": {"admin_email": "admin@example.test", "cache": {"enabled": false}, "local_path": "../site", "multisite": {"enab
led": false}, "site_hosts": [{"canonical": "ipsum.lan", "redirects": ["www.ipsum.lan"]}], "ssl": {"enabled": false, "
provider": "self-signed"}}}, "module_stdout": "", "rc": 1}

The troubleshooting section of the documentation did talk about a recursion problem, so here I go, I try the suggested fix by downgrading ansible to v2.5.1 :

  • pip3 install ansible==2.5.1
  • Updating vagrant.default.yml with vagrant_ansible_version: '2.5.1'

Then I replay a vagrant up --provision leading to a new error. Here are the logs of the operation :

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'bento/ubuntu-20.04' version '202010.24.0' is up to date...
==> default: [vagrant-hostmanager:guests] Updating hosts file on active guest virtual machines...
==> default: [vagrant-hostmanager:host] Updating hosts file on your workstation (password may be required)...
==> default: Running provisioner: shell...
    default: Running: inline script
    default: Reading package lists...
    default: Building dependency tree...
    default: Reading state information...
    default: The following additional packages will be installed:
    default:   libssl-dev
    default: Suggested packages:
    default:   libssl-doc
    default: The following packages will be upgraded:
    default:   libssl-dev libssl1.1
    default: 2 upgraded, 0 newly installed, 0 to remove and 52 not upgraded.
    default: Need to get 3,342 kB of archives.
    default: After this operation, 201 kB of additional disk space will be used.
    default: Get:1 http://ppa.launchpad.net/ondrej/php/ubuntu focal/main amd64 libssl-dev amd64 1.1.1g-1+ubuntu20.04.
1+deb.sury.org+1 [1,808 kB]
    default: Get:2 http://ppa.launchpad.net/ondrej/php/ubuntu focal/main amd64 libssl1.1 amd64 1.1.1g-1+ubuntu20.04.1
+deb.sury.org+1 [1,535 kB]
    default: Preconfiguring packages ...
    default: Fetched 3,342 kB in 1s (2,313 kB/s)
    default: (Reading database ...
    default: (Reading database ... 5%
    default: (Reading database ... 10%
    default: (Reading database ... 15%
    default: (Reading database ... 20%
    default: (Reading database ... 25%
    default: (Reading database ... 30%
(Reading database ... 60%abase ... 35%
    default: (Reading database ... 65%
    default: (Reading database ... 70%
    default: (Reading database ... 75%
    default: (Reading database ... 80%
    default: (Reading database ... 85%
    default: (Reading database ... 90%
    default: (Reading database ... 95%
    default: (Reading database ... 100%
    default: (Reading database ...
    default: 51979 files and directories currently installed.)
    default: Preparing to unpack .../libssl-dev_1.1.1g-1+ubuntu20.04.1+deb.sury.org+1_amd64.deb ...
    default: Unpacking libssl-dev:amd64 (1.1.1g-1+ubuntu20.04.1+deb.sury.org+1) over (1.1.1f-1ubuntu2) ...
    default: Preparing to unpack .../libssl1.1_1.1.1g-1+ubuntu20.04.1+deb.sury.org+1_amd64.deb ...
    default: Unpacking libssl1.1:amd64 (1.1.1g-1+ubuntu20.04.1+deb.sury.org+1) over (1.1.1f-1ubuntu2) ...
    default: Setting up libssl1.1:amd64 (1.1.1g-1+ubuntu20.04.1+deb.sury.org+1) ...
    default: Setting up libssl-dev:amd64 (1.1.1g-1+ubuntu20.04.1+deb.sury.org+1) ...
    default: Processing triggers for libc-bin (2.31-0ubuntu9.1) ...
==> default: Running provisioner: ansible_local...
    default: Installing Ansible...
    default: Installing pip... (for Ansible installation)
    default: Running ansible-galaxy...
/usr/local/lib/python2.7/dist-packages/ansible/parsing/vault/__init__.py:44: CryptographyDeprecationWarning: Python 2
 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be remove
d in a future release.
  from cryptography.exceptions import InvalidSignature
- changing role composer from 1.7.6 to 1.7.6
- downloading role 'composer', owned by geerlingguy
- downloading role from https://github.com/geerlingguy/ansible-role-composer/archive/1.7.6.tar.gz
- extracting composer to /home/vagrant/trellis/vendor/roles/composer
- composer (1.7.6) was installed successfully
- changing role ntp from 2.0.0 to 2.0.0
- downloading role 'ntp', owned by geerlingguy
- downloading role from https://github.com/geerlingguy/ansible-role-ntp/archive/2.0.0.tar.gz
- extracting ntp to /home/vagrant/trellis/vendor/roles/ntp
- ntp (2.0.0) was installed successfully
- changing role logrotate from v0.0.5 to v0.0.5
- downloading role 'logrotate', owned by nickhammond
- downloading role from https://github.com/nickhammond/ansible-logrotate/archive/v0.0.5.tar.gz
- extracting logrotate to /home/vagrant/trellis/vendor/roles/logrotate
- logrotate (v0.0.5) was installed successfully
- changing role swapfile from v2.0.26 to v2.0.26
- downloading role 'swapfile', owned by oefenweb
- downloading role from https://github.com/Oefenweb/ansible-swapfile/archive/v2.0.26.tar.gz
- extracting swapfile to /home/vagrant/trellis/vendor/roles/swapfile
- swapfile (v2.0.26) was installed successfully
- changing role mailhog from 2.2.0 to 2.2.0
- downloading role 'mailhog', owned by geerlingguy
- downloading role from https://github.com/geerlingguy/ansible-role-mailhog/archive/2.2.0.tar.gz
- extracting mailhog to /home/vagrant/trellis/vendor/roles/mailhog
- mailhog (2.2.0) was installed successfully
 [WARNING]: - dependency geerlingguy.daemonize from role mailhog differs from
already installed version (1.2.1), skipping

    default: Running ansible-playbook...
/usr/local/lib/python2.7/dist-packages/ansible/parsing/vault/__init__.py:44: CryptographyDeprecationWarning: Python 2
 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be remove
d in a future release.
  from cryptography.exceptions import InvalidSignature
ERROR! Unexpected Exception, this is probably a bug: cannot import name context
to see the full traceback, use -vvv
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

Thanks for helping :slight_smile:

I faced too many issues for 2 full days trying to get it working on the latest Windows 10 Pro with no luck. Tried different combinations of Tellis, Vagrant, VirtualBox, and WSL versions. Not to mention the countless rabbit holes into niche github repos for every new issue.

Even when I finally got no errors for “vagrant up”, the ip and development domain weren’t responding to browser and terminal pings.

Ended up installing linux (Elementary OS) alongside Windows. Would recommend this approach if you’re serious about the Roots stack.

Hi thanks for you reply, I began to think I was alone trying to make Trellis work on Windows.

Same for me : too many struggles so I decided to let it go and abandon Trellis for now. I wanted to give a try to the full Roots stack but what does really matter for me now is Bedrock + Sage.

I started a local development stack with ddev and will think about the deployment part later.