dbt-labs/dbt-core · error · InstallError

destination path must be an absolute path

Error message

destination path must be an absolute path: {}

What it means

download_zst_driver_file asserts its destination argument is an absolute path: a relative path would break parent-directory creation and the atomic temp-file rename logic later in the function. The guard fires before any HTTP request is made.

Solutions

  1. Canonicalize or absolutize the destination before calling the downloader
  2. Build destination paths from an absolute install root
  3. Validate at the public API boundary with a real error rather than a debug_assert
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/dbt-adbc/src/install.rs:541 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/2897643d190dd69e. Report an issue: GitHub.

Appendix: source

Thrown at crates/dbt-adbc/src/install.rs:541

    destination: &Path,
    expected_sha256sum: Option<&str>,
) -> Result<(), InstallError> {
    debug_assert!(
        destination.is_absolute(),
        "destination path must be absolute"
    );
    let mut response = http_agent.get(url).call().map_err(InstallError::Http)?;

    // Generate a random file name and create an empty temporary file
    let tmp_path = {
        let tmp_name = tmpname(".", 15, ".download").map_err(InstallError::GetRandom)?;
        // ensure the destination exists and create it if necessary
        let parent = destination.parent().ok_or_else(|| {
            let message = format!(
                "destination path must be an absolute path: {}",
                destination.display()
            );
            let error = io::Error::new(io::ErrorKind::InvalidInput, message);
            InstallError::Io(error)
        })?;
        std::fs::create_dir_all(parent).map_err(|e| InstallError::CreateDir(e, parent.into()))?;
        // write the file in the same directory as the destination to ensure
        // the rename operation is atomic (happens on the same filesystem)
        parent.join(tmp_name)
    };
    let mut tmp = std::fs::File::create(&tmp_path)
        .map_err(|e| InstallError::CreateFIle(e, tmp_path.clone()))?;

    // Download and Zstandard decompression buffers
    const DECOMPRESSION_FACTOR: usize = 4;
    let mut zstd_insize_hint = zstd_safe::DCtx::in_size(); // ~200KB
    let mut download_buffer = Vec::with_capacity(zstd_insize_hint);
    let write_buffer_capacity = (DECOMPRESSION_FACTOR * download_buffer.capacity()).max(64 * 1024);
    let mut inner_write_buffer = ZstdWriteBuffer::with_fixed_capacity(write_buffer_capacity);
    let mut write_buffer = zstd_safe::OutBuffer::around(&mut inner_write_buffer);

View on GitHub (pinned to 0267ce9170)