AWX Server Error Has Occurred

By default AWX installs the database in the /tmp directory. This can be avoided during install by modifying the inventory file.  However, if by chance AWX was installed using the default settings, you will eventually have a corrupt database and a Server Error page will be displayed.  If you are fortunate to have a snapshot of a virtual machine or a current backup of the database, you can get things working again, but this will be temporary.  There is a process I developed and successfully implemented that successfully moves the database and preserves the installation rather painlessly.


No guarantees, but this process worked for one instance.

# Change the /root/awx_upgrade/awx/installer/inventory file from the terrible /tmp/pgdocker and /tmp/awxcompose to..

# Create a new location for the database and files.
mkdir /opt/pgdocker /opt/awxcompose

# Backup
cd /tmp
tar czvf awxcompose.tgz awxcompose/*
tar czvf pgdocker.tgz pgdocker/*

# Rerun the Ansible Playbook.  This will create a new database.
cd /root/awx_upgrade/awx/installer
ansible-playbook -i inventory install.yml

# Stop the services
sudo docker stop awx_task awx_web awx_memcached awx_rabbitmq awx_postgres

# Copy the old database to the new location.
cd /opt/pgdocker
scp -r /tmp/pgdocker/* .
chown polkitd:ssh_keys pgdata/ -R
chown polkitd:root pgdata

sudo docker stop awx_task awx_web awx_memcached awx_rabbitmq awx_postgres

# Should be permissive anyway, verified that it is
setenforce 0