{"record":{"id":"1ed5c296f6357d5b","repo":"astral-sh/uv","slug":"invalid-file-path-in-index-url-url","errorCode":null,"errorMessage":"Invalid file path in index URL: {url}","messagePattern":"Invalid file path in index URL: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/uv/src/commands/project/add.rs","lineNumber":682,"sourceCode":"        match &dependency_type {\n            DependencyType::Group(group) => {\n                toml.ensure_dependency_group(group)?;\n            }\n            DependencyType::Optional(extra) => {\n                toml.ensure_optional_dependency(extra)?;\n            }\n            _ => {}\n        }\n    }\n\n    // Validate any indexes that were provided on the command-line to ensure\n    // they point to existing non-empty directories when using path URLs.\n    let mut valid_indexes = Vec::with_capacity(indexes.len());\n    for index in indexes {\n        if let IndexUrl::Path(url) = &index.url {\n            let path = url\n                .to_file_path()\n                .map_err(|()| anyhow::anyhow!(\"Invalid file path in index URL: {url}\"))?;\n            if !path.is_dir() {\n                bail!(\"Directory not found for index: {url}\");\n            }\n            if fs_err::read_dir(&path)?.next().is_none() {\n                warn_user_once!(\"Index directory `{url}` is empty, skipping\");\n                continue;\n            }\n        }\n        valid_indexes.push(index);\n    }\n    let indexes = valid_indexes;\n\n    // Add any indexes that were provided on the command-line, in priority order.\n    if !raw {\n        let root_dir = match &target {\n            AddTarget::Script(script, _) => {\n                script.path.parent().expect(\"script path has no parent\")\n            }","sourceCodeStart":664,"sourceCodeEnd":700,"githubUrl":"https://github.com/astral-sh/uv/blob/f1a42680ff5272232d65748acf338b19778dde24/crates/uv/src/commands/project/add.rs#L664-L700","documentation":"Error \"Invalid file path in index URL: {url}\" thrown in astral-sh/uv.","triggerScenarios":"Thrown at crates/uv/src/commands/project/add.rs:682 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f1a42680ff5272232d65748acf338b19778dde24","analyzedAt":"2026-08-16T04:51:47.599Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}