cloudnative-pg / cloudnative-pg/plugin-barman-cloud

I try to use plugin-barman-cloud as plugin but it does not work for me whit the examples.

Open
#428 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
191
Forks
72
Avg merge
2d 21h
Merged PRs (30d)
21

Description

Hello,

Please find my configuration below. It works as expected with native backups, but fails when using the plugin.
Do you have any idea what might be causing this, or is there a known bug or workaround?

Objectstore.yaml
```
apiVersion: barmancloud.cnpg.io/v1
kind: ObjectStore
metadata:
name: rhbok-barman-store
spec:
retentionPolicy: "1m"
instanceSidecarConfiguration:
env:
- name: AWS_REQUEST_CHECKSUM_CALCULATION
value: when_required
- name: AWS_RESPONSE_CHECKSUM_VALIDATION
value: when_required
retentionPolicyIntervalSeconds: 1800
resources:
requests:
memory: "64Mi"
cpu: "250m"
configuration:
destinationPath: s3://$BUCKET/backup
endpointURL: https://$S3-Storage #Own S3 Storage with Ceph Backend. It works with native Backup but with plugin not.
s3Credentials:
accessKeyId:
name: s3-config
key: ACCESS_KEY_ID
secretAccessKey:
name: s3-config
key: ACCESS_SECRET_KEY
wal:
compression: gzip
encryption: AES256
maxParallel: 8
data:
additionalCommandArgs:
- "--max-single-put-size 16777216"
- "--min-chunk-size=5MB"
- "--read-timeout=60"
- "-e AES256"

```
cluster.yaml
```
kind: Cluster
metadata:
name: cluster-example
spec:
instances: 3
plugins:
- name: barman-cloud.cloudnative-pg.io
isWALArchiver: true
parameters:
barmanObjectName: rhbok-barman-store

storage:
size: 1Gi
walStorage:
size: 1Gi
```

backup.yaml
```
apiVersion: postgresql.cnpg.io/v1
kind: Backup
metadata:
name: backup-example
spec:
cluster:
name: cluster-example
method: plugin
pluginConfiguration:
name: barman-cloud.cloudnative-pg.io
```

