could not translate host name "awx-postgresql"

ISSUE TYPE- Bug Report
COMPONENT NAME- Installer
SUMMARY

running the installer against a kubernetes cluster does not finish,
stuck at database migration

ENVIRONMENT- AWX install method: kubernetes
  • Ansible version: 2.9.2
  • Operating System: ubuntu 16.04.6
  • Web Browser: Chrome
STEPS TO REPRODUCE

fill in the kuberentes variables in the inventory

# Kubernetes Install
kubernetes_context=kubeawx
kubernetes_namespace=awx
tiller_namespace=kube-system
pg_persistence_storageClass=standard

and run
ansible-playbook -i inventory install.yml

EXPECTED RESULTS

awx gets installed

ACTUAL RESULTS

the task migrate databases ended in error

ADDITIONAL INFORMATION

TASK [kubernetes : Migrate database] ********************************************************************************************************************************************************************************************************* Traceback (most recent call last):

File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/backends/base/base.py”, line 217, in ensure_connection

self.connect()

File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/backends/base/base.py”, line 195, in connect

self.connection = self.get_new_connection(conn_params)

File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/backends/postgresql/base.py”, line 178, in get_new_connection

connection = Database.connect(**conn_params)

File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/psycopg2/init.py”, line 126, in connect

conn = _connect(dsn, connection_factory=connection_factory, **kwasync)

psycopg2.OperationalError: could not translate host name “awx-postgresql” to address: Name or service not known

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

File “/usr/bin/awx-manage”, line 11, in

load_entry_point(‘awx==9.1.0.0’, ‘console_scripts’, ‘awx-manage’)()

File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/init.py”, line 165, in manage

execute_from_command_line(sys.argv)

File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/init.py”, line 381, in execute_from_command_line

utility.execute()

File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/init.py”, line 375, in execute

self.fetch_command(subcommand).run_from_argv(self.argv)

File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/base.py”, line 323, in run_from_argv

self.execute(*args, **cmd_options)

File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/base.py”, line 364, in execute

output = self.handle(*args, **options)

File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/base.py”, line 83, in wrapped

res = handle_func(*args, **kwargs)

File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/commands/migrate.py”, line 87, in handle

executor = MigrationExecutor(connection, self.migration_progress_callback)

File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/migrations/executor.py”, line 18, in init

self.loader = MigrationLoader(self.connection)

File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/migrations/loader.py”, line 49, in init

self.build_graph()

File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/migrations/loader.py”, line 212, in build_graph

self.applied_migrations = recorder.applied_migrations()

File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/migrations/recorder.py”, line 73, in applied_migrations

if self.has_table():

File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/migrations/recorder.py”, line 56, in has_table

return self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor())

File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/backends/base/base.py”, line 256, in cursor

return self._cursor()

File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/backends/base/base.py”, line 233, in _cursor

self.ensure_connection()

File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/backends/base/base.py”, line 217, in ensure_connection

self.connect()

File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/utils.py”, line 89, in exit

raise dj_exc_value.with_traceback(traceback) from exc_value

File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/backends/base/base.py”, line 217, in ensure_connection

self.connect()

File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/backends/base/base.py”, line 195, in connect

self.connection = self.get_new_connection(conn_params)

File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/backends/postgresql/base.py”, line 178, in get_new_connection

connection = Database.connect(**conn_params)

File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/psycopg2/init.py”, line 126, in connect

conn = _connect(dsn, connection_factory=connection_factory, **kwasync)

django.db.utils.OperationalError: could not translate host name “awx-postgresql” to address: Name or service not known

Can you try upgrading to the latest release? There’s been a good number of changes to the Kubernetes installer in recent months.

We don’t want to go into those changes…Is there any way out to resolve the below issue on 9.1.0 version itself?