# 409 Conflict: The object version you are trying to delete is not the latest version.

- **ID:** `cloud/gcp-cloud-storage-bucket-object-versioning-conflict`
- **Domain:** cloud
- **Category:** protocol_error
- **Error Code:** `409`
- **Verification:** ai_generated
- **Fix Rate:** 95%

## Root Cause

When bucket versioning is enabled, deleting a non-latest object version requires specifying the generation number; otherwise Cloud Storage returns a 409 conflict.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| GCS JSON API v1 | active | — | — |
| Google Cloud Storage Client Library 2.x | active | — | — |
| gsutil 5.x | active | — | — |

## Workarounds

1. **Use gsutil with generation number: `gsutil rm gs://bucket-name/object#<generation-number>`. To find generation numbers: `gsutil ls -la gs://bucket-name/object`.** (95% success)
   ```
   Use gsutil with generation number: `gsutil rm gs://bucket-name/object#<generation-number>`. To find generation numbers: `gsutil ls -la gs://bucket-name/object`.
   ```
2. **Delete all versions of an object: `gsutil rm -a gs://bucket-name/object` (the -a flag removes all versions).** (98% success)
   ```
   Delete all versions of an object: `gsutil rm -a gs://bucket-name/object` (the -a flag removes all versions).
   ```

## Dead Ends

- **** — If bucket versioning is enabled, the API requires generation for deleting a specific version; the error persists. (95% fail)
- **** — Disabling versioning does not delete existing versions; you must suspend versioning and then delete each version separately. (70% fail)
- **** — gsutil rm without -a only deletes the live version; non-current versions remain and cause conflict errors. (85% fail)
