{"record":{"id":"61faab83416fd814","repo":"nautechsystems/nautilus_trader","slug":"invalid-abfs-uri-missing-container","errorCode":null,"errorMessage":"Invalid ABFS URI: missing container","messagePattern":"Invalid ABFS URI: missing container","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/persistence/src/parquet.rs","lineNumber":903,"sourceCode":"fn create_abfs_store(\n    uri: &str,\n    storage_options: Option<AHashMap<String, String>>,\n) -> anyhow::Result<(Arc<dyn ObjectStore>, String, String)> {\n    let (url, path) = parse_url_and_path(uri)?;\n    let host = extract_host(&url, \"Invalid ABFS URI: missing host\")?;\n\n    // Extract account from host (account.dfs.core.windows.net)\n    let account = host\n        .split('.')\n        .next()\n        .ok_or_else(|| anyhow::anyhow!(\"Invalid ABFS URI: cannot extract account from host\"))?;\n\n    // Extract container from username part\n    let container = url\n        .username()\n        .split('@')\n        .next()\n        .ok_or_else(|| anyhow::anyhow!(\"Invalid ABFS URI: missing container\"))?;\n\n    let mut builder = object_store::azure::MicrosoftAzureBuilder::new()\n        .with_account(account)\n        .with_container_name(container);\n\n    // Apply storage options if provided (same as Azure store)\n    if let Some(options) = storage_options {\n        for (key, value) in options {\n            match key.as_str() {\n                \"account_name\" => {\n                    builder = builder.with_account(&value);\n                }\n                \"account_key\" => {\n                    builder = builder.with_access_key(&value);\n                }\n                \"sas_token\" => {\n                    // Parse SAS token as query string parameters\n                    let query_pairs: Vec<(String, String)> = value","sourceCodeStart":885,"sourceCodeEnd":921,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/persistence/src/parquet.rs#L885-L921","documentation":"The ABFS store builder extracts the container name from the URI username component (the part before '@' in <container>@<account>...). If the username is missing/empty, this error is thrown because an Azure container is required to construct the store.","triggerScenarios":"Passing an abfs:// or abfss:// URI without the container@account prefix, e.g. abfss://account.dfs.core.windows.net/path.","commonSituations":"Copying a blob-style Azure URL (account.blob.core.windows.net) instead of the ADLS Gen2 style; building URIs from config with an unset container field.","solutions":["Include the container in the URI: abfs[s]://<container>@<account>.dfs.core.windows.net/<path>","Check storage options/config so the container value is set before building the URI","Validate the URI shape before calling create_object_store_location_from_path","Alternatively pass the container via the builder options if the code path supports it"],"exampleFix":"// before\nlet path = \"abfss://mystorage.dfs.core.windows.net/data\"; // no container@\n// after\nlet path = \"abfss://mydata@mystorage.dfs.core.windows.net/data\";","handlingStrategy":"validation","validationCode":"let url = url::Url::parse(path)?;\nanyhow::ensure!(!url.username().is_empty(), \"ABFS URI must include container: abfs://<container>@<account>.dfs.core.windows.net/...\");","typeGuard":"fn has_abfs_container(s: &str) -> bool {\n    url::Url::parse(s).map_or(false, |u| !u.username().is_empty())\n}","tryCatchPattern":"let store = create_object_store_location_from_path(path, opts)\n    .map_err(|e| anyhow::anyhow!(\"ABFS path '{path}' invalid: {e}\"))?;","preventionTips":["Never omit the container@ segment in abfs:// URIs","Ensure the container config field is set before constructing the path","Distinguish blob (account.blob.core.windows.net) from ADLS Gen2 (container@account.dfs.core.windows.net) URL styles"],"tags":["azure","abfs","url","config"],"backgroundTag":"missing-required-argument","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}