Skip to content

CNPGBackupStale

Severity: warning. Fires when, for 1 hour, the newest available base backup of a CloudNativePG instance is older than 2 days (barman_cloud_cloudnative_pg_io_last_available_backup_timestamp). The daily ScheduledBackup is not producing backups, so a restore would replay more WAL than planned or, with no recent backup, fail the restore drill.

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

Read-only checks

# Backups and their phase; failed ones carry the error
kubectl --context <context> -n <namespace> get backups.postgresql.cnpg.io
kubectl --context <context> -n <namespace> describe backup <backup> | sed -n '/Status:/,$p'

# The schedule and when it last ran
kubectl --context <context> -n <namespace> get scheduledbackups.postgresql.cnpg.io

# Plugin log on the instance, and the store
kubectl --context <context> -n <namespace> logs <pod> -c plugin-barman-cloud --since=24h | tail -50
kubectl --context <context> -n <namespace> get objectstore backup-store -o yaml

Usual causes: the ScheduledBackup missing or suspended, the backups failing for the same reason as CNPGWALArchivingFailing (credentials, endpoint, object lock), or the Cluster missing the plugins entry that points at backup-store.

Roll forward

Fix the cause in Git in a pull request. To get a backup now instead of waiting for the schedule, create an on-demand Backup that uses the plugin method; this only writes to the backup store:

kubectl --context <context> -n <namespace> apply -f - <<YAML
apiVersion: postgresql.cnpg.io/v1
kind: Backup
metadata:
  name: <cluster>-manual-$(date +%Y%m%d)
spec:
  cluster:
    name: <cluster>
  method: plugin
  pluginConfiguration:
    name: barman-cloud.cloudnative-pg.io
YAML

The alert clears once the new backup is listed as available.

Roll back

If backups stopped after 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.