# AWX fails to connect to my external postgres server

**URL:** <https://forum.ansible.com/t/awx-fails-to-connect-to-my-external-postgres-server/27005>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [March 15, 2018, 2:34pm UTC](https://forum.ansible.com/t/awx-fails-to-connect-to-my-external-postgres-server/27005 "2018-03-15T14:34:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mamadouadaba](https://avatars.discourse-cdn.com/v4/letter/m/b3f665/32.png) [@mamadouadaba](https://forum.ansible.com/u/mamadouadaba)\
**Post date:** [March 15, 2018, 2:34pm UTC](https://forum.ansible.com/t/awx-fails-to-connect-to-my-external-postgres-server/27005/1 "2018-03-15T14:34:04Z")

</div>

Hello there,

If anyone can help

here some logs after issuing ansible-playbook -i inventory install.yml

[root@PA-PGL-VMNO-0 installer]# docker logs -f awx\_task  
Using /etc/ansible/ansible.cfg as config file  
127.0.0.1 | SUCCESS =\> {  
“changed”: false,  
“elapsed”: 0,  
“path”: null,  
“port”: 5432,  
“search\_regex”: null,  
“state”: “started”  
}  
Using /etc/ansible/ansible.cfg as config file  
127.0.0.1 | SUCCESS =\> {  
“changed”: false,  
“elapsed”: 0,  
“path”: null,  
“port”: 11211,  
“search\_regex”: null,  
“state”: “started”  
}  
Using /etc/ansible/ansible.cfg as config file  
127.0.0.1 | SUCCESS =\> {  
“changed”: false,  
“elapsed”: 0,  
“path”: null,  
“port”: 5672,  
“search\_regex”: null,  
“state”: “started”  
}  
Using /etc/ansible/ansible.cfg as config file  
[DEPRECATION WARNING]: The sudo command line option has been deprecated in  
favor of the “become” command line arguments. This feature will be removed in  
version 2.6. Deprecation warnings can be disabled by setting  
deprecation\_warnings=False in ansible.cfg.  
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: OperationalError: FATAL: no pg\_hba.conf entry for host “10.100.10.139”, user “awx”, database “postgres”, SSL off  
127.0.0.1 | FAILED! =\> {  
“changed”: false,  
“msg”: “unable to connect to database: FATAL: no pg\_hba.conf entry for host "10.100.10.139", user "awx", database "postgres", SSL off\n”  
}  
^C

In my inventory file:

pg\_hostname=10.100.10.180  
pg\_username=awx  
pg\_password=awxpass  
pg\_database=awx  
pg\_port=5432

As a reminder, in my awx server (redhat VM), the docker containers awx\_web, awx\_task, rabbitmq and memcached ran as well, but it can’t connect to my external postgresql server (another redhat VM) which I installed without launched any docker.

I pointed the address of my awx server in pg\_hba.conf file in postgres machine (/pgqdata/pgserver01/data/pg\_hba.conf),

Below the pg\_hba.conf in postgrsql server :

local all postgres trust  
hostnossl all all 0.0.0.0/0 trust

# IPv4 local connections:

host all all 0.0.0.0/0 md5  
host awx postgres 10.100.10.139/32 md5

Thanks in advance,

---

<div class="post-metadata">

**Author:** ![matburt](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/matburt/32/3612_2.png) [@matburt](https://forum.ansible.com/u/matburt)\
**Post date:** [March 16, 2018, 2:06am UTC](https://forum.ansible.com/t/awx-fails-to-connect-to-my-external-postgres-server/27005/2 "2018-03-16T02:06:48Z")

</div>

Check the logs on the postgres side, make sure there isn’t a firewall blocking the connection. This issue doesn’t appear to be strictly related to AWX itself so it just comes down to figuring out postgres.

---

<div class="post-metadata">

**Author:** ![mamadouadaba](https://avatars.discourse-cdn.com/v4/letter/m/b3f665/32.png) [@mamadouadaba](https://forum.ansible.com/u/mamadouadaba)\
**Post date:** [March 16, 2018, 4:31pm UTC](https://forum.ansible.com/t/awx-fails-to-connect-to-my-external-postgres-server/27005/3 "2018-03-16T16:31:03Z")

</div>

Yes, it was a postgres issue.

I upgraded the postgres (9.4 to 9.6) and now everything works as well.

Thanks
