Skip to content

CloudNativePG: Working WAL archiving: Failing

PostgreSQLtested on CloudNativePG 1.30.2, Barman-Cloud-Plugin 0.16.0

Since the ObjectStore was attached to the cluster, WAL archiving fails, and the first backup fails with a meaningless message. Archiving is done by the plugin-barman-cloud sidecar in every instance Pod – its log names the URL and the error of every attempt.

Symptom

kubectl get backup -n tag19
kubectl cnpg status shop -n tag19 | sed -n '/Continuous/,/^$/p'
NAME         AGE   CLUSTER   METHOD   PHASE    ERROR
shop-test1   33s   shop      plugin   failed   rpc error: code = Unknown desc = exit ...
Continuous Backup status (Barman Cloud Plugin)
No recovery window information found in ObjectStore 'tag19-s3' for server 'shop'
Working WAL archiving:        Failing
WALs waiting to be archived:  1
Last Failed WAL:              000000010000000000000004   @   2026-11-19T07:28:52...

The status counts the WAL files waiting to be archived and names the last one that failed. The backup itself only says "rpc error".

Diagnosis

Search the sidecar's log for the WAL archiver exception.

kubectl logs shop-1 -n tag19 -c plugin-barman-cloud --since=5m \
  | grep 'WAL archiver exception' | tail -1 | jq -r .msg
... ERROR: Barman cloud WAL archiver exception: SSL validation failed for
https://172.16.0.123:9000/cnpg-backups/shop/wals/0000000100000000/0000000100000000000
00004.gz [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1029)

Causes

WRONG_VERSION_NUMBERhttps in the endpoint, the storage speaks http

The client speaks TLS, the server answers in plain text. In the course RustFS listens on http, the ObjectStore says https.

NoSuchBucketThe bucket is missing

The bucket from destinationPath doesn't exist in the object storage.

ERROR: Barman cloud WAL archiver exception: An error occurred (NoSuchBucket) when
calling the PutObject operation: The specified bucket does not exist

Expected empty archiveA second cluster in the same archive

A clone that is supposed to archive into the same bucket with the same serverName would overwrite the original's archive. CNPG checks for this: the cluster hangs in "Setting up primary", the log says "WAL archive check failed … Expected empty archive". The remedy is a different serverName or bucket.

Fix

Correct the configuration in the ObjectStore, here the endpoint. The sidecars re-read the ObjectStore without a restart. After about a minute the status says OK, and a new backup completes.
kubectl patch objectstore tag19-s3 -n tag19 --type merge \
  -p '{"spec":{"configuration":{"endpointURL":"http://172.16.0.123:9000"}}}'
kubectl cnpg status shop -n tag19 | grep -E 'Working WAL|Last Archived'
Working WAL archiving:          OK
Last Archived WAL:              000000010000000000000004   @   2026-11-19T07:30:56...

Don't: Looking for the cause in the backup's error message. It stops at "rpc error … exit" – only the sidecar log names the reason.

▶
Break it yourself and find it – free
PostgreSQL hands-on, day 15: CNPG backups to S3 with the Barman Cloud plugin, scheduled backups and point-in-time recovery.
Go to day 15 →

FAQ

Do I have to restart the Pods after changing the ObjectStore?

No. The sidecars re-read the ObjectStore without a restart.

Why does every instance Pod have two containers?

The plugin runs as the sidecar plugin-barman-cloud, as a native sidecar init container with restartPolicy Always.

Related error patterns

More