postgres-db - error - FATAL: role "awx" does not exist error

I’m trying to deploy awx on azure aks, also I’m using NFS file share from the azure file share storage.

When I run the kebectl apply -k awx I was getting the following error. Any help would be highly appreciated.

k logs -f awx-postgres-13-0

PostgreSQL Database directory appears to contain a database; Skipping initialization

2023-05-26 13:04:42.949 UTC [1] LOG: starting PostgreSQL 13.11 (Debian 13.11-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2023-05-26 13:04:42.949 UTC [1] LOG: listening on IPv4 address “0.0.0.0”, port 5432
2023-05-26 13:04:42.949 UTC [1] LOG: listening on IPv6 address “::”, port 5432
2023-05-26 13:04:43.195 UTC [1] LOG: listening on Unix socket “/var/run/postgresql/.s.PGSQL.5432”
2023-05-26 13:04:43.293 UTC [25] LOG: database system was shut down at 2023-05-26 12:59:57 UTC
2023-05-26 13:04:43.409 UTC [1] LOG: database system is ready to accept connections
2023-05-26 13:05:38.206 UTC [32] FATAL: role “awx” does not exist
2023-05-26 13:05:39.699 UTC [33] FATAL: role “awx” does not exist
2023-05-26 13:05:41.672 UTC [34] FATAL: role “awx” does not exist
2023-05-26 13:05:43.976 UTC [35] FATAL: role “awx” does not exist
2023-05-26 13:05:44.652 UTC [36] FATAL: role “awx” does not exist

kubectl get pv,pvc

NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
persistentvolume/postgres-pv 10Gi RWO Retain Bound awx-tower/postgres-13-awx-postgres-13-0 azurefile 8m2s

NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
persistentvolumeclaim/postgres-13-awx-postgres-13-0 Bound postgres-pv 10Gi RWO azurefile 8m2s

kubectl get po

NAME READY STATUS RESTARTS AGE
awx-operator-controller-manager-5fc6df55df-v5c4g 2/2 Running 0 8m31s
awx-postgres-13-0 1/1 Running 0 7m25s
awx-task-78dfd444dc-8dg5l 4/4 Running 0 6m57s
awx-web-cc4486cb5-knj7h 3/3 Running 0 6m15s

Are you using an external database? Is the NFS file store in play for the database server?
Is it possible that you are reusing a file system with an older postgres database already on it?

The message ‘FATAL: role “awx” does not exist’ seems to indicate that the awx user is not in the database and that would be causing issues when AWX attempts to connect.
You might also want to check the operator logs just to see if there are any obvious issues as well but we kind of expect those to be clean.
It might also be worth running with the no log setting set to false and see if there are any messages about the awx user in relation to the database.

-The AWX Team

Looks like the NFS directory already has postgres db info which is causing the issue. I just deleted everything from nfs folder and re-applied customization. This time it worked.

Thank you for your quick response on this matter.