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

Đang mở
#455 2 bình luận 1 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
Go
Star
191
Fork
72
Merge trung bình
2 ngày 21 giờ
Pull request đã merge (30 ngày)
21

Mô tả

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!

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với internal/cnpgi/instance/retention.go, đặc biệt là CatalogMaintenanceRunnable. Truy vết lệnh gọi của nó đến barman-cloud/pkg/command/backupdelete.go và tái hiện lỗi bằng các phiên bản plugin và image đã được báo cáo. Hoàn tất khi việc thực thi retention có thể đọc các catalog backup được liệt kê và xóa các backup mà không gặp lỗi mã hóa BackupInfo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
go, postgresql
Lĩnh vực
backend, databases
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.