{"record":{"id":"de80e959977edbaf","repo":"risingwavelabs/risingwave","slug":"storage-directory-mismatch","errorCode":null,"errorMessage":"storage_directory mismatch: {} {}","messagePattern":"storage_directory mismatch: (.+?) (.+?)","errorType":"exception","errorClass":"BackupError","httpStatus":null,"severity":"error","filePath":"src/meta/src/backup_restore/restore.rs","lineNumber":232,"sourceCode":"            || opts.overwrite_backup_storage_directory.is_none())\n    {\n        return Err(BackupError::Other(anyhow::anyhow!(\"overwrite_hummock_storage_endpoint, overwrite_backup_storage_url, overwrite_backup_storage_directory must be set simultaneously\".to_owned())));\n    }\n\n    // Restore meta store.\n    let target_snapshot = loader.load(target_id).await?;\n    if !opts.overwrite_hummock_storage_endpoint {\n        let storage_url = target_snapshot.metadata.storage_url()?;\n        if storage_url != opts.hummock_storage_url {\n            return Err(BackupError::Other(anyhow::anyhow!(\n                \"storage_url mismatch: {} {}\",\n                storage_url,\n                opts.hummock_storage_url\n            )));\n        }\n        let storage_directory = target_snapshot.metadata.storage_directory()?;\n        if storage_directory != opts.hummock_storage_directory {\n            return Err(BackupError::Other(anyhow::anyhow!(\n                \"storage_directory mismatch: {} {}\",\n                storage_directory,\n                opts.hummock_storage_directory\n            )));\n        }\n    }\n\n    if opts.dry_run {\n        tracing::info!(\"Complete dry run.\");\n        return Ok(());\n    }\n    let hummock_version = target_snapshot.metadata.hummock_version_ref().clone();\n    writer.write(target_snapshot).await?;\n    if opts.overwrite_hummock_storage_endpoint {\n        writer\n            .overwrite(\n                &format!(\"hummock+{}\", opts.hummock_storage_url),\n                &opts.hummock_storage_directory,","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/backup_restore/restore.rs#L214-L250","documentation":"Same validation family as the storage_url check: when not overwriting endpoints, the snapshot's storage_directory must equal `opts.hummock_storage_directory`. A mismatch means the snapshot's hummock data lives under a different object-storage directory than the target cluster expects.","triggerScenarios":"Restore with overwrite_hummock_storage_endpoint=false while opts.hummock_storage_directory differs from target_snapshot.metadata.storage_directory().","commonSituations":"Backup taken with a custom hummock directory (e.g. `bucket/path-a`) restored into a cluster configured with another directory; environment migration without override flags.","solutions":["Set `--hummock-storage-directory` to match the snapshot's recorded storage_directory","Use the full overwrite path (overwrite_hummock_storage_endpoint + url + directory) when intentionally relocating the data","Confirm which backup/snapshot you restored from to learn its original directory"],"exampleFix":"// before\nrisectl meta restore --hummock-storage-directory path-b\n// after\nrisectl meta restore --hummock-storage-directory path-a  # matches snapshot\n# or add overwrite flags to relocate deliberately","handlingStrategy":"validation","validationCode":"if !opts.overwrite_hummock_storage_endpoint\n    && target_snapshot.metadata.storage_directory()? != opts.hummock_storage_directory {\n    return Err(anyhow!(\"storage_directory mismatch; align opts or use overwrite flags\"));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Record hummock storage directory when taking backups","Validate url and directory together before dispatching restore","Use overwrite flag trio for intentional environment moves"],"tags":["rust","meta","restore","storage","config"],"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"}