{"record":{"id":"9d9a3cd092a36091","repo":"dbt-labs/dbt-core","slug":"table-print-table-i-o-error-e","errorCode":null,"errorMessage":"Table.print_table: I/O error: {e}","messagePattern":"Table\\.print_table: I/O error: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-agate/src/table.rs","lineNumber":619,"sourceCode":"    }\n\n    /// Get the row names as the Arrow array backing them.\n    pub(crate) fn row_names_array(&self) -> Option<&Arc<StringViewArray>> {\n        self.repr.row_names.as_ref()\n    }\n\n    // Rest of API ------------------------------------------------------------\n\n    pub fn print_table(\n        &self,\n        max_rows: usize,\n        max_columns: usize,\n        max_column_width: usize,\n        output: Option<&mut dyn io::Write>,\n    ) -> Result<(), Error> {\n        crate::print_table::print_table(self, max_rows, max_columns, max_column_width, output)\n            .map_err(|e| {\n                Error::new(\n                    ErrorKind::InvalidOperation,\n                    format!(\"Table.print_table: I/O error: {e}\"),\n                )\n            })\n    }\n\n    pub fn print_table_to_string(\n        &self,\n        max_rows: usize,\n        max_columns: usize,\n        max_column_width: usize,\n    ) -> Result<String, Error> {\n        let mut output = Vec::new();\n        self.print_table(max_rows, max_columns, max_column_width, Some(&mut output))?;\n        // SAFETY: print_table() only writes valid UTF-8, it's not necessary to validate again\n        let s = unsafe { String::from_utf8_unchecked(output) };\n        Ok(s)\n    }","sourceCodeStart":601,"sourceCodeEnd":637,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-agate/src/table.rs#L601-L637","documentation":"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.","triggerScenarios":"Thrown at crates/dbt-agate/src/table.rs:619 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the embedded {e} for the OS-level I/O cause","Ensure the output stream/pipe is still open when print_table runs","Use print_table_to_string when no live writer is available"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}