{"record":{"id":"2c4bc00cd69808d8","repo":"pentaho/pentaho-kettle","slug":"jobentryzipfile-unableloadjobentryxml","errorCode":null,"errorMessage":"JobEntryZipFile.UnableLoadJobEntryXML","messagePattern":"JobEntryZipFile\\.UnableLoadJobEntryXML","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/zipfile/JobEntryZipFile.java","lineNumber":190,"sourceCode":"      compressionRate = Const.toInt( XMLHandler.getTagValue( entrynode, \"compressionrate\" ), -1 );\n      ifZipFileExists = Const.toInt( XMLHandler.getTagValue( entrynode, \"ifzipfileexists\" ), -1 );\n      afterZip = Const.toInt( XMLHandler.getTagValue( entrynode, \"afterzip\" ), -1 );\n      wildCard = XMLHandler.getTagValue( entrynode, \"wildcard\" );\n      excludeWildCard = XMLHandler.getTagValue( entrynode, \"wildcardexclude\" );\n      sourceDirectory = XMLHandler.getTagValue( entrynode, \"sourcedirectory\" );\n      movetoDirectory = XMLHandler.getTagValue( entrynode, \"movetodirectory\" );\n      addFileToResult = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, \"addfiletoresult\" ) );\n      isFromPrevious = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, \"isfromprevious\" ) );\n      createParentFolder = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, \"createparentfolder\" ) );\n      addDate = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, \"adddate\" ) );\n      addTime = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, \"addtime\" ) );\n      specifyFormat = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, \"SpecifyFormat\" ) );\n      dateTimeFormat = XMLHandler.getTagValue( entrynode, \"date_time_format\" );\n      createMoveToDirectory = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, \"createMoveToDirectory\" ) );\n      includingSubFolders = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, \"include_subfolders\" ) );\n      storedSourcePathDepth = XMLHandler.getTagValue( entrynode, \"stored_source_path_depth\" );\n    } catch ( KettleXMLException xe ) {\n      throw new KettleXMLException( BaseMessages.getString( PKG, \"JobEntryZipFile.UnableLoadJobEntryXML\" ), xe );\n    }\n  }\n\n  public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,\n    List<SlaveServer> slaveServers ) throws KettleException {\n    try {\n      zipFilename = rep.getJobEntryAttributeString( id_jobentry, \"zipfilename\" );\n      compressionRate = (int) rep.getJobEntryAttributeInteger( id_jobentry, \"compressionrate\" );\n      ifZipFileExists = (int) rep.getJobEntryAttributeInteger( id_jobentry, \"ifzipfileexists\" );\n      afterZip = (int) rep.getJobEntryAttributeInteger( id_jobentry, \"afterzip\" );\n      wildCard = rep.getJobEntryAttributeString( id_jobentry, \"wildcard\" );\n      excludeWildCard = rep.getJobEntryAttributeString( id_jobentry, \"wildcardexclude\" );\n      sourceDirectory = rep.getJobEntryAttributeString( id_jobentry, \"sourcedirectory\" );\n      movetoDirectory = rep.getJobEntryAttributeString( id_jobentry, \"movetodirectory\" );\n      addFileToResult = rep.getJobEntryAttributeBoolean( id_jobentry, \"addfiletoresult\" );\n      isFromPrevious = rep.getJobEntryAttributeBoolean( id_jobentry, \"isfromprevious\" );\n      createParentFolder = rep.getJobEntryAttributeBoolean( id_jobentry, \"createparentfolder\" );\n      addDate = rep.getJobEntryAttributeBoolean( id_jobentry, \"adddate\" );","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/zipfile/JobEntryZipFile.java#L172-L208","documentation":"JobEntryZipFile.loadXML() throws this KettleXMLException when the zip file job entry's configuration cannot be parsed from its XML node. Any KettleXMLException raised while reading tags like 'SpecifyFormat', 'date_time_format', 'createMoveToDirectory', 'include_subfolders', or 'stored_source_path_depth' is re-wrapped with this message.","triggerScenarios":"Calling loadXML on a JobEntryZipFile node that is malformed, truncated, or whose child tags cause XMLHandler to throw (non-XML content, missing entrynode, encoding problems).","commonSituations":"Corrupt or hand-edited .kjb files; files exported from a newer PDI version; transfer corruption (FTP ASCII mode, incomplete downloads); XML encoding mismatch.","solutions":["Validate the .kjb XML is well-formed (xmllint or an XML editor)","Check getCause() on the thrown KettleXMLException for the exact parse error and line","Re-export/re-save the job from Spoon to regenerate valid XML","Ensure the file was transferred in binary mode and is complete"],"exampleFix":"// before: corrupted node\n<entry name='Zip file'><SpecifyFormat maybe/></entry>\n// after: valid node\n<entry name='Zip file'><SpecifyFormat>N</SpecifyFormat><date_time_format></date_time_format><include_subfolders>N</include_subfolders></entry>","handlingStrategy":"try-catch","validationCode":"// validate XML before loadXML\ntry ( InputStream in = new FileInputStream( jobFile ) ) {\n  Document doc = XMLHandler.loadXMLFile( in );\n  if ( doc == null ) throw new KettleXMLException( \"Invalid XML: \" + jobFile );\n}","typeGuard":"boolean isParsableXml( File f ) {\n  try { return XMLHandler.loadXMLFile( new FileInputStream( f ) ) != null; }\n  catch ( Exception e ) { return false; }\n}","tryCatchPattern":"try {\n  jobEntry.loadXML( entrynode, databases, slaveServers, rep, metaStore );\n} catch ( KettleXMLException e ) {\n  logError( \"ZipFile entry XML load failed: \" + e.getCause(), e );\n  throw; // or restore defaults\n}","preventionTips":["Transfer job files in binary mode only","Validate .kjb XML after any external generation or templating","Keep generating and consuming PDI versions in sync"],"tags":["xml","deserialization","pdi","job-entry","zip"],"backgroundTag":"xml-deserialization-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"}