{"record":{"id":"2125e7a902de7c2c","repo":"databendlabs/databend","slug":"msg","errorCode":null,"errorMessage":"{msg}","messagePattern":"\\{msg\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/bendsave/src/storage.rs","lineNumber":81,"sourceCode":"\n/// Load the configuration file and return the operator for databend.\n///\n/// The given input is the path to databend's configuration file.\npub fn load_query_storage(cfg: &InnerConfig) -> Result<Operator> {\n    let op = init_operator(&cfg.storage.params)?;\n    debug!(\"databend storage loaded: {:?}\", op.info());\n    Ok(op)\n}\n\n/// Load the configuration file of databend meta.\n///\n/// The given input is the path to databend meta's configuration file.\npub fn load_meta_config(path: &str) -> Result<MetaServiceConfig> {\n    let content = std::fs::read_to_string(path)?;\n    let outer_config: databend_meta_cli_config::Config = toml::from_str(&content)?;\n    let meta_config: MetaConfig = outer_config\n        .try_into()\n        .map_err(|msg: String| anyhow!(\"{msg}\"))?;\n    let service_config = meta_config.service;\n\n    if !service_config.raft_config.raft_dir.starts_with(\"/\") {\n        return Err(anyhow!(\n            \"raft_dir of meta service must be an absolute path, but got: {:?}\",\n            service_config.raft_config.raft_dir\n        ));\n    }\n\n    debug!(\"databend meta storage loaded: {:?}\", service_config);\n    Ok(service_config)\n}\n\n/// Init databend query instance so that we can read meta and check license\n/// for it.\n///\n/// FIXME: I really don't like this pattern, but it's how databend work.\npub fn init_query(cfg: &InnerConfig) -> Result<()> {","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/databendlabs/databend/blob/288d84d76e20a2f8f7173bda9691eb6ece301aa9/src/bendsave/src/storage.rs#L63-L99","documentation":"`load_meta_config` in bendsave reads a databend-meta configuration file, parses it as TOML, and converts `databend_meta_cli_config::Config` into `MetaConfig`. The conversion returns a `String` error which is wrapped with `anyhow!` and propagated verbatim as `{msg}`. The error means the meta config file is syntactically/semantically invalid for the restore tool: wrong keys, missing required fields, or unconvertible values.","triggerScenarios":"Calling `load_meta_config(path)` (or `restore` which calls it) with a path to a TOML file whose contents fail `toml::from_str` (syntax error) or `try_into::<MetaConfig>()` (missing/invalid fields, mapped to a String message).","commonSituations":"Pointing bendsave at a query-node or unrelated config file instead of the meta node's config; a meta config written for a different databend version with renamed fields; hand-edited TOML with typos or missing required sections.","solutions":["Read the message text for the underlying cause; fix the TOML syntax or the field it complains about.","Confirm the path points to the meta node's config (e.g. the one used to start databend-meta), not a query/storage config.","Validate required sections (`[storage]`, `[raft_config]`, etc.) exist and match the databend-meta CLI config schema for your version.","Regenerate the config from a known-good template matching your databend version.","Run a TOML linter on the file to catch syntax issues first."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let content = std::fs::read_to_string(path)?;\nlet cfg: toml::Value = toml::from_str(&content)?; // surface syntax errors early\nif cfg.get(\"raft_config\").is_none() {\n    return Err(\"missing [raft_config] section in meta config\".into());\n}","typeGuard":"fn looks_like_meta_config(cfg: &toml::Value) -> bool {\n    cfg.get(\"raft_config\").is_some() && cfg.get(\"storage\").is_some()\n}","tryCatchPattern":"match bendsave::load_meta_config(path) {\n    Ok(cfg) => cfg,\n    Err(e) => {\n        eprintln!(\"invalid meta config at {path}: {e}\");\n        std::process::exit(2);\n    }\n}","preventionTips":["Always pass the databend-meta node's own config file, never query/storage configs","Keep meta config templates in sync with your databend version","Lint TOML files before use","Diff config against a known-good sample for the same version"],"tags":["config","toml","bendsave","restore"],"backgroundTag":"invalid-config-value","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"}