dbt-labs/dbt-core · error

Table.print_table: I/O error

Error message

Table.print_table: I/O error: {e}

What it means

Wrapper in Table::print_table: writing the rendered table to the caller-supplied io::Write target (or stdout) failed with an I/O error, which is mapped into this message with the original error embedded as {e}. Typical causes are a closed pipe or broken stdout when output is piped.

Solutions

  1. Check the embedded {e} for the OS-level I/O cause
  2. Ensure the output stream/pipe is still open when print_table runs
  3. Use print_table_to_string when no live writer is available
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at crates/dbt-agate/src/table.rs:619 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/9d9a3cd092a36091. Report an issue: GitHub.

Appendix: source

Thrown at crates/dbt-agate/src/table.rs:619

    }

    /// Get the row names as the Arrow array backing them.
    pub(crate) fn row_names_array(&self) -> Option<&Arc<StringViewArray>> {
        self.repr.row_names.as_ref()
    }

    // Rest of API ------------------------------------------------------------

    pub fn print_table(
        &self,
        max_rows: usize,
        max_columns: usize,
        max_column_width: usize,
        output: Option<&mut dyn io::Write>,
    ) -> Result<(), Error> {
        crate::print_table::print_table(self, max_rows, max_columns, max_column_width, output)
            .map_err(|e| {
                Error::new(
                    ErrorKind::InvalidOperation,
                    format!("Table.print_table: I/O error: {e}"),
                )
            })
    }

    pub fn print_table_to_string(
        &self,
        max_rows: usize,
        max_columns: usize,
        max_column_width: usize,
    ) -> Result<String, Error> {
        let mut output = Vec::new();
        self.print_table(max_rows, max_columns, max_column_width, Some(&mut output))?;
        // SAFETY: print_table() only writes valid UTF-8, it's not necessary to validate again
        let s = unsafe { String::from_utf8_unchecked(output) };
        Ok(s)
    }

View on GitHub (pinned to 0267ce9170)