Logs:
```
{"level":"info","ts":"2025-06-30T06:11:49.628098638Z","msg":"Pre hook reconciliation start"}
{"level":"info","ts":"2025-06-30T06:11:49.968887541Z","msg":"Pre hook reconciliation start"}
{"level":"info","ts":"2025-06-30T06:11:50.224816628Z","msg":"Pre hook reconciliation start"}
{"level":"debug","ts":"2025-06-30T06:11:50.224986386Z","msg":"parsing cluster definition","caller":"/workspace/internal/cnpgi/operator/reconciler.go:61"}
{"level":"debug","ts":"2025-06-30T06:11:50.225403843Z","msg":"parsing barman object configuration","name":"cluster-example","namespace":"cnpg-system","caller":"/workspace/internal/cnpgi/operator/reconciler.go:75"}
{"level":"info","ts":"2025-06-30T06:11:50.225514962Z","msg":"Pre hook reconciliation completed","name":"cluster-example","namespace":"cnpg-system"}
{"level":"info","ts":"2025-06-30T06:11:50.339214842Z","logger":"lifecycle","msg":"Lifecycle hook reconciliation start"}
{"level":"info","ts":"2025-06-30T06:11:50.339665074Z","logger":"lifecycle","msg":"Reconciling pod"}
{"level":"debug","ts":"2025-06-30T06:11:50.340237236Z","logger":"plugin-barman-cloud-lifecycle","msg":"generated patch","podName":"cluster-example-3","caller":"/workspace/internal/cnpgi/operator/lifecycle.go:269","content":"[{\"op\":\"add\",\"path\":\"/spec/volumes/4\",\"value\":{\"name\":\"plugins\",\"emptyDir\":{}}},{\"op\":\"add\",\"path\":\"/spec/volumes/5\",\"value\":{\"name\":\"barman-certificates\",\"projected\":{\"sources\":null}}},{\"op\":\"add\",\"path\":\"/spec/initContainers/1\",\"value\":{\"name\":\"plugin-barman-cloud\",\"image\":\"ghcr.io/cloudnative-pg/plugin-barman-cloud-sidecar:v0.5.0\",\"args\":[\"instance\"],\"env\":[{\"name\":\"PGDATA\",\"value\":\"/var/lib/postgresql/data/pgdata\"},{\"name\":\"POD_NAME\",\"value\":\"cluster-example-3\"},{\"name\":\"NAMESPACE\",\"value\":\"cnpg-system\"},{\"name\":\"CLUSTER_NAME\",\"value\":\"cluster-example\"},{\"name\":\"PSQL_HISTORY\",\"value\":\"/controller/tmp/.psql_history\"},{\"name\":\"PGPORT\",\"value\":\"5432\"},{\"name\":\"PGHOST\",\"value\":\"/controller/run\"},{\"name\":\"TMPDIR\",\"value\":\"/controller/tmp\"},{\"name\":\"SPOOL_DIRECTORY\",\"value\":\"/controller/wal-restore-spool\"},{\"name\":\"CUSTOM_CNPG_GROUP\",\"value\":\"postgresql.cnpg.io\"},{\"name\":\"CUSTOM_CNPG_VERSION\",\"value\":\"v1\"},{\"name\":\"AWS_REQUEST_CHECKSUM_CALCULATION\",\"value\":\"when_required\"},{\"name\":\"AWS_RESPONSE_CHECKSUM_VALIDATION\",\"value\":\"when_required\"}],\"resources\":{\"requests\":{\"cpu\":\"250m\",\"memory\":\"64Mi\"}},\"restartPolicy\":\"Always\",\"volumeMounts\":[{\"name\":\"barman-certificates\",\"mountPath\":\"/barman-certificates\"},{\"name\":\"pgdata\",\"mountPath\":\"/var/lib/postgresql/data\"},{\"name\":\"scratch-data\",\"mountPath\":\"/run\"},{\"name\":\"scratch-data\",\"mountPath\":\"/controller\"},{\"name\":\"shm\",\"mountPath\":\"/dev/shm\"},{\"name\":\"pg-wal\",\"mountPath\":\"/var/lib/postgresql/wal\"},{\"name\":\"plugins\",\"mountPath\":\"/plugins\"}],\"startupProbe\":{\"exec\":{\"command\":[\"/manager\",\"healthcheck\",\"unix\"]},\"timeoutSeconds\":10,\"failureThreshold\":10},\"securityContext\":{\"capabilities\":{\"drop\":[\"ALL\"]},\"privileged\":false,\"runAsNonRoot\":true,\"readOnlyRootFilesystem\":true,\"allowPrivilegeEscalation\":false,\"seccompProfile\":{\"type\":\"RuntimeDefault\"}}}},{\"op\":\"add\",\"path\":\"/spec/containers/0/volumeMounts/5\",\"value\":{\"name\":\"plugins\",\"mountPath\":\"/plugins\"}}]"}
{"level":"info","ts":"2025-06-30T06:11:50.342558264Z","logger":"lifecycle","msg":"Lifecycle hook reconciliation start"}
{"level":"info","ts":"2025-06-30T06:11:50.342927602Z","logger":"lifecycle","msg":"Reconciling pod"}
```
```
{"level":"info","ts":"2025-06-30T06:10:20.892168744Z","msg":"Cluster has become healthy","controller":"cluster","controllerGroup":"postgresql.cnpg.io","controllerKind":"Cluster","Cluster":{"name":"cluster-example","namespace":"cnpg-system"},"namespace":"cnpg-system","name":"cluster-example","reconcileID":"07805cef-6ab2-4ddf-9676-f9540774ce74"}
{"level":"info","ts":"2025-06-30T06:11:49.610067684Z","logger":"backup-resource","msg":"Defaulting for Backup","version":"v1","name":"backup-example","namespace":"cnpg-system"}
{"level":"info","ts":"2025-06-30T06:11:49.616925609Z","logger":"backup-resource","msg":"Validation for Backup upon creation","version":"v1","name":"backup-example","namespace":"cnpg-system"}
{"level":"info","ts":"2025-06-30T06:11:49.747317895Z","msg":"Starting backup","controller":"backup","controllerGroup":"postgresql.cnpg.io","controllerKind":"Backup","Backup":{"name":"backup-example","namespace":"cnpg-system"},"namespace":"cnpg-system","name":"backup-example","reconcileID":"6b8b8b08-11e4-4f5c-8e94-b20f7cfd54d4","cluster":"cluster-example","pod":"cluster-example-2"}
{"level":"info","ts":"2025-06-30T06:11:49.96993148Z","msg":"Backup is already running on","controller":"backup","controllerGroup":"postgresql.cnpg.io","controllerKind":"Backup","Backup":{"name":"backup-example","namespace":"cnpg-system"},"namespace":"cnpg-system","name":"backup-example","reconcileID":"4507ee3d-9fd3-4316-b76f-c9c6fa207d65","cluster":"cluster-example","pod":"cluster-example-2","started at":""}
```

