Skip to content

CNPGWALArchivingFailing

Severity: critical. Fires when, for 30 minutes, the last failed WAL archive of a CloudNativePG instance is newer than its last successful one (cnpg_pg_stat_archiver_*). WAL then piles up on the database volume until archiving to the backup store works again, which can fill the volume and stop the database, and the point-in-time recovery window stops growing.

Labels: namespace (the database's namespace, e.g. mattermost), pod (the instance, e.g. mattermost-db-1). Component: cloudnative-pg. See CloudNativePG.

Read-only checks

# Cluster health and the archiving condition
kubectl --context <context> -n <namespace> get clusters.postgresql.cnpg.io
kubectl --context <context> -n <namespace> describe cluster <cluster> | sed -n '/Status:/,$p'

# The plugin sidecar's log shows why the upload fails (credentials, endpoint, object lock)
kubectl --context <context> -n <namespace> logs <pod> -c plugin-barman-cloud --since=1h | tail -50

# The store definition and its credentials Secret
kubectl --context <context> -n <namespace> get objectstore backup-store -o yaml
kubectl --context <context> -n <namespace> get secret backup-store

# WAL backlog on the volume
kubectl --context <context> -n <namespace> exec <pod> -c postgres -- du -sh /var/lib/postgresql/data/pgdata/pg_wal

# Barman Cloud plugin
flux --context <context> get helmreleases -A | grep barman

Usual causes: expired or rotated backup-store credentials (the ExternalSecret may also show ExternalSecretNotReady), the bucket or endpoint unreachable, the bucket rejecting uploads (object lock, missing checksum header), or the plugin not running.

Roll forward

Fix the cause in Git (ObjectStore, ExternalSecret, plugin release) in a pull request; the instance retries on its own and the alert clears once a segment is archived. Watch the WAL backlog while it is open: if the volume is close to full, treat it as the KubePersistentVolumeFillingUp incident it is and follow the ops runbook's triage order. Never delete WAL files by hand.

Roll back

If archiving broke with a Barman Cloud plugin or CloudNativePG version bump, revert it in a pull request, as in the generic Flux freeze roll-back, after the CRD checks of the pre-flight.