dbt-labs/dbt-core · error · anyhow

: missing `[project]` table

Error message

{}: missing `[project]` table

What it means

pyproject parsing for the python-packaging Spec failed because the pyproject.toml in the resolved directory has no top-level [project] table — the name/version/metadata the packer and publisher rely on cannot be read. The message names the offending file path.

Solutions

  1. Add a [project] table with at least name and version to the referenced pyproject.toml
  2. Point discover/parse at the directory that contains the correct pyproject.toml
  3. Confirm the file wasn't truncated or replaced by a cargo-only manifest
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/dbt-ci/src/pyproject.rs:73 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of dbt-labs/dbt-core@0267ce9170 (2026-09-07). Data as JSON: /api/errors/7ac07a98a3a471b6. Report an issue: GitHub.

Appendix: source

Thrown at crates/dbt-ci/src/pyproject.rs:73

    let dir = if dir.is_absolute() {
        dir.to_path_buf()
    } else {
        cargo_workspace_root().join(dir)
    };
    parse(dir)
}

fn parse(pyproject_dir: PathBuf) -> Result<Spec> {
    let pp_path = pyproject_dir.join("pyproject.toml");
    let text = fs::read_to_string(&pp_path)
        .with_context(|| format!("failed to read {}", pp_path.display()))?;
    let doc: DocumentMut = text
        .parse()
        .with_context(|| format!("failed to parse {}", pp_path.display()))?;

    let project = doc
        .get("project")
        .ok_or_else(|| anyhow!("{}: missing `[project]` table", pp_path.display()))?;

    let wheel_name = project
        .get("name")
        .and_then(|v| v.as_str())
        .ok_or_else(|| anyhow!("{}: missing `[project].name`", pp_path.display()))?
        .to_string();

    let summary = project
        .get("description")
        .and_then(|v| v.as_str())
        .map(str::to_string);

    let requires_python = project
        .get("requires-python")
        .and_then(|v| v.as_str())
        .map(str::to_string);

    let dependencies = string_array(project, "dependencies");

View on GitHub (pinned to 0267ce9170)