roots/trellis

Bug: trellis-cli installs old trellis version that throws error on `trellis up`

iryan2 opened this issue · 3 comments

Terms

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

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.

What have you tried?

See discourse thread 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

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

Yeah I guess it's been a while since the last release. Just released v1.15.0: https://github.com/roots/trellis/releases/tag/v1.15.0

Btw trellis new --trellis-version=dev example.com would use the dev/master version instead of the latest stable version.