Skip to main content
Most PGO problems fall into a small set of categories: image pull failures, misconfigured storage, credential or TLS issues, and resource pressure. The diagnostic commands below apply to nearly every investigation. Start there, then work through the scenario that matches your symptom.

Essential diagnostic commands

Run these commands first whenever something is wrong with a cluster. Replace <namespace> and <cluster-name> with your values.

Cluster stuck in “Creating” state

A cluster that never reaches a running state usually has one of three root causes: an image that cannot be pulled, a PVC that cannot be provisioned, or a pod that fails its readiness probe. Step 1 — Check pod status.
Look for pods in Pending, Init:Error, or CrashLoopBackOff state. Step 2 — Describe the stuck pod.
Examine the Events section at the bottom. Common findings: Step 3 — Check the image pull secret.
If the secret is missing or has the wrong type, recreate it with the correct credentials from the Crunchy Data Developer Portal.
The PostgresCluster status conditions surface reconciliation errors directly. Run kubectl get postgrescluster <name> -n <namespace> -o jsonpath='{.status.conditions}' to see a machine-readable summary.

Backup job failing

pgBackRest backup jobs fail for three main reasons: incorrect repository configuration (wrong bucket name, path, or region), missing or incorrect cloud credentials, and network connectivity problems between the backup pod and the object storage endpoint. Step 1 — Find the failing backup pod.
Step 2 — Read the pgBackRest logs.
pgBackRest error messages are verbose. Look for lines beginning with ERROR or FATAL. Step 3 — Check the Secret containing cloud credentials.
For S3-compatible storage, verify that s3-key, s3-key-secret, and (if applicable) s3-endpoint are present and correctly base64-encoded. Step 4 — Verify network access from inside the backup pod.
A 403 Forbidden response means the bucket exists but the credentials are wrong. A connection timeout or DNS failure points to a network policy or endpoint misconfiguration.
If you are using a self-hosted S3-compatible store (MinIO, Ceph RGW), ensure the endpoint URL in the pgBackRest configuration uses https:// and that the CA certificate is trusted by the backup pod. You may need to mount a custom CA into the pod.

High availability failover not happening

Patroni manages failover. If a primary pod fails and Patroni does not elect a new leader within 30–60 seconds, investigate the Patroni state directly. Step 1 — Check Patroni’s view of the cluster.
A healthy output shows one member with Role: Leader and the rest as Role: Replica with State: running. If all members show State: stopped or Role: standby leader, Patroni has lost quorum or cannot reach the DCS. Step 2 — Check for network policy blocking DCS traffic. Patroni uses Kubernetes API endpoints (not a separate DCS in PGO) for distributed consensus. If the instance pods cannot reach the Kubernetes API server, failover will stall. Test from inside a pod:
Step 3 — Review pod anti-affinity settings. If all instance pods are scheduled on the same node and that node goes down, no replicas are available to take over. Verify anti-affinity is configured:
PGO sets preferred anti-affinity by default. For stricter placement guarantees, configure required anti-affinity rules in spec.instances[].affinity. See the high availability guide for examples.

Cannot connect to PostgreSQL

Connection failures usually stem from one of four causes: the service endpoint is not resolving, TLS certificate validation is failing, credentials are wrong, or a network policy is blocking the connection. Step 1 — Verify the service exists and has an endpoint.
If the Endpoints object shows <none>, the primary pod is not ready or its labels do not match the service selector. Step 2 — Retrieve the connection Secret. PGO stores connection credentials in a Secret named <cluster-name>-pguser-<username>:
The Secret contains host, port, dbname, user, password, and the TLS certificate fields. Step 3 — Test connectivity from inside the cluster.
Step 4 — Check TLS certificate validity. PGO enforces TLS on all connections. If you are connecting with sslmode=require but not supplying the cluster CA, the connection will fail certificate verification. Retrieve the CA from the Secret or disable host verification temporarily with sslmode=require (not sslmode=verify-full) to isolate the issue. See the TLS guide for how to manage and rotate certificates.

OOMKilled pods

A pod with OOMKilled in its last state has exceeded its memory limit. For PostgreSQL pods, this usually means shared_buffers, work_mem, or other memory parameters are set too high for the pod’s limit. Step 1 — Identify which container was killed.
Step 2 — Check current resource requests and limits.
Step 3 — Adjust resource limits. Increase the memory limit in spec.instances[].resources or reduce PostgreSQL memory parameters in spec.patroni.dynamicConfiguration:
As a rule of thumb, set shared_buffers to 25% of the container memory limit and work_mem conservatively — it is allocated per sort operation per connection, so high concurrency multiplies the footprint.
The crunchy-postgres-exporter sidecar (pgMonitor) also consumes memory. Account for its limit when sizing the pod. See the monitoring guide for exporter resource configuration.

PersistentVolumeClaim stuck in Pending state

A PVC that stays in Pending means the Kubernetes volume provisioner cannot satisfy the storage request. Step 1 — Describe the PVC.
Look for ProvisioningFailed events. Common causes: Step 2 — Verify the StorageClass exists and is the default.
A StorageClass marked (default) is used when spec.instances[].dataVolumeClaimSpec.storageClassName is omitted. If no default exists, you must specify one explicitly. Step 3 — Check available capacity. For local-path or hostPath provisioners, verify that the target node has sufficient free disk space. For cloud provisioners, confirm you have not hit a regional volume quota.

FAQ

Answers to common questions about PGO setup and operations.

High availability guide

Configure Patroni, anti-affinity, and synchronous replication.

Backups guide

Set up and validate pgBackRest backup repositories.

TLS guide

Manage certificates and troubleshoot TLS connection failures.