{"record":{"id":"e7bf27e409791e47","repo":"pentaho/pentaho-kettle","slug":"unable-to-load-job-entry-of-type-mail-from-xml-node","errorCode":null,"errorMessage":"Unable to load job entry of type 'mail' from XML node","messagePattern":"Unable to load job entry of type 'mail' from XML node","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"plugins/mail-job/impl/src/main/java/org/pentaho/di/job/entries/mail/JobEntryMail.java","lineNumber":419,"sourceCode":"      setZipFiles( \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, TAG_ZIP_FILES ) ) );\n      setZipFilename( XMLHandler.getTagValue( entrynode, TAG_ZIP_NAME ) );\n      setReplyToAddresses( XMLHandler.getTagValue( entrynode, TAG_REPLY_TO_ADDRESSES ) );\n\n      Node images = XMLHandler.getSubNode( entrynode, TAG_EMBEDDED_IMAGES );\n\n      // How many field embedded images ?\n      int nrImages = XMLHandler.countNodes( images, TAG_EMBEDDED_IMAGE );\n      allocateImages( nrImages );\n\n      // Read them all...\n      for ( int i = 0; i < nrImages; i++ ) {\n        Node fnode = XMLHandler.getSubNodeByNr( images, TAG_EMBEDDED_IMAGE, i );\n\n        embeddedimages[i] = XMLHandler.getTagValue( fnode, TAG_IMAGE_NAME );\n        contentids[i] = XMLHandler.getTagValue( fnode, TAG_CONTENT_ID );\n      }\n    } catch ( KettleException xe ) {\n      throw new KettleXMLException( \"Unable to load job entry of type 'mail' from XML node\", xe );\n    }\n  }\n\n  @Override\n  public void loadRep( Repository rep, IMetaStore metaStore, ObjectId idJobEntry, List<DatabaseMeta> databases,\n    List<SlaveServer> slaveServers ) throws KettleException {\n    try {\n      // First load the common parts like name & description, then the attributes...\n      //\n      server = rep.getJobEntryAttributeString( idJobEntry, TAG_SERVER );\n      port = rep.getJobEntryAttributeString( idJobEntry, TAG_PORT );\n      destination = rep.getJobEntryAttributeString( idJobEntry, TAG_DESTINATION );\n      destinationCc = rep.getJobEntryAttributeString( idJobEntry, TAG_DESTINATION_CC );\n      destinationBCc = rep.getJobEntryAttributeString( idJobEntry, TAG_DESTINATION_BCC );\n      replyAddress = rep.getJobEntryAttributeString( idJobEntry, TAG_REPLYTO );\n      replyName = rep.getJobEntryAttributeString( idJobEntry, TAG_REPLYTONAME );\n      subject = rep.getJobEntryAttributeString( idJobEntry, TAG_SUBJECT );\n      includeDate = rep.getJobEntryAttributeBoolean( idJobEntry, TAG_INCLUDE_DATE );","sourceCodeStart":401,"sourceCodeEnd":437,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/mail-job/impl/src/main/java/org/pentaho/di/job/entries/mail/JobEntryMail.java#L401-L437","documentation":"Outer catch-all while loading the 'mail' job entry from its XML node: an exception occurred parsing the entry's settings (zip options, reply-to, embedded images). The message identifies the entry type; the underlying exception is chained.","triggerScenarios":"loadXML reads embedded image nodes and tags from the entrynode and any malformed/missing node or unexpected structure raises KettleException, e.g. a hand-edited .kjb or a file written by an incompatible Pentaho version.","commonSituations":"Hand-edited job XML with broken <embedded_image> nodes; jobs from newer/older Pentaho versions with changed XML schema; truncated file from a failed VCS merge.","solutions":["Inspect the chained KettleException cause to find the exact XML node/tag that failed to parse.","Open the .kjb in Spoon and re-save the Mail job entry to regenerate well-formed XML.","Restore the job file from version control if it was hand-edited or truncated.","Match Pentaho/PDI versions if the job came from a different release."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Validate the job XML before loading\nDocument doc = XMLHandler.loadXMLFile(new File(jobFile));\nif (doc == null || XMLHandler.getSubNode(doc, \"job\") == null) {\n  throw new KettleException(jobFile + \" is not a valid job XML file.\");\n}","typeGuard":null,"tryCatchPattern":"try { loadJob(xmlNode); } catch (KettleXMLException e) {\n  logError(\"Mail job entry XML is malformed; re-save the .kjb in Spoon: \" + e.getMessage(), e);\n}","preventionTips":["Do not hand-edit .kjb files; edit via Spoon.","Resolve VCS merges of job XML by re-saving from Spoon, not by hand.","Keep job producers and consumers on compatible PDI versions."],"tags":["xml","deserialization","job-entry","metadata"],"backgroundTag":"schema-validation-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"}