{"record":{"id":"2dd1ca0f255d8be9","repo":"pentaho/pentaho-kettle","slug":"unexpected-error-in-calling-extension-point-upon-step-finish","errorCode":null,"errorMessage":"Unexpected error in calling extension point upon step finish","messagePattern":"Unexpected error in calling extension point upon step finish","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/Trans.java","lineNumber":1569,"sourceCode":"\n        // Now start all the threads...\n        //\n        for ( int i = 0; i < steps.size(); i++ ) {\n          final StepMetaDataCombi combi = steps.get( i );\n          RunThread runThread = new RunThread( combi );\n          Thread thread = new Thread( runThread );\n          thread.setName( getName() + \" - \" + combi.stepname );\n          ExtensionPointHandler.callExtensionPoint( log, KettleExtensionPoint.StepBeforeStart.id, combi );\n          // Call an extension point at the end of the step\n          //\n          combi.step.addStepListener( new StepAdapter() {\n\n            @Override\n            public void stepFinished( Trans trans, StepMeta stepMeta, StepInterface step ) {\n              try {\n                ExtensionPointHandler.callExtensionPoint( log, KettleExtensionPoint.StepFinished.id, combi );\n              } catch ( KettleException e ) {\n                throw new RuntimeException( \"Unexpected error in calling extension point upon step finish\", e );\n              }\n            }\n\n          } );\n\n          thread.start();\n        }\n        break;\n\n      case SerialSingleThreaded:\n        new Thread( new Runnable() {\n          @Override\n          public void run() {\n            try {\n              // Always disable thread priority management, it will always slow us\n              // down...\n              //\n              for ( StepMetaDataCombi combi : steps ) {","sourceCodeStart":1551,"sourceCodeEnd":1587,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/Trans.java#L1551-L1587","documentation":"When a step in the transformation finishes, Trans registers a StepListener whose stepFinished() callback fires the StepFinished extension point. If that extension point plugin throws a KettleException, it is wrapped in a RuntimeException with this message. As with 1160, the step/transformation ran; the failure is in a plugin observing the step-finish event.","triggerScenarios":"A plugin registered under KettleExtensionPoint.StepFinished throws a KettleException from its callExtensionPoint() while processing the step-finished event for any step in the transformation.","commonSituations":"Custom step-finish audit/notification plugins failing on network or DB access; plugin code assuming a different object type in the 'combi' (StepMeta/StepInterface) argument; version-mismatched plugin APIs.","solutions":["Inspect the cause exception to identify the failing StepFinished extension point plugin","Fix the plugin's handling of the Trans/StepMeta/StepInterface combination passed to it","Update or remove the offending plugin from plugins/","Add internal try/catch + logging in the plugin so step-finish failures do not propagate"],"exampleFix":"// before\npublic void stepFinished(Trans trans, StepMeta stepMeta, StepInterface step) {\n  plugin.notify(step);\n}\n// after\npublic void stepFinished(Trans trans, StepMeta stepMeta, StepInterface step) {\n  try { plugin.notify(step); }\n  catch (Exception e) { trans.getLogChannel().logError(\"StepFinished plugin failed\", e); }\n}","handlingStrategy":"try-catch","validationCode":"// verify step-finish plugins before run\nKettleExtensionPoint.StepFinished.getExtensions(); // inspect registered plugin ids and their health","typeGuard":"boolean isStepFinishPluginError(RuntimeException e) {\n  return \"Unexpected error in calling extension point upon step finish\".equals(e.getMessage());\n}","tryCatchPattern":"try {\n  trans.execute(args); trans.waitUntilFinished();\n} catch (RuntimeException e) {\n  if (\"Unexpected error in calling extension point upon step finish\".equals(e.getMessage())) {\n    log.warn(\"StepFinished extension point plugin failed\", e.getCause());\n  } else throw e;\n}","preventionTips":["Register only well-tested StepFinished listeners","Ensure plugin code does not assume specific step types in the Trans/StepMeta/StepInterface combi","Pin plugin versions to the Kettle release","Wrap listener bodies in internal error handling"],"tags":["kettle","extension-point","plugin","step-listener"],"backgroundTag":"plugin-callback-failed","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"}