dbt-labs/dbt-core · error · anyhow::Error

GET {url}

Error message

GET {url}

What it means

In sdist building, download() fetches a remote resource with retries on transient failures; once retries are exhausted, the reqwest error is wrapped with the context "GET {url}" and propagated to build_release_sdist. The context names the exact URL that could not be fetched.

Source

Thrown at crates/dbt-ci/src/sdist.rs:233

                    eprintln!(
                        "warning: GET {url} got {status}; retrying in {}ms",
                        delay.as_millis()
                    );
                    tokio::time::sleep(delay).await;
                    continue;
                }
                bail!("GET {url} failed: {status}");
            }
            Err(e) if is_transient(&e) && attempt < max_attempts => {
                let delay = backoff(attempt);
                eprintln!(
                    "warning: GET {url} failed: {e}; retrying in {}ms",
                    delay.as_millis()
                );
                tokio::time::sleep(delay).await;
                continue;
            }
            Err(e) => return Err(anyhow::Error::new(e).context(format!("GET {url}"))),
        }
    }
}

/// Minimal pyproject wiring up the embedded backend; rich metadata lives in PKG-INFO.
fn render_sdist_pyproject(spec: &Spec, version_pep440: &str) -> String {
    let mut out = String::new();
    out.push_str("[build-system]\n");
    out.push_str("requires = [\"packaging>=24\"]\n");
    let _ = writeln!(out, "build-backend = {SDIST_BACKEND_PKG:?}");
    out.push_str("backend-path = [\".\"]\n\n");
    out.push_str("[project]\n");
    // `{:?}` yields quoted, escaped TOML basic strings.
    let _ = writeln!(out, "name = {:?}", spec.wheel_name);
    let _ = writeln!(out, "version = {version_pep440:?}");
    if let Some(rp) = &spec.requires_python {
        let _ = writeln!(out, "requires-python = {rp:?}");
    }

View on GitHub (pinned to 0267ce9170)

Solutions

  1. Verify the URL is reachable (curl it from the same environment).
  2. Check proxy/firewall settings on the build machine.
  3. Retry the build; the code already retries with backoff, so persistent failure means a hard problem.
  4. Fix or update the pinned URL / spec pointing at the vanished resource.

Example fix

// before
download("https://files.example.com/pkg-1.0.tar.gz")
// after
// verify the URL, or point to a mirror
download("https://mirror.example.com/pkg-1.0.tar.gz")
Defensive patterns

Strategy: retry

Validate before calling

curl -fsSI "$DOWNLOAD_URL" > /dev/null && echo ok || echo 'URL unreachable before build'

Try / catch

match build_release_sdist(...).await {
    Err(e) if e.to_string().contains("GET ") => {
        // check URL reachability/proxy, then retry or fail with clear message
    }
    other => other?,
}

Prevention

When it happens

Trigger: build_release_sdist calls download for a remote artifact/dependency and every retry attempt of the GET fails (connection refused, timeout, TLS failure, 404 raised as client error).

Common situations: CI runner behind a proxy or firewall, wrong/pinned URL that no longer exists, upstream artifact host outage, offline release build.

Understand the failure class

Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.

Related errors


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