{"record":{"id":"5f0d611efa02fc00","repo":"vectordotdev/vector","slug":"invalid-filename-unknown-extension","errorCode":null,"errorMessage":"Invalid filename {}, unknown extension","messagePattern":"Invalid filename (.+?), unknown extension","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/utils/features.rs","lineNumber":131,"sourceCode":"        .with_context(|| format!(\"failed to read {}\", filename.display()))?;\n\n    let config: FeatureConfig = match filename\n        .extension()\n        .and_then(OsStr::to_str)\n        .map(str::to_lowercase)\n        .as_deref()\n    {\n        None => bail!(\"Invalid filename {}, no extension\", filename.display()),\n        Some(\"json\") => serde_json::from_str(&config)?,\n        Some(\"toml\") => toml::from_str(&config)?,\n        Some(\"yaml\" | \"yml\") => {\n            let value: serde_yaml::Value = serde_yaml::from_str(&config)?;\n            if contains_yaml_merge_key(&value) {\n                bail!(UNSUPPORTED_YAML_MERGE_KEY);\n            }\n            serde_yaml::from_value(value)?\n        }\n        Some(_) => bail!(\"Invalid filename {}, unknown extension\", filename.display()),\n    };\n\n    let declared_features = CargoToml::load_from(&find_repo_root()?.join(\"Cargo.toml\"))?\n        .features\n        .into_keys()\n        .collect();\n\n    from_config(&config, &declared_features)\n}\n\nfn contains_yaml_merge_key(value: &serde_yaml::Value) -> bool {\n    match value {\n        serde_yaml::Value::Sequence(values) => values.iter().any(contains_yaml_merge_key),\n        serde_yaml::Value::Mapping(mapping) => mapping\n            .iter()\n            .any(|(key, value)| key.as_str() == Some(\"<<\") || contains_yaml_merge_key(value)),\n        serde_yaml::Value::Tagged(tagged) => contains_yaml_merge_key(&tagged.value),\n        _ => false,","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/vdev/src/utils/features.rs#L113-L149","documentation":"After picking a parser by extension, load_and_extract rejects any extension other than json, toml, yaml, or yml with this message. The tool has no deserializer registered for other formats, so files like .xml, .conf, or .cfg cannot be interpreted as a FeatureConfig.","triggerScenarios":"Calling load_and_extract with paths like \"config.xml\", \"features.ini\", or any extension outside {json, toml, yaml, yml}.","commonSituations":"Pointing the feature-extraction tool at a different tool's config format; a typo such as .yamle or .tml; batch-processing a directory that mixes in unrelated file types.","solutions":["Convert the config to one of the supported formats (YAML recommended) and use the matching extension","Fix the extension typo (.tml → .toml, .yamle → .yaml)","Filter the input file list to supported extensions before processing"],"exampleFix":"// before\nload_and_extract(Path::new(\"config/features.ini\"))?;\n// after\nload_and_extract(Path::new(\"config/features.toml\"))?;","handlingStrategy":"validation","validationCode":"const SUPPORTED: [&str; 4] = [\"json\", \"toml\", \"yaml\", \"yml\"];\nfn supported(p: &Path) -> bool {\n    p.extension().and_then(|e| e.to_str()).map(|e| SUPPORTED.contains(&e.to_lowercase().as_str())).unwrap_or(false)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Convert foreign formats (ini, xml) to YAML/TOML before feature extraction","Watch for extension typos in scripts (.tml, .yamle)","Restrict directory scans to *.json, *.toml, *.yaml, *.yml"],"tags":["rust","filesystem","filename","parsing"],"backgroundTag":"unsupported-config-value","analyzedSha":"bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}