{"record":{"id":"cf5291699ae55874","repo":"rustfs/rustfs","slug":"invaliddata-cf5291","errorCode":"InvalidData","errorMessage":"GCS remote version is not a valid generation","messagePattern":"GCS remote version is not a valid generation","errorType":"exception","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"crates/ecstore/src/services/tier/warm_backend_gcs.rs","lineNumber":52,"sourceCode":"    admin_handler_utils::AdminError,\n    api_put_object::PutObjectOptions,\n    transition_api::{Options, ReadCloser, ReaderImpl},\n};\nuse crate::services::tier::{\n    tier_config::TierGCS,\n    warm_backend::{WarmBackend, WarmBackendGetOpts},\n};\nuse tracing::warn;\n\nconst _MAX_PART_SIZE: i64 = 1024 * 1024 * 1024 * 5;\n\nfn parse_generation(remote_version: &str) -> Result<Option<i64>, Error> {\n    if remote_version.is_empty() {\n        return Ok(None);\n    }\n    let generation = remote_version\n        .parse::<i64>()\n        .map_err(|_| Error::new(ErrorKind::InvalidData, \"GCS remote version is not a valid generation\"))?;\n    if generation <= 0 {\n        return Err(Error::new(ErrorKind::InvalidData, \"GCS remote version generation must be positive\"));\n    }\n    Ok(Some(generation))\n}\n\npub struct WarmBackendGCS {\n    pub client: Arc<Storage>,\n    pub control: Arc<StorageControl>,\n    pub bucket: String,\n    pub prefix: String,\n}\n\nimpl WarmBackendGCS {\n    pub async fn new(conf: &TierGCS, tier: &str) -> Result<Self, std::io::Error> {\n        if conf.creds == \"\" {\n            return Err(std::io::Error::other(\"both access and secret keys are required\"));\n        }","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/rustfs/rustfs/blob/9e6e02ea09c86bedf44c7bd64a74ea02a0cff1de/crates/ecstore/src/services/tier/warm_backend_gcs.rs#L34-L70","documentation":"Thrown by parse_generation in the GCS warm backend. GCS identifies object versions with numeric 'generation' values, so any stored remote version must parse as i64. When a non-empty remote version string fails i64::parse (contains letters, dashes, or is an S3-style UUID), the backend reports InvalidData: the metadata does not describe a GCS generation.","triggerScenarios":"A tier operation on the GCS backend reads a stored remote version that is not numeric — e.g. an S3-style version UUID or 'null' — because the object was transitioned by a different tier/provider, the tier config was re-pointed to GCS, or the transition metadata was manually crafted.","commonSituations":"Re-creating a tier with the same name but a different backend (S3 -> GCS) so old transition metadata with UUID versions is interpreted as GCS generations; sharing a metadata store across tier configs; MinIO-migrated metadata carrying non-numeric version IDs.","solutions":["Verify the tier configuration: a tier name must keep pointing at the same backend/prefix it was created with; re-pointing a tier from S3 to GCS strands old version metadata","Create a fresh GCS tier (new name or new prefix) and re-transition the affected objects so their metadata stores numeric generations","Delete the stale transition metadata for objects that were transitioned by the previous backend and let lifecycle re-evaluate them","Never mix providers under one tier prefix"],"exampleFix":"# before: tier TIER1 re-pointed from S3 to GCS, metadata has UUID versions\nrustfs ilm tier edit gcs TIER1 --bucket gs-bucket --prefix old/\n# after: new tier + re-transition\nrustfs ilm tier add gcs TIER_GCS --bucket gs-bucket --prefix gcs-only/\n# then remove/re-transition objects that carry S3 UUID remote versions","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"// Accept only numeric generations before GCS tier operations\nfn is_gcs_generation(v: &str) -> bool {\n    v.is_empty() || v.parse::<i64>().map(|g| g > 0).unwrap_or(false)\n}","tryCatchPattern":"match parse_generation(&remote_version) {\n    Err(e) if e.kind() == std::io::ErrorKind::InvalidData => {\n        // metadata was written for a different provider: re-transition under a fresh GCS tier\n    }\n    other => other?,\n}","preventionTips":["Never re-point an existing tier name to a different backend; create a new tier","Keep one provider and one prefix per tier","Validate stored remote versions against the current tier's format after migrations"],"tags":["tiering","gcs","versioning","metadata","configuration"],"backgroundTag":"version-id-format-mismatch","analyzedSha":"9e6e02ea09c86bedf44c7bd64a74ea02a0cff1de","analyzedAt":"2026-08-16T20:34:17.560Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}