{"record":{"id":"ac0795f7196f4634","repo":"risingwavelabs/risingwave","slug":"storage-url-mismatch","errorCode":null,"errorMessage":"storage_url mismatch: {} {}","messagePattern":"storage_url mismatch: (.+?) (.+?)","errorType":"exception","errorClass":"BackupError","httpStatus":null,"severity":"error","filePath":"src/meta/src/backup_restore/restore.rs","lineNumber":224,"sourceCode":"    target_id: MetaSnapshotId,\n    opts: &RestoreOpts,\n    loader: L,\n    writer: W,\n) -> BackupResult<()> {\n    // Validate parameters.\n    if opts.overwrite_hummock_storage_endpoint\n        && (opts.overwrite_backup_storage_url.is_none()\n            || 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(());","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/backup_restore/restore.rs#L206-L242","documentation":"When NOT overwriting the hummock storage endpoint, dispatch compares the snapshot's stored storage_url with `opts.hummock_storage_url` and aborts on mismatch. This prevents restoring a snapshot into an environment whose object storage endpoint differs from what the snapshot data references.","triggerScenarios":"Restore with overwrite_hummock_storage_endpoint=false while opts.hummock_storage_url differs from target_snapshot.metadata.storage_url().","commonSituations":"Restoring a backup taken in one cloud/region into a cluster configured with a different S3 endpoint or bucket URL; copy-paste of the wrong storage URL in the restore command.","solutions":["Correct `--hummock-storage-url` to match the snapshot's recorded storage_url (visible in restore output/manifest)","If intentionally restoring into a different environment, enable overwrite_hummock_storage_endpoint together with overwrite_backup_storage_url and overwrite_backup_storage_directory","Verify the backup store you loaded from is the intended one"],"exampleFix":"// before\nrisectl meta restore --hummock-storage-url s3://wrong-bucket\n// after\nrisectl meta restore --hummock-storage-url s3://original-bucket  # matches snapshot\n# or add: --overwrite-hummock-storage-endpoint --overwrite-backup-storage-url ... --overwrite-backup-storage-directory ...","handlingStrategy":"validation","validationCode":"if !opts.overwrite_hummock_storage_endpoint\n    && target_snapshot.metadata.storage_url()? != opts.hummock_storage_url {\n    return Err(anyhow!(\"storage_url mismatch; align opts or use overwrite flags\"));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy storage_url/directory values from the snapshot manifest, not from memory","Use overwrite flags deliberately when migrating environments","Dry-run restore option checks in DR drills"],"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"}