{"record":{"id":"a64010c4f5934f2f","repo":"databendlabs/databend","slug":"bandsave-load-databend-meta-data-failed-err","errorCode":null,"errorMessage":"bandsave load databend meta data failed: {err:?}","messagePattern":"bandsave load databend meta data failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/bendsave/src/storage.rs","lineNumber":176,"sourceCode":"    let mut established_client = meta_client.make_established_client().await?;\n\n    // Convert stream from meta chunks to bytes.\n    let stream = established_client\n        .export_v1(ExportRequest::default())\n        .await?\n        .into_inner()\n        .map_ok(|v| {\n            debug!(\"load databend meta data with {} entries\", v.data.len());\n            let mut bs = BytesMut::with_capacity(\n                v.data.len() + v.data.iter().map(|v| v.len()).sum::<usize>(),\n            );\n            v.data.into_iter().for_each(|b| {\n                bs.extend_from_slice(b.as_bytes());\n                bs.put_u8(b'\\n');\n            });\n            bs.freeze()\n        })\n        .map_err(|err| anyhow!(\"bandsave load databend meta data failed: {err:?}\"));\n    Ok((meta_client, stream))\n}\n\n/// Load epochfs storage from uri.\n///\n/// S3: `s3://bucket/path/to/root/?region=us-east-1&access_key_id=xxx&secret_access_key=xxx`\n/// Fs: `fs://path/to/data`\npub async fn load_bendsave_storage(uri: &str) -> Result<Operator> {\n    let uri = http::Uri::from_str(uri)?;\n    let scheme = uri.scheme_str().unwrap_or_default();\n    let name = uri.host().unwrap_or_default();\n    let path = uri.path();\n    let mut map: HashMap<String, String> =\n        form_urlencoded::parse(uri.query().unwrap_or_default().as_bytes())\n            .map(|(k, v)| (k.to_string(), v.to_lowercase()))\n            .collect();\n\n    let op = match scheme {","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/databendlabs/databend/blob/288d84d76e20a2f8f7173bda9691eb6ece301aa9/src/bendsave/src/storage.rs#L158-L194","documentation":"bendsave's load_databend_meta reads Databend meta data from storage as a stream of byte chunks and joins them into a single buffer; this error wraps any failure of that read operation (anyhow context added via map_err). It indicates the backup could not load the stored meta data bytes, so the backup_meta step aborts.","triggerScenarios":"Calling backup_meta -> load_databend_meta when the underlying opendal Operator read fails: object not found at the expected meta path, network error to S3, invalid credentials, or the stored meta object is unreadable/corrupt.","commonSituations":"Running bendsave against an S3 bucket where the meta snapshot path is wrong or was deleted; transient S3 connectivity failure; misconfigured region/credentials on the storage URI.","solutions":["Verify the meta data object exists at the configured path in the storage backend (list/check with aws s3 ls or opendal CLI).","Test the storage URI credentials and region with an independent client (aws s3 cp) to rule out auth/network issues.","Retry the backup; if transient S3 errors persist, configure RetryLayer (already applied) and check bucket availability.","Check the inner err:? details in the log to distinguish NotFound vs permission vs transport errors and fix accordingly."],"exampleFix":"// before\nlet (meta_client, stream) = load_databend_meta(...).await?;\n// after\nlet (meta_client, stream) = match load_databend_meta(...).await {\n    Ok(v) => v,\n    Err(e) => { eprintln!(\"meta load failed: {e:#}\"); return Err(e); }\n};","handlingStrategy":"try-catch","validationCode":"// Rust: pre-check the meta object is readable\nlet meta = op.stat(\"<meta_path>\").await.map_err(|e| format!(\"meta object unreadable: {e}\"))?;\nassert!(meta.mode().is_file());","typeGuard":null,"tryCatchPattern":"match load_databend_meta(...).await {\n    Ok((client, stream)) => { /* proceed */ }\n    Err(e) => { log::error!(\"backup aborted: {e:#}\"); return Err(e); }\n}","preventionTips":["Verify storage URI credentials/region with an independent client before running backup","Ensure the meta snapshot path exists and was written by a compatible bendsave version","Enable retries (RetryLayer) and retry transient S3 errors"],"tags":["rust","opendal","storage","backup"],"backgroundTag":"file-read-failed","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"}