{"record":{"id":"1b7f931ff54ffb77","repo":"pentaho/pentaho-kettle","slug":"unexpected-error-occurred-while-launching-entry-0","errorCode":null,"errorMessage":"Unexpected error occurred while launching entry [{0}]","messagePattern":"Unexpected error occurred while launching entry \\[(.+?)\\]","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/Job.java","lineNumber":875,"sourceCode":"                threadResult.setNrErrors( 1L );\n                threadResults.add( threadResult );\n              }\n            }\n          };\n          Thread thread = new Thread( runnable );\n          threads.add( thread );\n          thread.start();\n          if ( log.isBasic() ) {\n            log.logBasic( BaseMessages.getString( PKG, \"Job.Log.LaunchedJobEntryInParallel\", nextEntry.getName() ) );\n          }\n        } else {\n          try {\n            // Same as before: blocks until it's done\n            //\n            res = execute( nr + 1, newResult, nextEntry, jobEntryCopy, nextComment );\n          } catch ( Throwable e ) {\n            log.logError( Const.getStackTracker( e ) );\n            throw new KettleException( BaseMessages.getString( PKG, \"Job.Log.UnexpectedError\", nextEntry.toString() ),\n                e );\n          }\n          if ( log.isBasic() ) {\n            log.logBasic( BaseMessages.getString( PKG, \"Job.Log.FinishedJobEntry\", nextEntry.getName(), res.getResult()\n                + \"\" ) );\n          }\n        }\n      }\n    }\n\n    // OK, if we run in parallel, we need to wait for all the job entries to\n    // finish...\n    //\n    if ( jobEntryCopy.isLaunchingInParallel() ) {\n      for ( int i = 0; i < threads.size(); i++ ) {\n        Thread thread = threads.get( i );\n        JobEntryCopy nextEntry = threadEntries.get( i );\n","sourceCodeStart":857,"sourceCodeEnd":893,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/Job.java#L857-L893","documentation":"Wraps any Throwable escaping the recursive execute() of a next job entry. When Job.execute launches a following job entry and it throws unexpectedly (not a normal result failure but a Java exception), the stack is logged and rethrown as a KettleException naming the entry.","triggerScenarios":"A job entry's run/execute method throws a Throwable (e.g. NPE, ClassCastException, missing class) during nested execution of the next entry in the job flow.","commonSituations":"Buggy custom job entry plugins; environment issues inside an entry (missing files, DB down) that surface as unchecked exceptions; version mismatch of plugin dependencies causing NoClassDefFoundError.","solutions":["Read the logged stack tracker (Const.getStackTracker) to identify the root cause in the named entry","Fix or update the failing job entry plugin","Wrap custom job entry code to convert expected failures into a Result with error flag instead of throwing","Check classpath/plugin jars for version conflicts"],"exampleFix":"// before\npublic Result execute(Result r) { return doWork(r); } // throws NPE\n// after\npublic Result execute(Result r) { try { return doWork(r); } catch (Exception e) { r.setErrors(1); logError(...); return r; } }","handlingStrategy":"try-catch","validationCode":"// pre-check plugin availability\nClass<?> entryClass;\ntry { entryClass = Class.forName(jobEntryPluginClass); } catch (ClassNotFoundException e) {\n  throw new IllegalStateException(\"Job entry plugin class missing: \" + jobEntryPluginClass);\n}","typeGuard":null,"tryCatchPattern":"try {\n  job.run();\n} catch (KettleException e) {\n  if (e.getMessage().startsWith(\"Unexpected error occurred while launching entry\")) {\n    Throwable root = e.getCause();\n    log.error(\"Entry failed with root cause\", root);\n    result.setErrors(1);\n  }\n}","preventionTips":["Convert expected failures inside custom job entries into Result errors instead of throwing","Keep plugin jars and Kettle engine versions aligned","Catch and log Throwable stack trackers in entry code for diagnosability"],"tags":["job-execution","unexpected-exception","plugin"],"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"}