SSH unreachable on `trellis vm start`

On Ventura OS, using trellis canary, Lima isn’t getting past “Gathering Facts” task.

Similar issues to this post. (Yes there are ssh-keys in my ~/.ssh directory.)

I can ssh into the machine from the terminal and in the home/.ssh directory is an authorized_keys file with a public key in it that doesn’t match anything in my host machine ~/.ssh directory:

current$ cat ~/.ssh/authorized_keys
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEz6JMZ1wT+cXSYes222197foePSoIn8QB76oNUhTCSF [email protected]
# grep -ri "AAAAC3NzaC1lZDI1NTE5AAAAIEz6JMZ1wT+cXSYes222197foePSoIn8QB76oNUhTCSF" ~/.ssh/*.pub
NOTHING TO SEE HERE

I’m not sure why/how I am able to connect…

  • Inspect echo $$ for current process id of the current host shell (12906).
  • brew install pstree
  • sudo -su
  • # pstree -w 12906
    -+= 12906 mikekilmer -zsh
     \-+= 33219 mikekilmer trellis vm shell
       \-+- 33224 mikekilmer limactl shell --workdir /srv/www/example.com/current example.com
         \--- 33227 mikekilmer /usr/bin/ssh -F /dev/null -o IdentityFile="/Users/mikekilmer/.lima/_config/user" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o NoHostAuthenticationForLocalhost=yes -o PreferredAuthentications=publickey -o Compression=no -o BatchMode=yes -o IdentitiesOnly=yes -o GSSAPIAuthentication=no -o Ciphers="^[email protected],[email protected]" -o User=mikekilmer -o ControlMaster=auto -o ControlPath="/Users/mikekilmer/.lima/example.com/ssh.sock" -o ControlPersist=yes -o ForwardAgent=yes -t -o SendEnv=COLORTERM -o LogLevel=ERROR -p 56100 127.0.0.1 -- cd /srv/www/example.com/current || exit 1 ; exec "$SHELL" --login
    

Hmmm. The identity file is in /Users/mikekilmer/.lima/_config/user.

If I manually add a host machine’s public key to the vm’s autorized_keys we get past “Gathering Facts” as well as “Load wordpress_sites.yml vars” and fails at “Fail if there are duplicate site keys within host’s wordpress_sites”.

Any suggestions?

See ansible-core 2.19 breaks trellis · Issue #1599 · roots/trellis · GitHub

Give this a shot, merged just 7 hours ago: https://github.com/roots/trellis/pull/1600

Super helpful as always, Ben and thanks to @LucasDemea.

  • add to requirements.txt, ansible-core<2.19.0
  • ensure trellis python which python (points to .trellis directory)
  • pip install -r requirements.txt
  • run trellis vm delete if necessary, then trellis vm start
  • trellis vm shell and add content from cat ~/.ssh/id_rsa.pub or some other key to the VMs ~/.ssh/authorized_keys file
  • trellis provision development
  • make tea
  • celebrate: it works!

I’m still confused as to why I’m needing to manually add a host machine public key and then run trellis provision development after the initially failed deployment in the initial trellis vm start.

I’m not quite sure how the provisioning connection is supposed to work.

2 Likes