Why Does Ansible Tower Fail to Restore with a Locale Error?

Solution Verified - Updated -

Issue

Running ./setup.sh -r with a backup file from an installation with a different database results in the following error:

TASK [restore : Perform a PostgreSQL restore (internal).] *****************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": "psql --dbname='template1' < tower.db && psql --dbname='awx' < new_instance_topology.db", "delta": "0:00:00.175177", "end": "2019-01-23 15:41:14.139518", "msg": "non-zero return code", "rc": 2, "start": "2019-01-23 15:41:13.964341", "stderr": "ERROR:  invalid locale name: \"en_GB.UTF-8\"\nERROR:  database \"awx\" does not exist\n\\connect: FATAL:  database \"awx\" does not exist", "stderr_lines": ["ERROR:  invalid locale name: \"en_GB.UTF-8\"", "ERROR:  database \"awx\" does not exist", "\\connect: FATAL:  database \"awx\" does not exist"], "stdout": "SET\nSET\nSET\nSET\nSET\n set_config \n------------\n \n(1 row)\n\nSET\nSET\nSET\nDROP DATABASE", "stdout_lines": ["SET", "SET", "SET", "SET", "SET", " set_config ", "------------", " ", "(1 row)", "", "SET", "SET", "SET", "DROP DATABASE"]}

Environment

Ansible Tower
Ubuntu DB Server

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In