pentaho/pentaho-kettle · error · InvocationTargetException

GetSQLProgressDialog.RuntimeError.UnableToGenerateSQL.Exception

GetSQLProgressDialog.RuntimeError.UnableToGenerateSQL.Exception

Error message

GetSQLProgressDialog.RuntimeError.UnableToGenerateSQL.Exception

What it means

GetSQLProgressDialog runs transMeta.getSQLStatements(monitor) on a background thread to build schema-creation SQL for a transformation. Any KettleException is wrapped in an InvocationTargetException with localized message GetSQLProgressDialog.RuntimeError.UnableToGenerateSQL.Exception.

Solutions

  1. Read the wrapped KettleException message to identify the failing step.
  2. Verify each step's database connection and target table settings.
  3. Select a supported database dialect for all steps before generating SQL.
  4. Run transformation verification first to catch metadata problems.

Example fix

// before
TableOutputMeta out = ...; out.setTableName(""); // empty table name breaks SQL generation
// after
out.setTableName( "target_table" ); out.setDatabaseMeta( dbMeta );
Defensive patterns

Strategy: validation

Validate before calling

for (StepMeta step : transMeta.getSteps()) {
  if (step.getStepMetaInterface() instanceof TableOutputMeta
      && ((TableOutputMeta) step.getStepMetaInterface()).getTableName().isEmpty()) {
    throw new IllegalStateException("TableOutput step '" + step.getName() + "' has no target table");
  }
}

Try / catch

try {
  new GetSQLProgressDialog(shell, transMeta, onlySelected).open();
} catch (Exception e) {
  log.error("SQL generation failed: ", e);
}

Prevention

When it happens

Trigger: Clicking the SQL button in Spoon for a transformation where step SQL generation fails: invalid or empty table names, missing database connections on table-output steps, or unsupported database features.

Common situations: Target database dialect unsupported by a step; table-output steps with empty table names; steps referencing removed database connections.

Understand the failure class

Background: "query failed", "%w: SQL error" — wrapped database query errors in Go libraries explained — this error's family across 3 libraries.

Related errors


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

Appendix: source

Thrown at ui/src/main/java/org/pentaho/di/ui/spoon/dialog/GetSQLProgressDialog.java:62

  /**
   * Creates a new dialog that will handle the wait while getting the SQL for a transformation...
   */
  public GetSQLProgressDialog( Shell shell, TransMeta transMeta ) {
    this.shell = shell;
    this.transMeta = transMeta;
  }

  public List<SQLStatement> open() {
    IRunnableWithProgress op = new IRunnableWithProgress() {
      public void run( IProgressMonitor monitor ) throws InvocationTargetException, InterruptedException {
        // This is running in a new process: copy some KettleVariables info
        // LocalVariables.getInstance().createKettleVariables(Thread.currentThread(), parentThread, true);
        // --> don't set variables if not running in different thread --> pmd.run(true,true, op);

        try {
          stats = transMeta.getSQLStatements( new ProgressMonitorAdapter( monitor ) );
        } catch ( KettleException e ) {
          throw new InvocationTargetException( e, BaseMessages.getString(
            PKG, "GetSQLProgressDialog.RuntimeError.UnableToGenerateSQL.Exception", e.getMessage() ) );
        }
      }
    };

    try {
      ProgressMonitorDialog pmd = new ProgressMonitorDialog( shell );
      pmd.run( false, false, op );
    } catch ( InvocationTargetException e ) {
      new ErrorDialog( shell, BaseMessages.getString( PKG, "GetSQLProgressDialog.Dialog.UnableToGenerateSQL.Title" ),
        BaseMessages.getString( PKG, "GetSQLProgressDialog.Dialog.UnableToGenerateSQL.Message" ), e );
      stats = null;
    } catch ( InterruptedException e ) {
      new ErrorDialog( shell, BaseMessages.getString( PKG, "GetSQLProgressDialog.Dialog.UnableToGenerateSQL.Title" ),
        BaseMessages.getString( PKG, "GetSQLProgressDialog.Dialog.UnableToGenerateSQL.Message" ), e );
      stats = null;
    }

View on GitHub (pinned to f3058517a1)