{"record":{"id":"08373689a41c5d95","repo":"pentaho/pentaho-kettle","slug":"there-was-an-unexpected-error","errorCode":null,"errorMessage":"There was an unexpected error:","messagePattern":"There was an unexpected error:","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/transexecutor/TransExecutor.java","lineNumber":140,"sourceCode":"          }\n        }\n      }\n\n      // Add next value AFTER transformation execution, in case we are grouping by field (see PDI-14958),\n      // and BEFORE checking size of a group, in case we are grouping by size (see PDI-14121).\n      transExecutorData.groupBuffer.add( new RowMetaAndData( getInputRowMeta(), row ) ); // should we clone for safety?\n\n      // Grouping by size.\n      // If group buffer size exceeds specified limit, then execute transformation and flush group buffer.\n      if ( transExecutorData.groupSize > 0 ) {\n        if ( transExecutorData.groupBuffer.size() >= transExecutorData.groupSize ) {\n          executeTransformation( incomingFieldValues );\n        }\n      }\n\n      return true;\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"TransExecutor.UnexpectedError\" ), e );\n    }\n  }\n\n  private void initOnFirstProcessingIteration() throws KettleException {\n    TransExecutorData transExecutorData = getData();\n    // internal transformation's first step has exactly the same input\n    transExecutorData.setInputRowMeta( getInputRowMeta() );\n\n    // internal transformation's execution results\n    transExecutorData.setExecutionResultsOutputRowMeta( new RowMeta() );\n    if ( meta.getExecutionResultTargetStepMeta() != null ) {\n      meta.prepareExecutionResultsFields( transExecutorData.getExecutionResultsOutputRowMeta(),\n        meta.getExecutionResultTargetStepMeta() );\n      transExecutorData\n        .setExecutionResultRowSet( findOutputRowSet( meta.getExecutionResultTargetStepMeta().getName() ) );\n    }\n    // internal transformation's execution result's file\n    transExecutorData.setResultFilesOutputRowMeta( new RowMeta() );","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/transexecutor/TransExecutor.java#L122-L158","documentation":"TransExecutor.processRow() catches any exception during execution of the sub-transformation (initialization, row injection, or result collection) and rethrows it as a KettleException with the localized 'TransExecutor.UnexpectedError' message ('There was an unexpected error:'). The real cause is the chained exception.","triggerScenarios":"Any failure inside processRow's try block: initOnFirstProcessingIteration errors, prepareExecution of the executor sub-transformation failing, putRow into the sub-transformation failing, or result retrieval problems while the step runs.","commonSituations":"The configured sub-transformation fails to start (missing file, bad parameters); sub-transformation steps error at runtime; group-field misconfiguration; memory exhaustion running many sub-transformations.","solutions":["Log/print the full stack trace of the chained cause — it names the actual failure.","Verify the sub-transformation path/filename resolves and runs standalone in Spoon.","Check that all sub-transformation parameters/mapping of input fields are correctly configured.","Increase logging on the executor step and re-run to pinpoint the failing inner step."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Before executing, verify the sub-transformation file exists and parameters map\nFile subTrans = new File(environmentSubstitute(transExecutorMeta.getFileName()));\nif (!subTrans.exists()) throw new IllegalStateException(\"Sub-transformation missing: \" + subTrans);","typeGuard":null,"tryCatchPattern":"try { trans.execute(new String[0]); }\ncatch (KettleException e) {\n  Throwable root = e; while (root.getCause() != null) root = root.getCause();\n  log.error(\"TransExecutor failed, root cause: {}\", root.toString(), e);\n}","preventionTips":["Run the sub-transformation standalone in Spoon first","Verify executor step parameter/input-field mappings","Enable detailed step logging to find the inner failing step"],"tags":["kettle","sub-transformation","runtime","executor"],"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"}