Hello!
I’m testing an installation of AWX to a multi-node cluster with an external database, and when it gets to the “Start the containers” task, I get this error for the Postgres node:
The full traceback is:
File “/tmp/ansible_docker_compose_payload_rvms0n_l/ansible_docker_compose_payload.zip/ansible/module_utils/docker/common.py”, line 361, in init
super(AnsibleDockerClient, self).init(**self._connect_params)
File “/usr/local/lib/python3.6/site-packages/docker/api/client.py”, line 188, in init
self._version = self._retrieve_server_version()
File “/usr/local/lib/python3.6/site-packages/docker/api/client.py”, line 213, in _retrieve_server_version
‘Error while fetching server API version: {0}’.format(e)
fatal: [postgres1.home.local]: FAILED! => {
“changed”: false,
“invocation”: {
“module_args”: {
“api_version”: “auto”,
“build”: false,
“ca_cert”: null,
“client_cert”: null,
“client_key”: null,
“debug”: false,
“definition”: null,
“dependencies”: true,
“docker_host”: “unix://var/run/docker.sock”,
“files”: null,
“hostname_check”: false,
“nocache”: false,
“project_name”: null,
“project_src”: “/root/.awx/awxcompose”,
“pull”: false,
“recreate”: “smart”,
“remove_images”: null,
“remove_orphans”: false,
“remove_volumes”: false,
“restarted”: true,
“scale”: null,
“services”: null,
“ssl_version”: null,
“state”: “present”,
“stopped”: false,
“timeout”: 10,
“tls”: false,
“tls_hostname”: “localhost”,
“validate_certs”: false
}
},
“Error connecting: Error while fetching server API version: (‘Connection aborted.’, FileNotFoundError(2, ‘No such file or directory’))”
Here is my (sanitized) inventory file:
[tower]
ansible.home.local
ansible2.home.local
[database]
postgres1.home.local
[all:vars]
ansible_become=true
ansible_user=ansible
ansible_password=‘’
ansible_become_password=‘’
ansible_python_interpreter=“/usr/bin/env python3”
Remove these lines if you want to run a local image build
Otherwise the setup playbook will install the official Ansible images. Versions may
be selected based on: latest, 1, 1.0, 1.0.0, 1.0.0.123
by default the base will be used to search for ansible/awx
dockerhub_base=ansible
Common Docker parameters
awx_task_hostname=awx
awx_web_hostname=awxweb
host_port=80
host_port_ssl=443
#ssl_certificate=
Optional key file
#ssl_certificate_key=
docker_compose_dir=“~/.awx/awxcompose”
Set pg_hostname if you have an external postgres server, otherwise
a new postgres service will be created
pg_hostname=postgresql
pg_host=‘postgres1.home.local’
pg_username=awx
pg_password should be random 10 character alphanumeric string, when postgresql is running on kubernetes
NB: it’s a limitation of the “official” postgres helm chart
pg_password=‘’
pg_database=awx
pg_port=5432
#pg_sslmode=require
postgres_data_dir=“/data”
rabbitmq_port=5672
rabbitmq_vhost=tower
rabbitmq_username=tower
rabbitmq_password=tower
rabbitmq_cookie=rabbitmqcookie
This will create or update a default admin (superuser) account in AWX, if not provided
then these default values are used
admin_user=admin
admin_password=‘’
Whether or not to create preload data for demonstration purposes
create_preload_data=True
AWX Secret key
It’s very important that this stay the same between upgrades or you will lose the ability to decrypt
your credentials
secret_key=awxsecret
What file or directory is Ansible referring to in the error? The postgres data dir definitely exists and is mounted (it’s currently empty). Docker compose is installed and the .awx/awxcompose directory exists.