{"record":{"id":"8e6c5be68e2a6ba7","repo":"pentaho/pentaho-kettle","slug":"columnexists-log-errorinstep","errorCode":null,"errorMessage":"ColumnExists.Log.ErrorInStep","messagePattern":"ColumnExists\\.Log\\.ErrorInStep","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/columnexists/ColumnExists.java","lineNumber":146,"sourceCode":"      // Check if table exists on the specified connection\n      columnexists = data.db.checkColumnExists( columnname, data.tablename );\n\n      Object[] outputRowData = RowDataUtil.addValueData( r, getInputRowMeta().size(), columnexists );\n\n      // add new values to the row.\n      putRow( data.outputRowMeta, outputRowData ); // copy row to output rowset(s);\n\n      if ( log.isRowLevel() ) {\n        logRowlevel( BaseMessages.getString( PKG, \"ColumnExists.LineNumber\",\n          getLinesRead() + \" : \" + getInputRowMeta().getString( r ) ) );\n      }\n    } catch ( KettleException e ) {\n      if ( getStepMeta().isDoingErrorHandling() ) {\n        sendToErrorRow = true;\n        errorMessage = e.toString();\n      } else {\n        logError( BaseMessages.getString( PKG, \"ColumnExists.ErrorInStepRunning\" + \" : \" + e.getMessage() ) );\n        throw new KettleStepException( BaseMessages.getString( PKG, \"ColumnExists.Log.ErrorInStep\" ), e );\n      }\n      if ( sendToErrorRow ) {\n        // Simply add this row to the error row\n        putError( getInputRowMeta(), r, 1, errorMessage, meta.getResultFieldName(), \"ColumnExists001\" );\n      }\n    }\n\n    return true;\n  }\n\n  public boolean init( StepMetaInterface smi, StepDataInterface sdi ) {\n    meta = (ColumnExistsMeta) smi;\n    data = (ColumnExistsData) sdi;\n\n    if ( super.init( smi, sdi ) ) {\n      if ( !meta.isTablenameInField() ) {\n        if ( Utils.isEmpty( meta.getTablename() ) ) {\n          logError( BaseMessages.getString( PKG, \"ColumnExists.Error.TablenameMissing\" ) );","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/columnexists/ColumnExists.java#L128-L164","documentation":"Catch-all handler in processRow: when a KettleException occurs and the transformation does NOT define error handling for this step, the step logs 'Error in step' and rethrows as KettleStepException, killing the transformation. If error handling IS enabled, the row is routed to the error stream instead.","triggerScenarios":"Any of the earlier KettleExceptions (missing tablename field, field not found in row, database errors from checkColumnExists) propagates to the catch block while getStepMeta().isDoingErrorHandling() is false.","commonSituations":"Running a transformation whose ColumnExists step failed field lookup or DB access without an error hop attached; users confused why the underlying message is wrapped.","solutions":["Attach an error handling hop to the step to route bad rows to an error stream instead of aborting","Fix the root cause reported in the wrapped exception's cause and log message","Check the Kettle log for the preceding 'ColumnExists...' message identifying the actual failure"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Ensure the step has error handling defined before running programmatically\nif (!stepMeta.isDoingErrorHandling()) {\n  stepMeta.setSupportsErrorHandling(true); // attach an error hop in the TransMeta\n}","typeGuard":null,"tryCatchPattern":"try {\n  trans.execute(null);\n  trans.waitUntilFinished();\n} catch (KettleException e) {\n  Throwable root = e; while (root.getCause() != null) root = root.getCause();\n  log.error(\"ColumnExists step failed: \" + root.getMessage(), root);\n}","preventionTips":["Attach error handling hops to fragile DB-touching steps","Always read the full cause chain — this error is a wrapper","Monitor the transformation log for the preceding ColumnExists-specific message"],"tags":["kettle","pdi","error-handling","wrapper"],"backgroundTag":"internal-invariant-violation","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"}