Repository navigation
Description
Is there an existing issue already for this bug?
- I have searched for an existing issue, and could not find anything. I believe this is a new bug.
I have read the troubleshooting guide
- I have read the troubleshooting guide and I think this is a new bug.
I am running a supported version of CloudNativePG
- I have read the troubleshooting guide and I think this is a new bug.
Version
1.27 (latest patch)
What version of Kubernetes are you using?
1.32
What is your Kubernetes environment?
Cloud: Other
How did you install the operator?
Helm
What happened?
We’re validating CloudNativePG (CNPG) for production on Oracle Cloud Infrastructure (OCI) via Oracle Kubernetes Engine (OKE) and we’re hitting a problem where VolumeSnapshot backups intermittently fail with HTTP 409 Conflict from the OCI Block Volume CSI — even though the CSI then finds the same snapshot, waits, and reports it ready moments later.
Per the docs and recent changes, timeouts and some driver-specific errors are treated as retryable during volumeSnapshot backups; we believe this 409 case should be handled the same way.
What happened
Triggering a backup with method: volumeSnapshot makes the CNPG Backup go to status.phase=failed as soon as the CSI’s CreateVolumeBackup returns 409 Conflict:
“There is currently a backup operation in progress for Volume …”.
However, the OCI CSI immediately detects that the same snapshot already exists, polls GetVolumeBackup until it is Available, and then returns ready_to_use: true.
So the 409 is a transient provider state, and the snapshot is actually created and usable, but the CNPG Backup fails earlier because the 409 is not considered retryable within the volumeSnapshotDeadline.
OCI CSI controller log
# 1) CreateVolumeBackup -> 409 Conflict (another/own backup in progress)
... ERROR ... Could not create snapshot "snapshot-7ab0b69a-...":
Error returned by Blockstorage Service. Http Status Code: 409. Error Code: Conflict.
Message: There is currently a backup operation in progress for Volume ocid1.volume.oc1.iad....
# 2) Driver recognizes snapshot exists; starts polling for Available
... INFO Snapshot already created, checking if lifecycleState is Available
... INFO Checking if backup ocid1.volumebackup.oc1.iad.... has become available
... INFO GetVolumeBackup ... statusCode: 200 (repeated every few seconds)
# 3) Snapshot becomes ready
... INFO Snapshot is created and available.
... gRPC response ... "ready_to_use": true, "snapshot_id": "ocid1.volumebackup.oc1.iad...."
Meanwhile, the CNPG Backup ends as failed with a message similar to:
can't execute snapshot backup: failed to take snapshot of the volume ...:
"rpc error: code = Internal desc = Could not create snapshot "...":
Http Status Code: 409. Error Code: Conflict.
Message: There is currently a backup operation in progress for Volume ...
What we expected
The VolumeSnapshot reconciler should treat HTTP 409 (Conflict) from the OCI driver (when the message indicates “backup operation in progress”) as retryable, honoring the backup.cnpg.io/volumeSnapshotDeadline window before marking the Backup as failed. This aligns with CNPG’s documented retry behavior for recoverable errors during VolumeSnapshot backups, and with the intent of recent fixes that already made timeouts during snapshot creation retryable.
How to reproduce (on OKE/OCI)
Install CNPG on OKE and configure a VolumeSnapshotClass for OCI Block Volume (blockvolume.csi.oraclecloud.com).
In a CNPG Cluster with:
spec:
backup:
volumeSnapshot:
className: oci-bv-snapshot-class
create a Backup with method: volumeSnapshot.
Watch the CSI logs: CreateVolumeBackup returns 409, then the driver lists/gets the backup by name and waits for Available, then returns ready_to_use=true.
Observe that the CNPG Backup is marked failed promptly after the first 409, before the CSI surfaces the snapshot as ready.
Hypothesis & suggested fix
-
Mark HTTP 409 Conflict from OCI Block Volume as retryable, when the error text matches this provider state (e.g., “There is currently a backup operation in progress for Volume …”, Http Status Code: 409, Error Code: Conflict, CreateVolumeBackup).
-
This matches existing logic that classifies timeouts and some driver-specific messages as retryable and would prevent false negatives for a snapshot that does become ready moments later.
(Optional) Implementation hint: in the VolumeSnapshot backup reconciler’s error classification (the same area that was extended to treat timeouts as retryable), add patterns like:
- HTTP Status Code:\s*409
- Error Code:\s*Conflict
- There is currently a backup operation in progress
- optionally coupled with CreateVolumeBackup / volumeBackups
So the reconciler keeps retrying (every ~10s) until the snapshot becomes Ready or volumeSnapshotDeadline elapses.
Happy to attach the full CSI logs if useful. Thank you!
Code of Conduct
- I agree to follow this project's Code of Conduct
Activity
dosubot commentedon Sep 22, 2025
Hi @ms3rgio! I'm Dosu and I’m helping the cloudnative-pg team.
You are correct—CloudNativePG does not currently treat HTTP 409 Conflict errors from the OCI Block Volume CSI driver (with messages like “There is currently a backup operation in progress for Volume ...”) as retryable during volume snapshot backups. The retry logic only covers certain HTTP status codes (408, 429, 500, 502, 503, 504), optimistic locking errors, and some timeouts, but not 409 Conflict or OCI-specific transient states. This matches both the documentation and the current codebase, which uses heuristics for error classification and does not include patterns for these OCI errors as retryable, so the backup fails immediately instead of retrying within the
volumeSnapshotDeadlinewindow as you expected. No recent changes or merged PRs address this gap yet.Your suggestion to extend the error classification logic to recognize these OCI-specific 409 Conflict errors as retryable is well-aligned with the current design and would help avoid false negatives for snapshots that become ready moments later.
You can find more details in the official documentation and the current error handling code.
To reply, just mention @dosu.
Docs are dead. Just use Dosu.
github-actions commentedon Dec 1, 2025
This issue is stale because it has been open for 60 days with no activity.
github-actions commentedon Dec 19, 2025
This issue was closed because it has been inactive for 14 days since being marked as stale.
andersonpaulo48 commentedon Jan 30, 2026
Hi ,
I hope you are well.
Would it be possible to implement this correction on the conveyor belt? I see nod usage increasing in Oracle Cloud @gbartolini
fix(backup): always retry VolumeSnapshot errors until the deadline (#…
fix(backup): always retry VolumeSnapshot errors until the deadline (#…
fix(backup): always retry VolumeSnapshot errors until the deadline (#…
fix(backup): always retry VolumeSnapshot errors until the deadline (#…