{"record":{"id":"2c9fa87b4076dab9","repo":"databendlabs/databend","slug":"unsupported-scheme","errorCode":null,"errorMessage":"Unsupported scheme: {}","messagePattern":"Unsupported scheme: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/bendsave/src/storage.rs","lineNumber":212,"sourceCode":"    let op = match scheme {\n        \"s3\" => {\n            if name.is_empty() {\n                return Err(anyhow!(\n                    \"bendsave requires bucket but it's empty in uri: {}\",\n                    uri.to_string()\n                ));\n            }\n            map.insert(\"bucket\".to_string(), name.to_string());\n            map.insert(\"root\".to_string(), path.to_string());\n            let op = Operator::from_iter::<opendal::services::S3>(map)?.finish();\n            Ok(op)\n        }\n        \"fs\" => {\n            map.insert(\"root\".to_string(), format!(\"/{name}/{path}\"));\n            let op = Operator::from_iter::<opendal::services::Fs>(map)?.finish();\n            Ok(op)\n        }\n        _ => Err(anyhow::anyhow!(\"Unsupported scheme: {}\", scheme)),\n    }?;\n\n    let op = op\n        .layer(RetryLayer::default().with_jitter())\n        .layer(LoggingLayer::default());\n    debug!(\"epoch storage loaded: {:?}\", op.info());\n    Ok(op)\n}\n\n#[cfg(test)]\nmod tests {\n    use std::path::Path;\n\n    use opendal::Scheme;\n\n    use super::*;\n\n    #[tokio::test]","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/databendlabs/databend/blob/288d84d76e20a2f8f7173bda9691eb6ece301aa9/src/bendsave/src/storage.rs#L194-L230","documentation":"load_bendsave_storage only supports the s3 and fs URI schemes; any other scheme falls into the catch-all arm and returns this error. The operator cannot be constructed because opendal has no configured service for the unknown scheme.","triggerScenarios":"Passing backup/restore a storage URI with a scheme other than s3:// or fs:// (e.g. azblob://, gcs://, oss://, or a typo like s4://).","commonSituations":"Using URI schemes familiar from other tools (cloud-storage-rs, rclone) that this bendsave build does not implement; typo in the scheme; expecting GCS/Azure support that isn't wired in.","solutions":["Use s3:// (with bucket and query params) or fs:// (local path) URIs only.","Fix the scheme typo if you meant s3 or fs.","For object stores that are S3-compatible (GCS interop, MinIO), expose them via the s3 scheme with the proper endpoint parameter.","If another backend is genuinely required, extend the match in load_bendsave_storage with a new Operator::from_iter service branch."],"exampleFix":"// before\nlet uri = \"gcs://my-bucket/backups\";\n// after\nlet uri = \"s3://my-bucket/backups?endpoint=https://storage.googleapis.com\";","handlingStrategy":"validation","validationCode":"// Rust: restrict schemes before calling the loader\nconst ALLOWED: [&str; 2] = [\"s3\", \"fs\"];\nlet scheme = url::Url::parse(&uri)?.scheme().to_string();\nif !ALLOWED.contains(&scheme.as_str()) {\n    return Err(format!(\"scheme '{scheme}' not supported; use s3 or fs\"));\n}","typeGuard":null,"tryCatchPattern":"match load_bendsave_storage(&uri, ...) {\n    Ok(op) => op,\n    Err(e) if e.to_string().starts_with(\"Unsupported scheme\") => {\n        eprintln!(\"use s3:// or fs:// URI\"); Err(e)\n    }\n    Err(e) => Err(e),\n}","preventionTips":["Document the supported schemes (s3, fs) in your tooling help text","Normalize S3-compatible stores (MinIO, GCS interop) to the s3 scheme","Add a unit test that parses all operator-supplied URIs"],"tags":["rust","bendsave","uri","unsupported-scheme"],"backgroundTag":"unsupported-operation","analyzedSha":"288d84d76e20a2f8f7173bda9691eb6ece301aa9","analyzedAt":"2026-09-11T11:29:36.208Z","contentChangedAt":"2026-09-11T11:29:36.208Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}