cloudnative-pg / cloudnative-pg/plugin-barman-cloud
Error invoking barman-cloud-backup-delete: 'BackupInfo' object has no attribute 'encryption' and no __dict__ for setting new attributes
- Lenguaje dominante
- Go
- Estrellas
- 191
- Forks
- 72
- Merge medio
- 2 d 21 h
- PR fusionados (30 d)
- 21
Descripción
Hi,
Pruning of old backups is broken right now. I have attached the details of my deployment:
```
❯ k cnpg version
Build: {Version:1.25.0 Commit:bad5a251 Date:2024-12-23}
```
```
Image ID: ghcr.io/cloudnative-pg/plugin-barman-cloud-sidecar-testing@sha256:77a3497a7c98bd1950329a9fdb62005f823ed2e84de1fc7430fde892d313f7d0
```
```
Image: ghcr.io/cloudnative-pg/cloudnative-pg:1.26.1
Image ID: ghcr.io/cloudnative-pg/cloudnative-pg@sha256:dfb65c0b6b14e6fb10d36a4e46c0368c062adf5f436c7b0ff0251d408cc34c07
```
I have deployed the plugin using kustomization: `https://github.com/cloudnative-pg/plugin-barman-cloud/kubernetes?ref=v0.5.0`
## Log
```
{"level":"error","ts":"2025-07-30T06:55:15.259932953Z","msg":"Retention policy enforcement failed","logging_pod":"database-1","error":"exit status 1","stacktrace":"github.com/cloudnative-pg/machinery/pkg/log.(*logger).Error\n\t/go/pkg/mod/github.com/cloudnative-pg/machinery@v0.2.0/pkg/log/log.go:125\ngithub.com/cloudnative-pg/plugin-barman-cloud/internal/cnpgi/instance.(*CatalogMaintenanceRunnable).Start\n\t/workspace/internal/cnpgi/instance/retention.go:50\nsigs.k8s.io/controller-runtime/pkg/manager.(*runnableGroup).reconcile.func1\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.21.0/pkg/manager/runnable_group.go:226"}
{"level":"info","ts":"2025-07-30T07:00:15.286258466Z","msg":"Applying backup retention policy","logging_pod":"database-1","retentionPolicy":"10d"}
{"level":"error","ts":"2025-07-30T07:00:18.680113524Z","logger":"barman","msg":"Error invoking barman-cloud-backup-delete","logging_pod":"database-1","options":["--endpoint-url","https://host","--cloud-provider","aws-s3","--retention-policy","RECOVERY WINDOW OF 10 DAYS","s3://bucket/path/","database"],"stdout":"","stderr":"2025-07-30 07:00:18,079 [257141] WARNING: Unable to open backup.info file for 20250717T060002: 'BackupInfo' object has no attribute 'encryption' and no __dict__ for setting new attributes\n2025-07-30 07:00:18,256 [257141] WARNING: Unable to open backup.info file for 20250721T060003: 'BackupInfo' object has no attribute 'encryption' and no __dict__ for setting new attributes\n2025-07-30 07:00:18,343 [257141] WARNING: Unable to open backup.info file for 20250724T060002: 'BackupInfo' object has no attribute 'encryption' and no __dict__ for setting new attributes\n2025-07-30 07:00:18,453 [257141] WARNING: Unable to open backup.info file for 20250728T060002: 'BackupInfo' object has no attribute 'encryption' and no __dict__ for setting new attributes\n2025-07-30 07:00:18,454 [257141] ERROR: Cannot read the following backups: ['20250717T060002', '20250721T060003', '20250724T060002', '20250728T060002']\nUnsafe to proceed with deletion due to failure reading backup catalog\n","error":"exit status 1","stacktrace":"github.com/cloudnative-pg/machinery/pkg/log.(*logger).Error\n\t/go/pkg/mod/github.com/cloudnative-pg/machinery@v0.2.0/pkg/log/log.go:125\ngithub.com/cloudnative-pg/barman-cloud/pkg/command.DeleteBackupsByPolicy\n\t/go/pkg/mod/github.com/cloudnative-pg/barman-cloud@v0.3.1/pkg/command/backupdelete.go:71\ngithub.com/cloudnative-pg/plugin-barman-cloud/internal/cnpgi/instance.(*CatalogMaintenanceRunnable).maintenance\n\t/workspace/internal/cnpgi/instance/retention.go:131\ngithub.com/cloudnative-pg/plugin-barman-cloud/internal/cnpgi/instance.(*CatalogMaintenanceRunnable).cycle\n\t/workspace/internal/cnpgi/instance/retention.go:80\ngithub.com/cloudnative-pg/plugin-barman-cloud/internal/cnpgi/instance.(*CatalogMaintenanceRunnable).Start\n\t/workspace/internal/cnpgi/instance/retention.go:48\nsigs.k8s.io/controller-runtime/pkg/manager.(*runnableGroup).reconcile.func1\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.21.0/pkg/manager/runnable_group.go:226"}
{"level":"error","ts":"2025-07-30T07:00:18.680195245Z","msg":"while enforcing retention policies","logging_pod":"database-1","error":"exit status 1","stacktrace":"github.com/cloudnative-pg/machinery/pkg/log.(*logger).Error\n\t/go/pkg/mod/github.com/cloudnative-pg/machinery@v0.2.0/pkg/log/log.go:125\ngithub.com/cloudnative-pg/plugin-barman-cloud/internal/cnpgi/instance.(*CatalogMaintenanceRunnable).maintenance\n\t/workspace/internal/cnpgi/instance/retention.go:138\ngithub.com/cloudnative-pg/plugin-barman-cloud/internal/cnpgi/instance.(*CatalogMaintenanceRunnable).cycle\n\t/workspace/internal/cnpgi/instance/retention.go:80\ngithub.com/cloudnative-pg/plugin-barman-cloud/internal/cnpgi/instance.(*CatalogMaintenanceRunnable).Start\n\t/workspace/internal/cnpgi/instance/retention.go:48\nsigs.k8s.io/controller-runtime/pkg/manager.(*runnableGroup).reconcile.func1\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.21.0/pkg/manager/runnable_group.go:226"}
{"level":"error","ts":"2025-07-30T07:00:18.680248606Z","msg":"Retention policy enforcement failed","logging_pod":"database-1","error":"exit status 1","stacktrace":"github.com/cloudnative-pg/machinery/pkg/log.(*logger).Error\n\t/go/pkg/mod/github.com/cloudnative-pg/machinery@v0.2.0/pkg/log/log.go:125\ngithub.com/cloudnative-pg/plugin-barman-cloud/internal/cnpgi/instance.(*CatalogMaintenanceRunnable).Start\n\t/workspace/internal/cnpgi/instance/retention.go:50\nsigs.k8s.io/controller-runtime/pkg/manager.(*runnableGroup).reconcile.func1\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.21.0/pkg/manager/runnable_group.go:226"}
```
Please advise. Thank you!
Guía de contribución
Línea de trabajo
Start with internal/cnpgi/instance/retention.go, especially CatalogMaintenanceRunnable. Trace its call into barman-cloud/pkg/command/backupdelete.go and reproduce the failure using the reported plugin and image versions. Done means retention enforcement can read the listed backup catalogs and delete backups without the BackupInfo encryption error.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- go, postgresql
- Área
- backend, databases
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100