{"record":{"id":"39beb6f38c02797f","repo":"databendlabs/databend","slug":"err-to-string","errorCode":null,"errorMessage":"err.to_string()","messagePattern":"err\\.to_string\\(\\)","errorType":"exception","errorClass":"InvalidInput","httpStatus":null,"severity":"error","filePath":"src/query/sql/src/planner/binder/location.rs","lineNumber":454,"sourceCode":"                    \"disable_list_batch should be `TRUE` or `FALSE`, parse error with: {:?}\",\n                    e,\n                ),\n            )\n        })?;\n    let user_name = l.connection.get(\"user_name\").cloned().unwrap_or_default();\n\n    let sp = StorageParams::Webhdfs(StorageWebhdfsConfig {\n        endpoint_url,\n        root,\n        delegation,\n        disable_list_batch,\n        user_name,\n        network_config: None,\n    });\n\n    l.connection\n        .check()\n        .map_err(|err| Error::new(ErrorKind::InvalidInput, err.to_string()))?;\n\n    Ok(sp)\n}\n\n/// Huggingface uri looks like `hf://opendal/huggingface-testdata/path/to/file`.\n///\n/// We need to parse `huggingface-testdata` from the root.\nfn parse_huggingface_params(l: &mut UriLocation, root: String) -> Result<StorageParams> {\n    let (repo_name, root) = root\n        .trim_start_matches('/')\n        .split_once('/')\n        .ok_or_else(|| {\n            Error::new(\n                ErrorKind::InvalidInput,\n                \"input uri is not a valid huggingface uri\",\n            )\n        })?;\n","sourceCodeStart":436,"sourceCodeEnd":472,"githubUrl":"https://github.com/databendlabs/databend/blob/288d84d76e20a2f8f7173bda9691eb6ece301aa9/src/query/sql/src/planner/binder/location.rs#L436-L472","documentation":"After assembling the WebHDFS StorageParams, parse_webhdfs_params calls UriLocation::check() and converts any failure into InvalidInput carrying the inner error's text. It indicates one or more remaining connection options are invalid for the webhdfs scheme.","triggerScenarios":"A webhdfs:// location whose CONNECTION options include unrecognized keys or invalid values detected by UriLocation::check() (e.g. misspelled 'user_name', unsupported extras).","commonSituations":"Reusing S3 or HDFS option sets with webhdfs; typos in supported options (https, disable_list_batch, user_name); stale stage definitions after option renames.","solutions":["Inspect the embedded inner error message to find the offending option and correct it.","Restrict options to those supported for webhdfs: user_name, https, disable_list_batch.","Remove options that belong to other storage schemes."],"exampleFix":"// before\nCREATE STAGE s URL = 'webhdfs://nn:9870/data/' CONNECTION = (usr_name = 'hdfs');\n// after\nCREATE STAGE s URL = 'webhdfs://nn:9870/data/' CONNECTION = (user_name = 'hdfs');","handlingStrategy":"try-catch","validationCode":"const WEBHDFS_OPTS: [&str; 3] = [\"user_name\", \"https\", \"disable_list_batch\"];\nassert!(conn_opts.keys().all(|k| WEBHDFS_OPTS.contains(&k.as_str())));","typeGuard":null,"tryCatchPattern":"// Rust\nif let Err(e) = parse_storage_params_from_uri(&mut loc, usage).await {\n    eprintln!(\"webhdfs connection options rejected: {e}\");\n    return Err(e);\n}","preventionTips":["Restrict webhdfs stages to the documented option set.","Verify option names against docs (user_name, https, disable_list_batch).","Remove options copied from other storage schemes."],"tags":["storage","webhdfs","connection-options","validation"],"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"}