{"record":{"id":"5e00278569ffea31","repo":"pentaho/pentaho-kettle","slug":"sqlldr-returned-warning","errorCode":null,"errorMessage":"sqlldr returned warning","messagePattern":"sqlldr returned warning","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/oracle-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/orabulkloader/OraBulkLoader.java","lineNumber":459,"sourceCode":"\n    if ( meta.isDirectPath() ) {\n      sb.append( \" DIRECT=TRUE\" );\n\n      if ( getStepMeta().getCopies() > 1 || meta.isParallel() ) {\n        sb.append( \" PARALLEL=TRUE\" );\n      }\n    }\n\n    return sb.toString();\n  }\n\n  public void checkExitVal( int exitVal ) throws KettleException {\n    if ( exitVal == EX_SUCC ) {\n      return;\n    }\n\n    if ( meta.isFailOnWarning() && ( exitVal == EX_WARN ) ) {\n      throw new KettleException( \"sqlldr returned warning\" );\n    } else if ( meta.isFailOnError() && ( exitVal != EX_WARN ) ) {\n      throw new KettleException( \"sqlldr returned an error (exit code \" + exitVal + \")\" );\n    }\n  }\n\n  public boolean execute( OraBulkLoaderMeta meta, boolean wait ) throws KettleException {\n    Runtime rt = Runtime.getRuntime();\n\n    try {\n      sqlldrProcess = rt.exec( createCommandLine( meta, true ) );\n      // any error message?\n      StreamLogger errorLogger = new StreamLogger( sqlldrProcess.getErrorStream(), \"ERROR\" );\n\n      // any output?\n      StreamLogger outputLogger = new StreamLogger( sqlldrProcess.getInputStream(), \"OUTPUT\" );\n\n      // kick them off\n      errorLogger.start();","sourceCodeStart":441,"sourceCodeEnd":477,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/oracle-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/orabulkloader/OraBulkLoader.java#L441-L477","documentation":"This error is thrown by checkExitVal when the sqlldr (Oracle SQL*Loader) child process exits with code EX_WARN (typically 2, indicating rows loaded with warnings/rejects) and the step is configured with failOnWarning=true. The step lets you decide whether such a partial-success exit should abort the transformation. It signals that data was loaded but some issues occurred (e.g. rejected rows, bad file records).","triggerScenarios":"sqlldr exits with exit code 2 (EX_WARN) while meta.isFailOnWarning() is true; checkExitVal is called from execute() after wait, and from processRow() when the 'wait for database stream' load method finishes the process.","commonSituations":"Records rejected due to constraint violations, data type mismatches or too-long values; sqlldr configuration quirks (e.g. direct=true warnings); running the step after changing failOnWarning to true while data still contains bad rows.","solutions":["Inspect the sqlldr log / bad file (.bad, .log) written by the step to find rejected rows and fix the source data","Set failOnWarning=false on the OraBulkLoaderMeta if warnings should not abort the transformation","Fix the table definition (constraints, column sizes) to accept the incoming data","Add error handling in the transformation (e.g. error handling on the step) and re-run"],"exampleFix":"// before\nmeta.setFailOnWarning( true );\n// after\n// tolerate warning exit code 2 and inspect the sqlldr bad file instead\nmeta.setFailOnWarning( false );","handlingStrategy":"validation","validationCode":"// before running the transformation\nif ( meta.isFailOnWarning() ) {\n  System.out.println( \"sqlldr warnings will fail the step; ensure data is clean\" );\n}","typeGuard":null,"tryCatchPattern":"try {\n  step.processRow( smi, sdi );\n} catch ( KettleException e ) {\n  if ( e.getMessage().contains( \"sqlldr returned warning\" ) ) {\n    // inspect .bad/.log files and decide whether to re-run with failOnWarning=false\n  }\n}","preventionTips":["Audit source data for constraint violations and oversized values before bulk loading","Review sqlldr .log and .bad files after each run","Only enable failOnWarning when warnings must be treated as fatal"],"tags":["oracle","sqlldr","exit-code","transformation"],"backgroundTag":"http-error-response","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}