Hm, interesting. Release v1.14.0
(which is the most recent) actually contains a roles/python_interpreter/tasks/main.yml
:
But the current master
does not contain that directory, it was removed in a commit right after the v1.14
release:
committed 04:47AM - 17 Feb 22 UTC
Python 2 has been EOL for a while now anad is unsupported. macOS is
removing it ⦠as well as of 12.3
Trellis was compatible with both Python 2 or 3 but it took some extra
work and complexity. This removes all workarounds for python2 and makes
python3 a requirement.
Are you using the latest master
or the latest release v1.14.0
?
But it works fine for me, with master
and with that python_interpreter
directory removed.
It appears that your Trellis
project got some inconsistencies.
1 Like
iryan2
June 8, 2022, 8:18pm
22
In all the previous posts Iāve been using the trellis that gets installed by trellis-cli
, that is, 1.14.0. Only just now have I tried cloning master. Note I also never tried deleting the python_interpreter directory
Iāve done the following to try to ensure Iām using the latest trellis:
backed up my group_vars directory
deleted my trellis dir
cloned trellis from gh
restored my previous group_vars directory
trellis init
trellis up
Itās taking much longer than it has previously, seems encouraging. Should have a result soon
1 Like
iryan2
June 8, 2022, 8:24pm
23
2 Likes
iryan2
June 8, 2022, 8:29pm
24
Thanks so much for all your help @strarsis !
Hm, that wouldnāt be just outdated but contains incorrect code that prevented a successful trellis up
. It would be very helpful if you can reproduce this issue and create a new issue: Issues Ā· roots/trellis Ā· GitHub
iryan2
June 8, 2022, 11:37pm
26
Done, let me know if thereās any other info you think I should provide
opened 11:36PM - 08 Jun 22 UTC
bug
### Terms
- [X] I have read the [guidelines for Contributing to Roots Projects]⦠(https://github.com/roots/.github/blob/master/CONTRIBUTING.md)
- [X] This request is not a duplicate of an existing issue
- [X] I have read the [docs](https://roots.io/docs/) and followed them (if applicable)
- [X] I have seached the [Roots Discourse](https://discourse.roots.io/) for answers and followed them (if applicable)
- [X] This is not a personal support request that should be posted on the [Roots Discourse](https://discourse.roots.io/) community
### Description
#### What's wrong?
The version of `trellis` that gets installed by the latest `trellis-cli` still includes the roles/python_interpreter directory that has been removed on `master`.
Running `trellis up` then fails with:
```
trellis up ~/projects/blah.com/trellis
Starting galaxy role install process
- composer (1.9.0) is already installed, skipping.
- ntp (2.2.0) is already installed, skipping.
- logrotate (v0.0.5) is already installed, skipping.
- swapfile (v2.0.32) is already installed, skipping.
- mailhog (2.2.0) is already installed, skipping.
Running command => vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'bento/ubuntu-20.04'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'bento/ubuntu-20.04' version '202206.03.0' is up to date...
==> default: Setting the name of the VM: blah.test
==> default: Fixed port collision for 22 => 2222. Now on port 2201.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 (guest) => 2201 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2201
default: SSH username: vagrant
default: SSH auth method: private key
default:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Installing NFS client...
==> default: Exporting NFS shared folders...
==> default: Preparing to edit /etc/exports. Administrator privileges will be required...
==> default: Mounting NFS shared folders...
==> default: Mounting shared folders...
default: /vagrant => /Users/imr/projects/blah.com/trellis
==> default: Checking for bindfs in VM...
default: Package manager detected: apt-get
default: Fuse kernel module is installed
default: Fuse kernel module is loaded
==> default: Bindfs seems to not be installed on the virtual machine, installing now
default: Bindfs 1.14.1 is installed
==> default: Machine is ready to use bindfs!
==> default: Creating bind mounts after synced_folders...
default: /vagrant-nfs-blah.com => /srv/www/blah.com/current
default: /ansible-nfs => /home/vagrant/trellis
==> 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: ansible...
default: Running ansible-playbook...
PLAY [Set ansible_python_interpreter] ******************************************
TASK [python_interpreter : Get Ubuntu version] *********************************
ok: [default]
TASK [python_interpreter : Set ansible_python_interpreter for Ubuntu >= 18.04] ***
System info:
Ansible 2.10.16; Vagrant 2.2.18; Darwin
Trellis 1.14.0: February 16th, 2022
---------------------------------------------------
The conditional check 'ubuntu_version.stdout | trim is version('18.04',
'>=')' failed. The error was: Version comparison: '<' not supported between
instances of 'str' and 'int'
The error appears to be in '/Users/imr/projects/blah.com/trellis/roles/python
_interpreter/tasks/main.yml': line 6, column 5, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
changed_when: false
- name: Set ansible_python_interpreter for Ubuntu >= 18.04
^ here
fatal: [default]: FAILED! => {}
PLAY RECAP *********************************************************************
default : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
exit status 1
[127] > trellis --version ~/projects/blah.com/trellis
1.7.0
```
#### What have you tried?
See [discourse thread](https://discourse.roots.io/t/what-am-i-supposed-to-do-after-running-trellis-up/23299/15) for details
#### What insights have you gained?
@strarsis is a legend.
#### Possible solutions
Release a new version of trellis that matches master (1.14.0 still includes the roles/python_interpreter dir)
#### Temporary workarounds
Clone trellis from github rather than using the version installed by trellis-cli
### Steps To Reproduce
1. Install trellis-cli
2. `trellis new example.com && cd example.com`
3. `trellis up`
...
error.
I'm on MacOS, I'd be surprised if other OS's aren't affected but it's possible.
### Expected Behavior
Trellis to work
### Actual Behavior
Visiting `http://example.test` would error with `Connection refused`.
### Relevant Log Output
```shell
trellis up ~/projects/blah.com/trellis
Starting galaxy role install process
- composer (1.9.0) is already installed, skipping.
- ntp (2.2.0) is already installed, skipping.
- logrotate (v0.0.5) is already installed, skipping.
- swapfile (v2.0.32) is already installed, skipping.
- mailhog (2.2.0) is already installed, skipping.
Running command => vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'bento/ubuntu-20.04'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'bento/ubuntu-20.04' version '202206.03.0' is up to date...
==> default: Setting the name of the VM: blah.test
==> default: Fixed port collision for 22 => 2222. Now on port 2201.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 (guest) => 2201 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2201
default: SSH username: vagrant
default: SSH auth method: private key
default:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Installing NFS client...
==> default: Exporting NFS shared folders...
==> default: Preparing to edit /etc/exports. Administrator privileges will be required...
==> default: Mounting NFS shared folders...
==> default: Mounting shared folders...
default: /vagrant => /Users/imr/projects/blah.com/trellis
==> default: Checking for bindfs in VM...
default: Package manager detected: apt-get
default: Fuse kernel module is installed
default: Fuse kernel module is loaded
==> default: Bindfs seems to not be installed on the virtual machine, installing now
default: Bindfs 1.14.1 is installed
==> default: Machine is ready to use bindfs!
==> default: Creating bind mounts after synced_folders...
default: /vagrant-nfs-blah.com => /srv/www/blah.com/current
default: /ansible-nfs => /home/vagrant/trellis
==> 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: ansible...
default: Running ansible-playbook...
PLAY [Set ansible_python_interpreter] ******************************************
TASK [python_interpreter : Get Ubuntu version] *********************************
ok: [default]
TASK [python_interpreter : Set ansible_python_interpreter for Ubuntu >= 18.04] ***
System info:
Ansible 2.10.16; Vagrant 2.2.18; Darwin
Trellis 1.14.0: February 16th, 2022
---------------------------------------------------
The conditional check 'ubuntu_version.stdout | trim is version('18.04',
'>=')' failed. The error was: Version comparison: '<' not supported between
instances of 'str' and 'int'
The error appears to be in '/Users/imr/projects/blah.com/trellis/roles/python
_interpreter/tasks/main.yml': line 6, column 5, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
changed_when: false
- name: Set ansible_python_interpreter for Ubuntu >= 18.04
^ here
fatal: [default]: FAILED! => {}
PLAY RECAP *********************************************************************
default : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
exit status 1
[127] > trellis --version ~/projects/blah.com/trellis
1.7.0
```
### Versions
trellis-cli 1.7.0, trellis 1.14.0, MacOS 12.4
Thanks again!
1 Like
I think the Trellis CLI will just install the latest tagged trellis version and not the latest commits, so this makes sense.
I mentioned it in the issue, but trellis new --trellis-version=dev example.com
exists and would use the dev/master version instead of the latest stable version.
2 Likes