{"record":{"id":"f5fa2b35e1e5422e","repo":"databendlabs/databend","slug":"log-history-is-enabled-but-storage-params-is-not-s","errorCode":null,"errorMessage":"Log history is enabled but storage_params is not set","messagePattern":"Log history is enabled but storage_params is not set","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/meta/binaries/meta/entry.rs","lineNumber":447,"sourceCode":"    );\n\n    let log_labels = [\n        (\"cluster_name\", raft_config.cluster_name.as_str()),\n        (\"node_id\", &raft_config.id.to_string()),\n        (\"cluster_id\", raft_config.cluster_name.as_str()),\n    ]\n    .into_iter()\n    .map(|(k, v)| (k.to_string(), v.to_string()))\n    .collect();\n\n    GlobalInstance::init_production();\n    GlobalLogger::init(&app_name, log_config, log_labels);\n\n    if log_config.history.on {\n        GlobalIORuntime::init(num_cpus::get())?;\n\n        let params = log_config.history.storage_params.as_ref().ok_or_else(|| {\n            anyhow::anyhow!(\"Log history is enabled but storage_params is not set\")\n        })?;\n\n        let remote_log_op = init_operator(params).map_err(|e| anyhow::anyhow!(e))?;\n        GlobalLogger::instance().set_operator(remote_log_op).await;\n    }\n\n    Ok(())\n}\n\nfn pretty<T>(v: &T) -> Result<String, serde_json::Error>\nwhere T: serde::Serialize {\n    serde_json::to_string_pretty(v)\n}\n","sourceCodeStart":429,"sourceCodeEnd":461,"githubUrl":"https://github.com/databendlabs/databend/blob/288d84d76e20a2f8f7173bda9691eb6ece301aa9/src/meta/binaries/meta/entry.rs#L429-L461","documentation":"The metasrv binary's logging initialization requires that when log history is enabled (`log.history.on = true`), a storage backend must be configured via `log.history.storage_params`. If logging is on but storage_params is missing, init_logging_system aborts startup with this anyhow error before any nodes can run.","triggerScenarios":"Running databend-meta with a config where [log.history] on = true but storage_params (e.g. an s3/fs operator config) is absent.","commonSituations":"Operators upgrading from versions where log history storage was optional; copying a config file and enabling history.on without adding storage_params; environment-based config generation that omits the storage section.","solutions":["Set storage_params under [log.history] in the metasrv config (e.g. type = \"fs\", data_dir) or an S3/GCS endpoint","Set log.history.on = false if history logging is not needed","Check the effective config file rendered at startup to confirm the section exists"],"exampleFix":"// before\n[log.history]\non = true\n// after\n[log.history]\non = true\n[log.history.storage_params]\ntype = \"fs\"\nroot = \"./.databend/meta_logs\"","handlingStrategy":"validation","validationCode":"if log_config.history.on && log_config.history.storage_params.is_none() {\n    return Err(anyhow!(\"Log history is enabled but storage_params is not set\"));\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Ok(v) => v,\n    Err(e) => { log::error!(\"log history storage config missing: {}\", e); std::process::exit(1); }\n}","preventionTips":["Keep [log.history] on and storage_params adjacent in the same config template","Lint metasrv config files for required sections before deployment","Disable log.history.on when storage_params is intentionally omitted"],"tags":["config","logging","metasrv"],"backgroundTag":"missing-required-config-field","analyzedSha":"288d84d76e20a2f8f7173bda9691eb6ece301aa9","analyzedAt":"2026-09-11T11:29:36.208Z","contentChangedAt":"2026-09-11T11:29:36.208Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}