Postgres data migration not working

I have tried migrating the data from existing externally managed postgres instance to the new postgres instance for the AWX upgraded version.

However, after migrating the data when I tried provisioning AWX instance, the pod is successfully provisioned but unable to authenticate to postgres instance.

Below is the error seen -

bash-4.2$ kubectl exec awx-67cb856d46-42qnq -c awx-task -n ansible-awx awx-manage check_db
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] – [COMMAND] instead.
2022-11-03 19:36:56,936 ERROR [-] awx.main.utils.encryption Failed to decrypt Setting(pk=20).value; if you’ve recently restored from a database backup or are running in a clustered environment, check that your SECRET_KEY value is correct
Traceback (most recent call last):
File “/var/lib/awx/venv/awx/lib64/python3.9/site-packages/cryptography/fernet.py”, line 120, in _verify_signature
h.verify(data[-32:])
File “/var/lib/awx/venv/awx/lib64/python3.9/site-packages/cryptography/hazmat/primitives/hmac.py”, line 69, in verify
ctx.verify(signature)
File “/var/lib/awx/venv/awx/lib64/python3.9/site-packages/cryptography/hazmat/backends/openssl/hmac.py”, line 76, in verify
raise InvalidSignature(“Signature did not match digest.”)
cryptography.exceptions.InvalidSignature: Signature did not match digest.

Hello,

It looks like the DB secret may not have been transferred after the migration. We would recommend referring to this documentation for further assistance:

https://github.com/ansible/awx-operator/blob/devel/docs/migration.md

If you’re unable to use the AWX backup object for whatever reason, be sure to copy over the secret key secret and the Postgres secret to your namespace.

-AWX Team

Hi Team,

My previous AWX instance is running on an older version (not using awx-operator).

Are you suggesting to copy over these secrets corresponding to this previous instance to the instance with the newer version?

Hello,
The database contains secrets and there is a secret key file on the AWX webserver. That key allows AWX to decrypt the secrets in the database. If you want to use a backup of the database you will need the secret key file to access the secrets in the database.

-AWX Team