Roots Discourse

Issues with fresh Trellis project

trellis new issues.com
cd issues.com
trellis up

Gives me the following error:

TASK [wordpress-install : Copy .env file into web root] ************************
System info:
  Ansible 2.8.13; Vagrant 2.2.9; Darwin
  Trellis 1.4.0: April 2nd, 2020
---------------------------------------------------
Unexpected failure during module execution.
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'VariableManager' object has no attribute '_loader'
fatal: [default]: FAILED! => {"stdout": ""}

and then further down

PLAY RECAP *********************************************************************
default                    : ok=118  changed=82   unreachable=0    failed=1    skipped=32   rescued=0    ignored=0

/usr/local/Cellar/python@3.8/3.8.3_2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 4077 leaked semaphore objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
exit status 1

Since that failed, I did a cd trellis and vagrant reload --provision as mentioned in the docs. That gave the following error:

TASK [common : Validate format of site_hosts] **********************************
System info:
  Ansible 2.7.18; Vagrant 2.2.9; Darwin
  Trellis 1.4.0: April 2nd, 2020
---------------------------------------------------
with_dict expects a dict
fatal: [default]: FAILED! => {}
	to retry, use: --limit @/Users/jon/Dev/wordpress/issues.com/trellis/dev.retry

PLAY RECAP *********************************************************************
default                    : ok=3    changed=0    unreachable=0    failed=1

/usr/local/Cellar/python@3.8/3.8.3_2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 182 leaked semaphore objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

I didn’t touch any of the configuration files, and I’ve done this several times in the past without issue. Any idea what’s going on here?

MacOS Catalina 10.15.6
vagrant 2.2.9
virtualbox 6.1.12
trellis-cli 0.9.0
ansible (in virtualenv) 2.8.13
python (in virtualenv) 3.8.3
trellis 1.4.0
bedrock 1.13.5

I started having issues July 22nd. I saw that ansible released a new version on the 21st, but that’s not the version that trellis-cli is pulling.

:thinking: someone else had this same error and solved it with different Ansible/python versions: Issues installing Ansible on Mac OS

I also found https://github.com/ansible/ansible/issues/64745 though it implied it was an issue with 2.9 and fixed in 2.9.1 (you were using 2.8.13)

The easiest thing I can think to try is forcing a newer version of Ansible. You can edit trellis/requirements.txt to look like this:

ansible>=2.9.1,<3.0
passlib

And run trellis exec pip install -r requirements.txt --upgrade. Running trellis exec ansible --version should show 2.9.1 at least I hope. Then try trellis up again please.

Thanks Scott, I appreciate you getting back to me on this!

I read your message and did some digging. I updated the requirments.txt file and made sure it was installing 2.9.11. Running trellis exec ansible --version did print out 2.9.11. But it still wasn’t working.

I noticed that the vagrant provision error said I was running ansible 2.7.18. For some reason, it was falling back to the version that was installed globally on my computer (that I didn’t even know about). Not when I checked the version, but when the scripts actually ran.

Lo an behold, updating to 2.9.11 globally fixed the issue. Thanks for your help!