{"record":{"id":"493bf78222a55a0e","repo":"databendlabs/databend","slug":"not-implemented-not-implemented-for-storage-type","errorCode":null,"errorMessage":"not implemented: Not implemented for storage type: {:?}","messagePattern":"not implemented: Not implemented for storage type: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src/query/service/src/history_tables/external.rs","lineNumber":194,"sourceCode":"        }\n        StorageParams::Obs(config) => {\n            info.set_uri(\n                Scheme::Obs.to_string(),\n                config.bucket.clone(),\n                config.root.clone(),\n            );\n\n            info.set_value(\"endpoint_url\".to_string(), config.endpoint_url.clone());\n            info.set_value(\"access_key_id\".to_string(), config.access_key_id.clone());\n            info.set_value(\n                \"secret_access_key\".to_string(),\n                config.secret_access_key.clone(),\n            );\n        }\n        StorageParams::Fs(config) => {\n            info.uri = format!(\"file://{}\", normalize_root(&config.root));\n        }\n        _ => unimplemented!(\"Not implemented for storage type: {:?}\", storage_params),\n    }\n    info\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    #[test]\n    fn test_to_create_stage_sql() {\n        let mut connection = ExternalStorageConnection::new(BTreeMap::new());\n        connection.set_uri(\n            \"s3\".to_string(),\n            \"test-bucket\".to_string(),\n            \"test\".to_string(),\n        );\n        connection.set_value(\"access_key_id\".to_string(), \"test_key\".to_string());\n","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/databendlabs/databend/blob/288d84d76e20a2f8f7173bda9691eb6ece301aa9/src/query/service/src/history_tables/external.rs#L176-L212","documentation":"get_external_storage_connection in src/query/service/src/history_tables/external.rs builds connection info for a history table's external storage, but only S3-like, and Fs storage params are handled; any other StorageParams variant hits `unimplemented!(\"Not implemented for storage type: {:?}\")` and panics during init.","triggerScenarios":"Configuring history tables' external storage with a StorageParams type other than S3-style or Fs — e.g. Azure/GCS/OBS/HDFS-style storage params — so the catch-all `_` arm is reached at startup/init.","commonSituations":"A deployment reuses the main query storage config (set to Azure Blob or GCS) for history-table export, or a typo/misconfiguration yields an unexpected StorageParams variant; the node panics during initialization.","solutions":["Set the history-table external storage to S3-compatible or Fs storage in the config.","Inspect the panicked message's storage type to see which variant leaked in, and fix the [storage] config section accordingly.","If the target object store is Azure/GCS, use an S3-compatible endpoint or wait for/upgrade to a version supporting that type for history tables.","For maintainers: replace unimplemented! with a config ErrorCode and validate the storage type at config parse time."],"exampleFix":"// before\n_type = \"azure\"  # used as history storage\n// after (config)\n[history.storage]\ntype = \"s3\"\nbucket = \"history-bucket\"\n...","handlingStrategy":"validation","validationCode":"# pre-startup config check\nif history_storage_type not in (\"s3\", \"fs\"):\n    raise ConfigError(f\"history storage type '{history_storage_type}' is not supported (use s3 or fs)\")","typeGuard":"fn history_storage_supported(sp: &StorageParams) -> bool {\n    matches!(sp, StorageParams::S3(_) | StorageParams::Fs(_) | StorageParams::S3WithSimdZip(_))\n}","tryCatchPattern":"match get_external_storage_connection(&storage_params) {\n    Ok(info) => info,\n    Err(e) if e.to_string().contains(\"Not implemented for storage type\") => {\n        return Err(ErrorCode::InvalidConfig(\"history storage must be s3 or fs\"));\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Validate the [history]/storage config section at deploy time with a schema check.","Only use s3-compatible or fs backends for history tables.","Do not blindly reuse the main [storage] config for history tables unless it is s3/fs.","Smoke-test node startup after any storage config change."],"tags":["unimplemented","storage","config","history-tables"],"backgroundTag":"unsupported-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"}