```
{"level":"info","ts":"2025-06-30T06:11:49.965084729Z","msg":"Plugin backup started","pluginConfiguration":{"name":"barman-cloud.cloudnative-pg.io"},"backupName":"backup-example","backupNamespace":"backup-example","logging_pod":"cluster-example-2"}
{"level":"error","ts":"2025-06-30T06:11:51.522984631Z","msg":"Error while calling Backup, failing","pluginName":"barman-cloud.cloudnative-pg.io","logging_pod":"cluster-example-2","error":"rpc error: code = Unknown desc = exit status 3","stacktrace":"github.com/cloudnative-pg/machinery/pkg/log.(*logger).Error\n\tpkg/mod/github.com/cloudnative-pg/machinery@v0.2.0/pkg/log/log.go:125\ngithub.com/cloudnative-pg/cloudnative-pg/internal/cnpi/plugin/client.(*data).Backup\n\tinternal/cnpi/plugin/client/backup.go:154\ngithub.com/cloudnative-pg/cloudnative-pg/pkg/management/postgres/webserver.(*PluginBackupCommand).invokeStart\n\tpkg/management/postgres/webserver/plugin_backup.go:117"}
{"level":"error","ts":"2025-06-30T06:11:51.523125378Z","msg":"Backup failed","logging_pod":"cluster-example-2","error":"rpc error: code = Unknown desc = exit status 3","stacktrace":"github.com/cloudnative-pg/machinery/pkg/log.(*logger).Error\n\tpkg/mod/github.com/cloudnative-pg/machinery@v0.2.0/pkg/log/log.go:125\ngithub.com/cloudnative-pg/cloudnative-pg/pkg/management/postgres/webserver.(*PluginBackupCommand).markBackupAsFailed\n\tpkg/management/postgres/webserver/plugin_backup.go:172\ngithub.com/cloudnative-pg/cloudnative-pg/pkg/management/postgres/webserver.(*PluginBackupCommand).invokeStart\n\tpkg/management/postgres/webserver/plugin_backup.go:124"}
{"level":"info","ts":"2025-06-30T06:14:29.786853273Z","logger":"postgres","msg":"record","logging_pod":"cluster-example-2","record":{"log_time":"2025-06-30 06:14:29.786 UTC","process_id":"27","session_id":"68622a19.1b","session_line_num":"1","session_start_time":"2025-06-30 06:09:29 UTC","transaction_id":"0","error_severity":"LOG","sql_state_code":"00000","message":"restartpoint starting: time","backend_type":"checkpointer","query_id":"0"}}
{"level":"info","ts":"2025-06-30T06:14:34.11099954Z","logger":"postgres","msg":"record","logging_pod":"cluster-example-2","record":{"log_time":"2025-06-30 06:14:34.110 UTC","process_id":"27","session_id":"68622a19.1b","session_line_num":"2","session_start_time":"2025-06-30 06:09:29 UTC","transaction_id":"0","error_severity":"LOG","sql_state_code":"00000","message":"restartpoint complete: wrote 45 buffers (0.3%); 0 WAL file(s) added, 0 removed, 0 recycled; write=4.315 s, sync=0.002 s, total=4.325 s; sync files=10, longest=0.002 s, average=0.001 s; distance=32768 kB, estimate=32768 kB; lsn=0/5000080, redo lsn=0/5000028","backend_type":"checkpointer","query_id":"0"}}
{"level":"info","ts":"2025-06-30T06:14:34.111058351Z","logger":"postgres","msg":"record","logging_pod":"cluster-example-2","record":{"log_time":"2025-06-30 06:14:34.110 UTC","process_id":"27","session_id":"68622a19.1b","session_line_num":"3","session_start_time":"2025-06-30 06:09:29 UTC","transaction_id":"0","error_severity":"LOG","sql_state_code":"00000","message":"recovery restart point at 0/5000028","detail":"Last completed transaction was at log time 2025-06-30 06:10:44.41361+00.","backend_type":"checkpointer","query_id":"0"}}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.