Trellis up fails at: TASK [common : Load wordpress_sites.yml vars into <env>_sites vars]

I have a project that I work on with my iMac regularly and I am attempting to get it working on my Macbook but it fails at this line:

TASK [common : Load wordpress_sites.yml vars into <env>_sites vars] ***********************************************************
System info:
  Ansible 2.9.10; Darwin
  Trellis version (per changelog): "Fix #1284 - Update logrotate postrotate Nginx command"
---------------------------------------------------
An unhandled exception occurred while templating '{{ lookup('filetree',
playbook_dir + '/group_vars') | selectattr('path', 'match', '(' + env_groups
| join('|') + ')/wordpress_sites\.yml$') | map(attribute='path') |
map('regex_replace', '([^/]*)/.*', '\1') | list }}'. Error was a <class
'ansible.errors.AnsibleError'>, original message: An unhandled exception
occurred while templating '{{ ['development', 'staging', 'production'] |
intersect(group_names) }}'. Error was a <class
'ansible.errors.AnsibleError'>, original message: template error while
templating string: No filter named 'intersect'.. String: {{ ['development',
'staging', 'production'] | interse

I am unable to find any answers anywhere. Hopefully someone can help my dissect this error message.

Please read How to best ask questions on this forum

This post is lacking critical information such as:

  • All relevant details about your setup

    Operating systems, local/remote environment information, versions of the software that you’re using are all important details that should be provided when asking for help.

  • Minimum reproducible steps

    Demonstrate your issue with a list of instructions that can be followed to replicate it.

Formatting your logs as described in the linked topic will also help the readability of your post.

I think that I ran into the same issue :frowning:

as @joshb I have an iMac in the office and everything works as expected, I have around 10 websites with the roots family (trellis/bedrock/sage)

I just bought a new MacBook Pro M1 and I am trying to work on this as well.

I followed this Vagrant | Trellis Docs | Roots, I bought Parallels Pro and I followed all the steps.

I have done a quick example test to see if trellis/bedrock was working as expected with Parallels Pro, trellis new example.com and then vagrant up and everything work well, so I guess that the MacBook has everything needed to make trellis/bedrock/sage work.

so next step, I tried to work with my existing websites, I cloned the repositories, I added the .vault file within the trellis folder, I created a vagrant.local.yml file (I chose this because I will continue to work on the iMac and the new macbook pro M1 at the same time in different days) with this code always within the trellis folder

---
vagrant_ip: '192.168.50.5'
vagrant_cpus: 1
vagrant_memory: 1024 # in MB
vagrant_box: 'jeffnoxon/ubuntu-20.04-arm64'
vagrant_box_version: '>= 1.0.0'
vagrant_ansible_version: '2.9.10'
vagrant_ansible_python_interpreter: '/usr/bin/python3'
vagrant_skip_galaxy: false
vagrant_mount_type: 'nfs'

vagrant_install_plugins: true
vagrant_plugins:
  - name: vagrant-bindfs
  - name: vagrant-hostmanager

# Array of synced folders:
# - local_path: .
#   destination: /path/on/vm
#   create: false
#   type: nfs
#   bindfs: true
#   mount_options: []
#   bindfs_options: {}
# See https://www.vagrantup.com/docs/synced-folders/basic_usage.html#mount_options
vagrant_synced_folders: []

from my understanding these should be all the steps needed, so I run vagrant destroy -f && vagrant up but I am running into this error

TASK [common : Load wordpress_sites.yml vars into <env>_sites vars] ************
System info:
  Ansible 2.9.8; Vagrant 2.2.18; Darwin
  Trellis Head
---------------------------------------------------
An unhandled exception occurred while templating '{{ lookup('filetree',
playbook_dir + '/group_vars') | selectattr('path', 'match', '(' + env_groups
| join('|') + ')/wordpress_sites\.yml$') | map(attribute='path') |
map('regex_replace', '([^/]*)/.*', '\1') | list }}'. Error was a <class
'ansible.errors.AnsibleError'>, original message: An unhandled exception
occurred while templating '{{ ['development', 'staging', 'production'] |
intersect(group_names) }}'. Error was a <class
'ansible.errors.AnsibleError'>, original message: template error while
templating string: No filter named 'intersect'.. String: {{ ['development',
'staging', 'production'] | intersect(group_names) }}
fatal: [default]: FAILED! => {}

I tried with a different website, and it stucked at the same task (even tho with a kind of different msg

TASK [common : Load wordpress_sites.yml vars into <env>_sites vars] ************
System info:
  Ansible 2.9.8; Vagrant 2.2.18; Darwin
  Trellis version (per changelog): "Fix #1277 - Disable PHP CLI memory limit"
---------------------------------------------------
An unhandled exception occurred while templating '{{ lookup('filetree',
playbook_dir + '/group_vars') | selectattr('path', 'match', '(' + env_groups
| join('|') + ')/wordpress_sites\.yml$') | map(attribute='path') |
map('regex_replace', '([^/]*)/.*', '\1') | list }}'. Error was a <class
'ansible.errors.AnsibleError'>, original message: An unhandled exception
occurred while templating '{{ ['development', 'staging', 'production'] |
intersect(group_names) }}'. Error was a <class
'ansible.errors.AnsibleError'>, original message: template error while
templating string: No filter named 'intersect'.. String: {{ ['development',
'staging', 'production'] | intersect(group_names) }}
fatal: [default]: FAILED! => {}

I tried to change the ansible version multiple times with pip install ansible==2.9.8 and different version but no luck.

what else I can try?

Am I missing some extra step?

any ideas? could anyone point me in the right direction?

@joshb did you find a solution?

thanks

@kurt

I was able to get past this but I don’t recall what I did. It was likely a lot of trial and error, destroying the env, updating parts of trellis, etc… Hopefully someone knows exactly how to resolve here but updating all of Trellis to latest might be the best option for you.