astral-sh/uv · error

Project root is not a valid file URL

Error message

Project root is not a valid file URL

What it means

Error "Project root is not a valid file URL" thrown in astral-sh/uv.

Source

Thrown at crates/uv/src/commands/project/upgrade.rs:392

            project.workspace(),
            &groups,
            workspace_python,
            &client_builder,
            python_preference,
            python_downloads,
            &install_mirrors,
            ProjectEnvironmentPolicy::Optional,
            Some(false),
            &cache,
            printer,
        )
        .await?
        .into_interpreter()
    };

    let state = UniversalState::default();
    let distribution_id = DisplaySafeUrl::from_file_path(project.project_root())
        .map_err(|()| anyhow!("Project root is not a valid file URL"))?
        .distribution_id();
    state.index().distributions().done(
        distribution_id,
        Arc::new(MetadataResponse::Found(ArchiveMetadata::from(metadata))),
    );

    let result = match Box::pin(
        LockOperation::new(
            LockMode::DryRun(&interpreter),
            &settings,
            &client_builder,
            &state,
            Box::new(DefaultResolveLogger),
            &concurrency,
            &cache,
            workspace_cache,
            printer,
            preview,

View on GitHub (pinned to f1a42680ff)

When it happens

Trigger: Thrown at crates/uv/src/commands/project/upgrade.rs:392 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of astral-sh/uv@f1a42680ff (2026-08-16). Data as JSON: /api/errors/6f8f50bcfe3730b1. Report an issue: GitHub.