databendlabs/databend · error

bandsave load databend meta data failed

Error message

bandsave load databend meta data failed: {err:?}

What it means

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.

Solutions

  1. Verify the meta data object exists at the configured path in the storage backend (list/check with aws s3 ls or opendal CLI).
  2. Test the storage URI credentials and region with an independent client (aws s3 cp) to rule out auth/network issues.
  3. Retry the backup; if transient S3 errors persist, configure RetryLayer (already applied) and check bucket availability.
  4. Check the inner err:? details in the log to distinguish NotFound vs permission vs transport errors and fix accordingly.

Example fix

// before
let (meta_client, stream) = load_databend_meta(...).await?;
// after
let (meta_client, stream) = match load_databend_meta(...).await {
    Ok(v) => v,
    Err(e) => { eprintln!("meta load failed: {e:#}"); return Err(e); }
};
Defensive patterns

Strategy: try-catch

Validate before calling

// Rust: pre-check the meta object is readable
let meta = op.stat("<meta_path>").await.map_err(|e| format!("meta object unreadable: {e}"))?;
assert!(meta.mode().is_file());

Try / catch

match load_databend_meta(...).await {
    Ok((client, stream)) => { /* proceed */ }
    Err(e) => { log::error!("backup aborted: {e:#}"); return Err(e); }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


AI-assisted analysis of databendlabs/databend@288d84d76e (2026-09-11). Data as JSON: /api/errors/a64010c4f5934f2f. Report an issue: GitHub.

Appendix: source

Thrown at src/bendsave/src/storage.rs:176

    let mut established_client = meta_client.make_established_client().await?;

    // Convert stream from meta chunks to bytes.
    let stream = established_client
        .export_v1(ExportRequest::default())
        .await?
        .into_inner()
        .map_ok(|v| {
            debug!("load databend meta data with {} entries", v.data.len());
            let mut bs = BytesMut::with_capacity(
                v.data.len() + v.data.iter().map(|v| v.len()).sum::<usize>(),
            );
            v.data.into_iter().for_each(|b| {
                bs.extend_from_slice(b.as_bytes());
                bs.put_u8(b'\n');
            });
            bs.freeze()
        })
        .map_err(|err| anyhow!("bandsave load databend meta data failed: {err:?}"));
    Ok((meta_client, stream))
}

/// Load epochfs storage from uri.
///
/// S3: `s3://bucket/path/to/root/?region=us-east-1&access_key_id=xxx&secret_access_key=xxx`
/// Fs: `fs://path/to/data`
pub async fn load_bendsave_storage(uri: &str) -> Result<Operator> {
    let uri = http::Uri::from_str(uri)?;
    let scheme = uri.scheme_str().unwrap_or_default();
    let name = uri.host().unwrap_or_default();
    let path = uri.path();
    let mut map: HashMap<String, String> =
        form_urlencoded::parse(uri.query().unwrap_or_default().as_bytes())
            .map(|(k, v)| (k.to_string(), v.to_lowercase()))
            .collect();

    let op = match scheme {

View on GitHub (pinned to 288d84d76e)