{"record":{"id":"f2fc3e42a3c500e2","repo":"dbt-labs/dbt-core","slug":"file-name-can-t-be-empty","errorCode":null,"errorMessage":"File name can't be empty","messagePattern":"File name can't be empty","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-parser/src/resolve/resolve_properties.rs","lineNumber":671,"sourceCode":"            init_project_config(\n                &package.dbt_project.semantic_models,\n                (),\n                Some(package.dbt_project.name.as_str()),\n                disallow_plus_prefix_from_flags(root_package.dbt_project.flags.as_ref()),\n                adapter_type,\n            )\n        },\n        adapter_type,\n    )?;\n\n    for dbt_asset in package.dbt_properties.iter().dedup() {\n        token.check_cancellation()?;\n        let absolute_path = dbt_asset.base_path.join(&dbt_asset.path);\n        let display_path = dbt_asset.to_display_path(&arg.io.in_dir);\n        let asset_name = dbt_asset\n            .path\n            .file_stem()\n            .expect(\"File name can't be empty\")\n            .to_string_lossy();\n        let span = create_debug_span(AssetParsed::new_with_phase_from_context(\n            package.dbt_project.name.clone(),\n            asset_name.to_string(),\n            dbt_asset.path.display().to_string(),\n            display_path.display().to_string(),\n            None,\n        ));\n\n        let dependency_package_name = if package.dbt_project.name != root_package_name {\n            Some(package.dbt_project.name.as_str())\n        } else {\n            None\n        };\n\n        {\n            let _guard = span.enter();\n            let input = try_read_yml_to_str(&absolute_path)?;","sourceCodeStart":653,"sourceCodeEnd":689,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-parser/src/resolve/resolve_properties.rs#L653-L689","documentation":"Panic \"File name can't be empty\" is raised in resolve_minimal_properties when `dbt_asset.path.file_stem()` returns None. file_stem returns None only for paths that terminate in `..` or are empty, so this guards the assumption that every asset being resolved has a real file name.","triggerScenarios":"An asset whose path is empty or ends with a parent-directory component (e.g., path=\"..\" or \"\") reaches resolve_minimal_properties via the asset walk.","commonSituations":"A malformed glob or symlink/`..` entry slipping into the property-file walk; passing an in_dir whose traversal yields a root-only path; path constructed by joining an empty string.","solutions":["Skip assets whose path.file_stem() is None (continue) instead of panicking.","Validate/filter asset paths during the directory walk to reject empty or `..`-terminated paths.","Check how dbt_asset.path is constructed (base_path.join) for accidental empty components."],"exampleFix":"// before\nlet asset_name = dbt_asset.path.file_stem().expect(\"File name can't be empty\").to_string_lossy();\n// after\nlet asset_name = match dbt_asset.path.file_stem() {\n    Some(stem) => stem.to_string_lossy(),\n    None => continue,\n};","handlingStrategy":"validation","validationCode":"// pre-check asset paths before resolution\nfor asset in &assets {\n    assert!(!asset.path.as_os_str().is_empty() && asset.path.file_stem().is_some(), \"bad asset path {:?}\", asset.path);\n}","typeGuard":"fn has_file_stem(p: &Path) -> bool { p.file_stem().is_some() }","tryCatchPattern":null,"preventionTips":["Filter out empty and `..`-terminated paths during the directory walk","Sanitize base_path.join inputs","Use skip-with-warning for malformed asset paths"],"tags":["rust","filesystem","panic","path"],"backgroundTag":"file-not-found","analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}