pentaho/pentaho-kettle · error · KettleDatabaseException
Couldn't get row from result set
Error message
Couldn't get row from result set
What it means
Generic KettleDatabaseException wrapper thrown by Database.getRow(ResultSet, RowMetaInterface) for any Exception during row value extraction (getValue/KettleValueException, SQLException on rs.getObject, etc.). It is the catch-all for converting the current result set row into an Object[].
Solutions
- Read the chained cause to identify the failing column and conversion
- Check character encoding/database session encoding for garbled strings
- Fetch in smaller batches / re-execute if the connection dropped mid-fetch
- Enable lazy conversion off/on to bypass lazy-decoding problems, and upgrade the driver
Example fix
// before
Object[] row = db.getRow(rs, rowMeta);
// after
try {
Object[] row = db.getRow(rs, rowMeta);
} catch (KettleDatabaseException e) {
Throwable root = ExceptionUtils.getRootCauseException(e);
logError("Row fetch failed: " + root.getMessage());
throw e; // or skip the row
} Defensive patterns
Strategy: try-catch
Validate before calling
// validate expected column types before reading
ResultSetMetaData md = rs.getMetaData();
for (int i = 1; i <= md.getColumnCount(); i++) {
// confirm type maps to expected Kettle type
} Type guard
null
Try / catch
try {
data = db.getRow(rs, rowMeta);
} catch (KettleDatabaseException e) {
logError("Row read failed: " + ExceptionUtils.getRootCauseMessage(e));
// skip or retry depending on cause
} Prevention
- Align database and JVM character encodings
- Check date/numeric ranges against column definitions
- Batch fetches to limit exposure to mid-stream drops
- Log the chained cause to identify the failing column
When it happens
Trigger: Any failure while reading the current row: rs.getObject/getXXX throws SQLException, a column value can't be converted to the mapped Kettle type (KettleValueException), lazy conversion decode fails, or numeric/date conversion errors.
Common situations: Corrupt or truncated column values; charset/encoding mismatches on string columns; date/timestamp values out of supported range; driver errors mid-stream on large result sets; network interruption during fetch.
Understand the failure class
Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.
Related errors
- Error getting row information from database:
- Unable to retrieve auto-increment of combi insert key : +…
- AccessInputMeta.Exception.ErrorSavingToRepository
- An error occurred executing SQL:
- An error occurred executing SQL:
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/f155e48e8c16155a.
Report an issue: GitHub.
Appendix: source
Thrown at core/src/main/java/org/pentaho/di/core/database/Database.java:3035
// when multiple Database objects share the same connection and access ResultSets concurrently
synchronized ( connection ) {
int nrcols = rowInfo.size();
Object[] data = RowDataUtil.allocateRowData( nrcols );
if ( rs.next() ) {
for ( int i = 0; i < nrcols; i++ ) {
ValueMetaInterface val = rowInfo.getValueMeta( i );
data[ i ] = databaseMeta.getValueFromResultSet( rs, val, i );
}
} else {
data = null;
}
return data;
}
} catch ( Exception ex ) {
throw new KettleDatabaseException( "Couldn't get row from result set", ex );
} finally {
if ( log.isGatheringMetrics() ) {
long time = System.currentTimeMillis() - startTime;
log.snap( Metrics.METRIC_DATABASE_GET_ROW_SUM_TIME, databaseMeta.getName(), time );
log.snap( Metrics.METRIC_DATABASE_GET_ROW_MIN_TIME, databaseMeta.getName(), time );
log.snap( Metrics.METRIC_DATABASE_GET_ROW_MAX_TIME, databaseMeta.getName(), time );
log.snap( Metrics.METRIC_DATABASE_GET_ROW_COUNT, databaseMeta.getName() );
}
}
}
public void printSQLException( SQLException ex ) {
log.logError( "==> SQLException: " );
while ( ex != null ) {
log.logError( "Message: " + ex.getMessage() );
log.logError( "SQLState: " + ex.getSQLState() );
log.logError( "ErrorCode: " + ex.getErrorCode() );
ex = ex.getNextException();View on GitHub (pinned to f3058517a1)