Hi,
I've been using AWX 19.3.0 / AWX operator 0.13.0 on minikube.
After deploying AWX, I was able to access it without any problems. But, I have lost access to AWX today.
The status of postgres-0 pod was CrashLoopBackOff.
The log output was "initdb: error: directory "/var/lib/postgresql/data/pgdata" exists but is not empty".
Is there any way to recover?
I would be grateful if anyone could comment.
The following is the status of the pod and the output of describe and log.
[root@centos-tools ~]# kubectl get pods
NAME READY STATUS RESTARTS AGE
awx-demo-7bbb564887-m7t5n 4/4 Running 8 13d
awx-demo-postgres-0 0/1 CrashLoopBackOff 834 13d
awx-operator-69c646c48f-cbf5k 1/1 Running 1 13d
====================
[root@centos-tools ~]# kubectl describe pod/awx-demo-postgres-0
Name: awx-demo-postgres-0
Namespace: default
Priority: 0
Start Time: Tue, 17 Aug 2021 16:17:30 +0900
controller-revision-hash=awx-demo-postgres-79f76985cb
Annotations: <none>
Status: Running
IP: 172.17.0.6
IPs:
IP: 172.17.0.6
Controlled By: StatefulSet/awx-demo-postgres
Containers:
postgres:
Container ID: docker://fb6205c01ffeb95c50b2c2c45c8a48af67da7b60fb996706fa312053696b9698
Image: postgres:12
Image ID: docker-pullable://postgres@sha256:e10cd754296c1b3e93a121bcc64550d183df56f20bab47e08cacb123fb969b5e
Port: 5432/TCP
Host Port: 0/TCP
State: Waiting
Reason: CrashLoopBackOff
Last State: Terminated
Reason: Error
Exit Code: 1
Started: Mon, 30 Aug 2021 17:11:05 +0900
Finished: Mon, 30 Aug 2021 17:11:05 +0900
Ready: False
Restart Count: 839
Environment:
POSTGRESQL_DATABASE: <set to the key 'database' in secret 'awx-demo-postgres-configuration'> Optional: false
POSTGRESQL_USER: <set to the key 'username' in secret 'awx-demo-postgres-configuration'> Optional: false
POSTGRESQL_PASSWORD: <set to the key 'password' in secret 'awx-demo-postgres-configuration'> Optional: false
POSTGRES_DB: <set to the key 'database' in secret 'awx-demo-postgres-configuration'> Optional: false
POSTGRES_USER: <set to the key 'username' in secret 'awx-demo-postgres-configuration'> Optional: false
POSTGRES_PASSWORD: <set to the key 'password' in secret 'awx-demo-postgres-configuration'> Optional: false
PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_INITDB_ARGS: --auth-host=scram-sha-256
POSTGRES_HOST_AUTH_METHOD: scram-sha-256
Mounts:
/var/lib/postgresql/data from postgres (rw,path="data")
Conditions:
Type Status
Initialized True
Ready False
ContainersReady False
PodScheduled True
Volumes:
postgres:
Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
ClaimName: postgres-awx-demo-postgres-0
ReadOnly: false
kube-api-access-bjd4p:
Type: Projected (a volume that contains injected data from multiple sources)
TokenExpirationSeconds: 3607
ConfigMapName: kube-root-ca.crt
ConfigMapOptional: <nil>
DownwardAPI: true
QoS Class: BestEffort
Node-Selectors: <none>
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning BackOff 69m (x19429 over 2d23h) kubelet Back-off restarting failed container
Normal SandboxChanged 40m kubelet Pod sandbox changed, it will be killed and re-created.
Normal Pulled 39m (x4 over 40m) kubelet Container image "postgres:12" already present on machine
Normal Created 39m (x4 over 40m) kubelet Created container postgres
Normal Started 39m (x4 over 40m) kubelet Started container postgres
Warning BackOff 25s (x185 over 40m) kubelet Back-off restarting failed container
[root@centos-tools ~]#
====================
[root@centos-tools ~]# kubectl logs pod/awx-demo-postgres-0
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
initdb: error: directory "/var/lib/postgresql/data/pgdata" exists but is not empty
If you want to create a new database system, either remove or empty
the directory "/var/lib/postgresql/data/pgdata" or run initdb
with an argument other than "/var/lib/postgresql/data/pgdata".
[root@centos-tools ~]#
Best Regards,
Yasu