pentaho/pentaho-kettle · error · InvocationTargetException
Couldn't find any rows because of an error :
Error message
Couldn't find any rows because of an error :
What it means
GetPreviewTableProgressDialog runs db.getFirstRows(tableName, limit, monitor) in a background thread to preview a table's rows. If a KettleException is thrown while querying, it is wrapped in an InvocationTargetException with the message 'Couldn't find any rows because of an error : ' plus the exception details.
Solutions
- Inspect the cause of the InvocationTargetException for the underlying SQL error and correct the table name/schema.
- Verify the table still exists and the connected user has SELECT privileges on it.
- Reconnect (test the DatabaseMeta connection) and retry the preview.
- If the preview consistently fails with large tables, reduce the preview row limit.
Example fix
// before
rows = db.getFirstRows( tableName, limit, new ProgressMonitorAdapter( monitor ) );
// after
if ( db.checkTableExists( tableName ) ) {
rows = db.getFirstRows( tableName, limit, new ProgressMonitorAdapter( monitor ) );
} Defensive patterns
Strategy: try-catch
Validate before calling
// confirm table exists before preview Database db = new Database( loggingObject, dbMeta ); db.connect(); boolean exists = db.checkTableExists( tableName ); db.disconnect();
Try / catch
try {
rows = new GetPreviewTableProgressDialog( shell, loggingObject, dbMeta, tableName ).open();
} catch ( InvocationTargetException e ) {
logError( "Preview failed: " + e.getCause(), e.getCause() );
} Prevention
- Verify the table name/schema exists before previewing.
- Confirm the connected user has SELECT privileges.
- Refresh the connection if it may have timed out.
When it happens
Trigger: Opening the table preview dialog when the SQL select against the table fails: bad table name, dropped table, connection loss, or driver-level SQL error inside getFirstRows().
Common situations: Previewing a table after it was renamed/dropped by another user; previewing tables in a schema the connected user cannot read; network interruption during preview in Spoon's 'Preview' / 'Browse tables' feature.
Understand the failure class
Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.
Related errors
- An error occurred executing SQL:
- Couldn't execute SQL:
- Couldn't get a result because of an error :
- Couldn't prepare statement:
- Couldn't prepare statement :
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/832195ce1bb3ee77.
Report an issue: GitHub.
Appendix: source
Thrown at ui/src/main/java/org/pentaho/di/ui/core/database/dialog/GetPreviewTableProgressDialog.java:77
this.tableName = dbInfo.getQuotedSchemaTableCombination( schemaName, tableName );
this.limit = limit;
}
public List<Object[]> open() {
IRunnableWithProgress op = new IRunnableWithProgress() {
public void run( IProgressMonitor monitor ) throws InvocationTargetException, InterruptedException {
db = new Database( Spoon.loggingObject, dbMeta );
try {
db.connect();
if ( limit > 0 ) {
db.setQueryLimit( limit );
}
rows = db.getFirstRows( tableName, limit, new ProgressMonitorAdapter( monitor ) );
rowMeta = db.getReturnRowMeta();
} catch ( KettleException e ) {
throw new InvocationTargetException( e, "Couldn't find any rows because of an error :" + e.toString() );
} finally {
db.close();
}
}
};
try {
final ProgressMonitorDialog pmd = new ProgressMonitorDialog( shell );
// Run something in the background to cancel active database queries, forecably if needed!
Runnable run = new Runnable() {
public void run() {
IProgressMonitor monitor = pmd.getProgressMonitor();
while ( pmd.getShell() == null || ( !pmd.getShell().isDisposed() && !monitor.isCanceled() ) ) {
try {
Thread.sleep( 100 );
} catch ( InterruptedException e ) {
// Ignore
}View on GitHub (pinned to f3058517a1)