{"record":{"id":"641c5e871edcb600","repo":"risingwavelabs/risingwave","slug":"invalid-state-store-from-metadata-snapshot","errorCode":null,"errorMessage":"invalid state_store from metadata snapshot: {}","messagePattern":"invalid state_store from metadata snapshot: (.+?)","errorType":"exception","errorClass":"BackupError","httpStatus":null,"severity":"error","filePath":"src/storage/backup/src/meta_snapshot_v2.rs","lineNumber":218,"sourceCode":"\n    fn hummock_version(self) -> HummockVersion {\n        self.hummock_version\n    }\n\n    fn storage_url(&self) -> BackupResult<String> {\n        let storage_url_from_snapshot =\n            Itertools::exactly_one(self.system_parameters.iter().filter_map(|m| {\n                if m.name == \"state_store\" {\n                    return Some(m.value.clone());\n                }\n                None\n            }))\n            .map_err(|_| BackupError::Other(anyhow!(\"expect state_store\")))?;\n        storage_url_from_snapshot\n            .strip_prefix(\"hummock+\")\n            .map(|s| s.to_owned())\n            .ok_or_else(|| {\n                BackupError::Other(anyhow!(\n                    \"invalid state_store from metadata snapshot: {}\",\n                    storage_url_from_snapshot\n                ))\n            })\n    }\n\n    fn storage_directory(&self) -> BackupResult<String> {\n        Itertools::exactly_one(self.system_parameters.iter().filter_map(|m| {\n            if m.name == \"data_directory\" {\n                return Some(m.value.clone());\n            }\n            None\n        }))\n        .map_err(|_| BackupError::Other(anyhow!(\"expect data_directory\")))\n    }\n\n    fn table_change_log_object_ids(&self) -> HashSet<HummockRawObjectId> {\n        self.hummock_table_change_logs","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/storage/backup/src/meta_snapshot_v2.rs#L200-L236","documentation":"MetaSnapshotV2::storage_url strips the \"hummock+\" prefix from the snapshot's state_store value; if the value lacks that prefix it throws \"invalid state_store from metadata snapshot: {}\" with the offending value. The stored state store URL must be a Hummock-compatible URL for restore to rebuild storage config.","triggerScenarios":"storage_url() finding a state_store parameter whose value does not start with \"hummock+\" — e.g. the cluster was configured with a non-hummock or malformed state_store string at backup time.","commonSituations":"A cluster run with an experimental/modified state store URL; a typo in state_store config persisted into system parameters before the backup; snapshots from environments using URL schemes the restore code doesn't recognize.","solutions":["Check the persisted state_store value in the snapshot (it is included in the error) and confirm what the cluster was configured with at backup time.","Recreate the backup from a cluster whose state_store is a valid hummock URL (e.g. hummock+s3://bucket).","Patch the snapshot's system_parameter entry to a valid hummock+ URL if you know the intended store, then retry restore.","Validate state_store config (must match ^hummock\\+.+) before starting the cluster that will be backed up."],"exampleFix":"// before: cluster configured with a bare URL\n-- state_store = \"s3://bucket\"\n// after: persist a hummock-prefixed URL\n-- state_store = \"hummock+s3://bucket\"","handlingStrategy":"validation","validationCode":"let v = snapshot.system_parameters.iter().find(|m| m.name == \"state_store\")\n    .map(|m| m.value.clone()).unwrap_or_default();\nif !v.starts_with(\"hummock+\") {\n    return Err(anyhow!(\"state_store must start with hummock+, got: {}\", v));\n}","typeGuard":"fn is_hummock_url(v: &str) -> bool { v.starts_with(\"hummock+\") }","tryCatchPattern":"match snapshot.storage_url() {\n    Ok(url) => url,\n    Err(e) if e.to_string().contains(\"invalid state_store\") => {\n        return Err(anyhow!(\"snapshot from non-hummock cluster; cannot auto-restore\"));\n    }\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Validate state_store config matches the hummock+ scheme before cluster start/backup.","Never hand-edit persisted system parameters.","Store the intended URL in restore tooling config so mismatches are detectable."],"tags":["rust","backup","restore","config","url"],"backgroundTag":"invalid-config-value","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}