pentaho/pentaho-kettle · warning · InvocationTargetException

This operation was cancelled!

Error message

This operation was cancelled!

What it means

GetTableSizeProgressDialog computes a table size with a SELECT COUNT(*) query built by getSelectCountStatement. After the count returns, if the progress monitor was cancelled it throws an InvocationTargetException wrapping 'This operation was cancelled!' so the dialog reports the operation as cancelled instead of displaying a partial/stale size.

Solutions

  1. This is intentional user-cancellation feedback; catch the InvocationTargetException and exit quietly.
  2. For huge tables, avoid COUNT(*) sizing (use catalog statistics/estimated row counts) so the operation finishes before the user cancels.
  3. If cancellation fires unexpectedly, verify no shared/cancelled IProgressMonitor is passed to the dialog.

Example fix

// before
size = new GetTableSizeProgressDialog( shell, dbMeta, tableName ).openSize();
// after
try {
  size = new GetTableSizeProgressDialog( shell, dbMeta, tableName ).openSize();
} catch ( InvocationTargetException ite ) {
  logLow( "Table size calculation cancelled by user" );
}
Defensive patterns

Strategy: try-catch

Try / catch

try {
  size = new GetTableSizeProgressDialog( shell, dbMeta, tableName ).openSize();
} catch ( InvocationTargetException e ) {
  if ( e.getCause() != null && "This operation was cancelled!".equals( e.getCause().getMessage() ) ) {
    return; // user cancelled
  }
  logError( "Size calc failed", e );
}

Prevention

When it happens

Trigger: Pressing Cancel in the progress dialog while the table-size calculation runs; monitor.isCanceled() true after db.getOneRow(sql) completes.

Common situations: Cancelling the size calculation on very large tables where COUNT(*) takes a long time (e.g. big fact tables in a warehouse).

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/1134eddea42433be. Report an issue: GitHub.

Appendix: source

Thrown at ui/src/main/java/org/pentaho/di/ui/core/database/dialog/GetTableSizeProgressDialog.java:73

  public GetTableSizeProgressDialog( Shell shell, DatabaseMeta dbInfo, String tableName, String schemaName ) {
    this.shell = shell;
    this.dbMeta = dbInfo;
    this.tableName = dbInfo.getQuotedSchemaTableCombination( schemaName, tableName );
  }

  public Long open() {
    IRunnableWithProgress op = new IRunnableWithProgress() {
      public void run( IProgressMonitor monitor ) throws InvocationTargetException, InterruptedException {
        db = new Database( Spoon.loggingObject, dbMeta );
        try {
          db.connect();

          String sql = dbMeta.getDatabaseInterface().getSelectCountStatement( tableName );
          RowMetaAndData row = db.getOneRow( sql );
          size = row.getRowMeta().getInteger( row.getData(), 0 );

          if ( monitor.isCanceled() ) {
            throw new InvocationTargetException( new Exception( "This operation was cancelled!" ) );
          }

        } catch ( KettleException e ) {
          throw new InvocationTargetException( e, "Couldn't get a result 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 {

View on GitHub (pinned to f3058517a1)