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
- 主要语言
- Go
- 星标
- 191
- 派生
- 72
- 平均合并
- 1 天 16 小时
- 30 天内合并 PR
- 18
描述
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!
贡献指南
调研方向
从 internal/cnpgi/instance/retention.go 开始,重点查看 CatalogMaintenanceRunnable。跟踪其调用到 barman-cloud/pkg/command/backupdelete.go,并使用报告中的 plugin 和 image 版本复现该故障。当 retention 执行能够读取列出的备份 catalog 并在不出现 BackupInfo 加密错误的情况下删除备份时,即视为完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- go, postgresql
- 领域
- backend, databases
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100