{"record":{"id":"42766d4e6840530e","repo":"pentaho/pentaho-kettle","slug":"unable-to-hydrate-previous-result","errorCode":null,"errorMessage":"Unable to hydrate previous result","messagePattern":"Unable to hydrate previous result","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/JobExecutionConfiguration.java","lineNumber":467,"sourceCode":"    logLevel = LogLevel.getLogLevelForCode( XMLHandler.getTagValue( trecNode, \"log_level\" ) );\n    clearingLog = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( trecNode, \"clear_log\" ) );\n\n    startCopyName = XMLHandler.getTagValue( trecNode, \"start_copy_name\" );\n    startCopyNr = Const.toInt( XMLHandler.getTagValue( trecNode, \"start_copy_nr\" ), 0 );\n\n    gatheringMetrics = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( trecNode, \"gather_metrics\" ) );\n\n    String sPassedBatchId = XMLHandler.getTagValue( trecNode, \"passedBatchId\" );\n    if ( !StringUtils.isEmpty( sPassedBatchId ) ) {\n      passedBatchId = Long.parseLong( sPassedBatchId );\n    }\n\n    Node resultNode = XMLHandler.getSubNode( trecNode, Result.XML_TAG );\n    if ( resultNode != null ) {\n      try {\n        previousResult = new Result( resultNode );\n      } catch ( KettleException e ) {\n        throw new KettleException( \"Unable to hydrate previous result\", e );\n      }\n    }\n\n    // Try to get a handle to the repository from here...\n    //\n    Node repNode = XMLHandler.getSubNode( trecNode, \"repository\" );\n    if ( repNode != null ) {\n      String repositoryName = XMLHandler.getTagValue( repNode, \"name\" );\n      String username = XMLHandler.getTagValue( repNode, \"login\" );\n      String password = Encr.decryptPassword( XMLHandler.getTagValue( repNode, \"password\" ) );\n      connectRepository( repositoryName, username, password );\n    }\n\n  }\n\n  public Repository connectRepository( String repositoryName, String username, String password ) throws KettleException {\n    // Verify that the repository exists on the slave server...\n    //","sourceCodeStart":449,"sourceCodeEnd":485,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/JobExecutionConfiguration.java#L449-L485","documentation":"When loading a JobExecutionConfiguration from XML, the <previous_result> node is parsed by constructing new Result(resultNode). If that construction throws a KettleException, it is re-wrapped with this message. It means the serialized previous Result blob in the execution-configuration XML is invalid or incompatible.","triggerScenarios":"Calling the XML-loading constructor JobExecutionConfiguration(Node trecNode, ...) where the Result.XML_TAG subnode exists but its contents cannot be unmarshalled into a Result (missing attributes, corrupted or hand-edited XML, result XML written by an incompatible version).","commonSituations":"Hand-edited execution configuration files; XML files shared across incompatible Pentaho versions where the Result schema changed; truncated XML files produced by an earlier crashed export.","solutions":["Inspect the chained cause (e) to see which Result field failed to parse.","Regenerate the execution configuration XML instead of repairing it by hand.","Remove the <previous_result> node if a previous result is not needed; the loader tolerates its absence (resultNode != null check).","Ensure the XML was produced by a compatible Pentaho version."],"exampleFix":"// before: hand-edited XML with broken previous_result\n// <previous_result><nr_errors>abc</nr_errors></previous_result>\n// after: drop or fix the node\n// <previous_result><nr_errors>0</nr_errors></previous_result>\n// or regenerate via:\nString xml = executionConfiguration.getXML(); // authoritative serialization","handlingStrategy":"try-catch","validationCode":"String xml = execCfgXmlString;\nif (xml.contains(\"<previous_result>\")) {\n  try { XMLHandler.loadXMLString(xml, Result.XML_TAG); }\n  catch (Exception ex) { xml = xml.replaceAll(\"<previous_result>.*</previous_result>\", \"\"); }\n}","typeGuard":null,"tryCatchPattern":"try {\n  JobExecutionConfiguration cfg = new JobExecutionConfiguration(trecNode, jobMeta, job);\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"hydrate previous result\")) {\n    log.warn(\"Ignoring corrupt previous_result: {}\", e.getCause());\n    cfg = loadWithoutPreviousResult(trecNode);\n  } else { throw e; }\n}","preventionTips":["Never hand-edit execution-configuration XML; regenerate it via getXML().","Keep producing and consuming Pentaho versions compatible.","Validate exported XML files against the schema before reuse.","Guard transfers in binary mode so XML is not truncated."],"tags":["xml","deserialization","job-execution"],"backgroundTag":"json-unmarshal-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"}