Roots Discourse

The following SSH command responded with a non-zero exit status

I keep trying to get set up with Trellis but I always get this error during provisioning.
Things fail to fully provision it seems but it still acts as though vagrant up was a success.
The machine runs. If I halt and vagrant up from again it’ll run fine.
It just always hiccups on the provisioning.
I can’t seem to find someone else with this issue so I’m hoping someone here can help me out.
I must be missing something simple.
The error during the provision stage is below, thank you.

====================================

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

curl https://bootstrap.pypa.io/get-pip.py | sudo python

Stdout from the command:

Stderr from the command:

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1883k 100 1883k 0 0 4379k 0 --:–:-- --:–:-- --:–:-- 4369k
Traceback (most recent call last):
File “”, line 24226, in
File “”, line 199, in main
File “”, line 82, in bootstrap
File “/tmp/tmpagSXn5/pip.zip/pip/_internal/cli/main.py”, line 60
sys.stderr.write(f"ERROR: {exc}")
^
SyntaxError: invalid syntax

Wrong python version (2.x instead 3.x) is used, see

Thank you for the speedy reply.

I have tried various versions of python set with pyenv. I cannot get to the bottom of this one. I’m supposed to be using a 3.x version of python?

Yes, on a Debian/Ubuntu system you can set the python version (after installing the python package of intended version) by using the update-alternatives command:
https://linuxconfig.org/how-to-change-from-default-to-alternative-python-version-on-debian-linux

I keep trying and failing. There is something basic I must be missing. I tried to spin up a fresh example site and still the same error. I’ve tried python 3.x as the default. I need a little more guidance please. I’m sorry. I have a new error below. There must be something more basic that I’m missing here. I can’t seem to just run Trellis out of the box locally.

python --version
Python 3.8.5

default: Installing pip... (for Ansible installation)

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

curl https://bootstrap.pypa.io/get-pip.py | sudo python

Stdout from the command:

Stderr from the command:

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1883k 100 1883k 0 0 6750k 0 --:–:-- --:–:-- --:–:-- 6750k
Traceback (most recent call last):
File “”, line 24226, in
File “”, line 199, in main
File “”, line 82, in bootstrap
File “”, line 259, in load_module
File “/tmp/tmpfxtm8ry5/pip.zip/pip/_internal/cli/main.py”, line 8, in
File “”, line 259, in load_module
File “/tmp/tmpfxtm8ry5/pip.zip/pip/_internal/cli/autocompletion.py”, line 9, in
File “”, line 259, in load_module
File “/tmp/tmpfxtm8ry5/pip.zip/pip/_internal/cli/main_parser.py”, line 7, in
File “”, line 259, in load_module
File “/tmp/tmpfxtm8ry5/pip.zip/pip/_internal/cli/cmdoptions.py”, line 22, in
File “”, line 259, in load_module
File “/tmp/tmpfxtm8ry5/pip.zip/pip/_internal/cli/progress_bars.py”, line 9, in
File “”, line 259, in load_module
File “/tmp/tmpfxtm8ry5/pip.zip/pip/_internal/utils/logging.py”, line 14, in
File “”, line 259, in load_module
File “/tmp/tmpfxtm8ry5/pip.zip/pip/_internal/utils/misc.py”, line 29, in
File “”, line 259, in load_module
File “/tmp/tmpfxtm8ry5/pip.zip/pip/_internal/locations.py”, line 11, in
ModuleNotFoundError: No module named ‘distutils.command’

It would be better if you install these dependencies from packages:

I have the same issue on a Mac. I’ve spent hours now trying to solve the issue without any luck. Have you reached a solution?

I’ve tried:

Had the same problem today. I can confirm that updating trellis fixes the problem. There’s probably an easier way, like modifying some lines in your existing trellis folder, but you can also go through a full update.

It’s a little complicated because you have to make sure you have copied all your trellis customisations over to the new installation. The safest way is to:

  1. Create a new branch:
    git checkout -b trellis-update
  2. mkdir trellis-update && cd trellis-update
  3. git clone --depth=1 git@github.com:roots/trellis.git && rm -rf trellis/.git
  4. Copy old trellis customisations to group-vars, deploy hooks, roles and hosts over to the trellis-update folder.
  5. You might also want to lock your composer version to v1 in order to prevent plugin problems: composer_version: 1.10.16 (main.yml)

Once you have all of your variables copied then you can replace your actual trellis folder with the newly downloaded one and rebuild with vagrant up.

1 Like