pentaho/pentaho-kettle · error · KettleException

Error while executing sqlldr

Error message

Error while executing sqlldr

What it means

Any Exception raised inside the stream-load finalize block (waitFor, checkExitVal, closing of the process interaction) is rethrown by processRow as 'Error while executing sqlldr' with the original exception attached as cause. It is a generic wrapper; the cause carries the real problem (non-zero sqlldr exit, interruption, I/O failure).

Solutions

  1. Read the cause chain in the Pentaho log — it points at the actual sqlldr failure (exit code, interrupted thread)
  2. Check the sqlldr .log/.bad files for rejected rows and fix data or schema accordingly
  3. Validate connection settings (user/password/SID) — failed logins surface here as non-zero exit codes
  4. If the transformation was intentionally stopped, treat this as a consequence of interruption rather than a bug

Example fix

// before
throw new KettleException( "Error while executing sqlldr", ex );
// after
// after fixing the cause, e.g. valid credentials:
// meta.getDatabaseMeta().setUsername( "correct_user" );
Defensive patterns

Strategy: try-catch

Try / catch

try {
  step.processRow( smi, sdi );
} catch ( KettleException e ) {
  Throwable cause = e.getCause();
  if ( cause instanceof InterruptedException ) {
    // transformation was stopped
  } else if ( cause instanceof KettleException ) {
    // sqlldr exit code problem — inspect sqlldr log
  }
}

Prevention

When it happens

Trigger: During the 'wait for database stream' finalize: sqlldrProcess.waitFor() interrupted, or checkExitVal(exitVal) throws for a non-success exit code; the catch wraps them into this KettleException.

Common situations: sqlldr exiting with error/warning codes due to bad data or credentials; thread interruption on transformation stop; underlying IOException while the process terminates.

Understand the failure class

Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.

Related errors


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

Appendix: source

Thrown at plugins/oracle-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/orabulkloader/OraBulkLoader.java:537

          if ( OraBulkLoaderMeta.METHOD_AUTO_END.equals( loadMethod ) ) {
            // if this is the first line, we do not need to execute loader
            // control file may not exists
            if ( !first ) {
              execute( meta, true );
              sqlldrProcess = null;
            }
          } else if ( OraBulkLoaderMeta.METHOD_AUTO_CONCURRENT.equals( meta.getLoadMethod() ) ) {
            try {
              if ( sqlldrProcess != null ) {
                int exitVal = sqlldrProcess.waitFor();
                sqlldrProcess = null;
                logBasic( BaseMessages.getString( PKG, "OraBulkLoader.Log.ExitValueSqlldr", "" + exitVal ) );
                checkExitVal( exitVal );
              } else if ( !first ) {
                throw new KettleException( "Internal error: no sqlldr process running" );
              }
            } catch ( Exception ex ) {
              throw new KettleException( "Error while executing sqlldr", ex );
            }
          }
        }
        return false;
      }

      if ( !preview ) {
        if ( first ) {
          first = false;

          String recTerm = Const.CR;
          if ( !Utils.isEmpty( meta.getAltRecordTerm() ) ) {
            recTerm = substituteRecordTerminator( meta.getAltRecordTerm() );
          }

          createControlFile( environmentSubstitute( meta.getControlFile() ), r, meta );
          output = new OraBulkDataOutput( meta, recTerm );

View on GitHub (pinned to f3058517a1)