Ubuntu package issues with remote server setup

My issue is pretty similar to this thread as my local dev / vagrant up works fine but trying to set up the remote server (Ubuntu 18.04. on a DO droplet) renders the following error:

TASK [Gathering Facts] ****************************************************************************************************************************
System info:
  Ansible 2.7.10; Darwin
  Trellis 1.0.2: March 13th, 2019
---------------------------------------------------
The module failed to execute correctly, you probably need to set the
interpreter.
See stdout/stderr for the exact error
/bin/sh: 1: /usr/bin/python: not found

fatal: [165.22.75.75]: FAILED! => {"changed": false, "module_stdout": "", "rc": 127}

The trellis release is almost up to date (1.0.2 vs 1.0.3) and the latest changes don’t touch on the subject so I am clueless as to what I can do here…?

If I install python manually on the remote system it will work but that creates another set of issues.

What am I missing?

Found this article which touches on the subject – they offer a way to set the ansible_python_interpreter and some other options but I wouldn’t be sure / skilled enough to implement this and offer a PR… :confused:

OK, my bad – I used 18.10 instead of 18.04 but am running into these errors now:

TASK [common : Checking essentials] ***************************************************************************************************************
System info:
  Ansible 2.7.10; Darwin
  Trellis 1.0.2: March 13th, 2019
---------------------------------------------------
No package matching 'build-essential' is available
failed: [104.248.243.25] (item=build-essential) => {"changed": false, "item": {"key": "build-essential", "value": "present"}}
---------------------------------------------------
ok: [104.248.243.25] => (item=curl)
---------------------------------------------------
ok: [104.248.243.25] => (item=dbus)
---------------------------------------------------
ok: [104.248.243.25] => (item=git)
---------------------------------------------------
No package matching 'libnss-myhostname' is available
failed: [104.248.243.25] (item=libnss-myhostname) => {"changed": false, "item": {"key": "libnss-myhostname", "value": "present"}}
---------------------------------------------------
No package matching 'python' is available
failed: [104.248.243.25] (item=python) => {"changed": false, "item": {"key": "python", "value": "present"}}
---------------------------------------------------
No package matching 'unzip' is available
failed: [104.248.243.25] (item=unzip) => {"changed": false, "item": {"key": "unzip", "value": "present"}}
---------------------------------------------------
ok: [104.248.243.25] => (item=python3-software-properties)
---------------------------------------------------
No package matching 'python3-mysqldb' is available
failed: [104.248.243.25] (item=python3-mysqldb) => {"changed": false, "item": {"key": "python3-mysqldb", "value": "present"}}
---------------------------------------------------
No package matching 'python3-pycurl' is available
failed: [104.248.243.25] (item=python3-pycurl) => {"changed": false, "item": {"key": "python3-pycurl", "value": "present"}}

:no_mouth:

I followed this AskUbuntu post and enabled all the other package sources in /etc/apt/sources.list that have previously been uncommented and now it works…

The question would be then: Why is this happening (to me?) and how could I prevent this from happening again in the future?

Thanks for your insights…!

1 Like

Do you have python installed on the remote server?

if you found:

$ which python2
$ which python3

then: Symbolic link one of them as /usr/bin/python

If you don’t have any, try install one.

python3 is installed (Python 3.6.7) on the remote server.

Symbolic link one of them as /usr/bin/python

I thought trellis would take care of that…?

If I don’t symlink python and instead just uncomment the line
deb http://archive.canonical.com/ubuntu bionic partner
in /etc/apt/sources.list then trellis installs the missing packages fine…

So I guess this has something to do with how Digital Ocean’s 18.04 servers are set up by default? Maybe even due to my selection of the droplet’s datacenter region (FRA)…?

Strange enough, guess many more people would have run into this, seems very specific.

Thanks for chipping in!

I can confirm this issue on a fresh 18.04 Droplet in datacenter FRA.
A quick and dirty fix that worked for me: Manually install the missing packages:

apt update && apt install build-essential libnss-myhostname unzip python3-mysqldb
2 Likes

This topic was automatically closed after 42 days. New replies are no longer allowed.