{"record":{"id":"a59da03c124cdae0","repo":"pentaho/pentaho-kettle","slug":"unable-to-load-job-entry-of-type-unzip-from-xml-node","errorCode":null,"errorMessage":"Unable to load job entry of type 'unzip' from XML node","messagePattern":"Unable to load job entry of type 'unzip' from XML node","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/unzip/JobEntryUnZip.java","lineNumber":237,"sourceCode":"      addtime = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, \"addtime\" ) );\n      addOriginalTimestamp = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, \"addOriginalTimestamp\" ) );\n      SpecifyFormat = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, \"SpecifyFormat\" ) );\n      date_time_format = XMLHandler.getTagValue( entrynode, \"date_time_format\" );\n      rootzip = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, \"rootzip\" ) );\n      createfolder = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, \"createfolder\" ) );\n      nr_limit = XMLHandler.getTagValue( entrynode, \"nr_limit\" );\n      wildcardSource = XMLHandler.getTagValue( entrynode, \"wildcardSource\" );\n      success_condition = XMLHandler.getTagValue( entrynode, \"success_condition\" );\n      if ( Utils.isEmpty( success_condition ) ) {\n        success_condition = SUCCESS_IF_NO_ERRORS;\n      }\n      iffileexist = getIfFileExistsInt( XMLHandler.getTagValue( entrynode, \"iffileexists\" ) );\n      createMoveToDirectory =\n        \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, \"create_move_to_directory\" ) );\n      setOriginalModificationDate =\n        \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, \"setOriginalModificationDate\" ) );\n    } catch ( KettleXMLException xe ) {\n      throw new KettleXMLException( \"Unable to load job entry of type 'unzip' from XML node\", 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      afterunzip = (int) rep.getJobEntryAttributeInteger( id_jobentry, \"afterunzip\" );\n      wildcard = rep.getJobEntryAttributeString( id_jobentry, \"wildcard\" );\n      wildcardexclude = rep.getJobEntryAttributeString( id_jobentry, \"wildcardexclude\" );\n      sourcedirectory = rep.getJobEntryAttributeString( id_jobentry, \"targetdirectory\" );\n      movetodirectory = rep.getJobEntryAttributeString( id_jobentry, \"movetodirectory\" );\n      addfiletoresult = rep.getJobEntryAttributeBoolean( id_jobentry, \"addfiletoresult\" );\n      isfromprevious = rep.getJobEntryAttributeBoolean( id_jobentry, \"isfromprevious\" );\n      adddate = rep.getJobEntryAttributeBoolean( id_jobentry, \"adddate\" );\n      addtime = rep.getJobEntryAttributeBoolean( id_jobentry, \"addtime\" );\n      addOriginalTimestamp = rep.getJobEntryAttributeBoolean( id_jobentry, \"addOriginalTimestamp\" );\n      SpecifyFormat = rep.getJobEntryAttributeBoolean( id_jobentry, \"SpecifyFormat\" );","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/unzip/JobEntryUnZip.java#L219-L255","documentation":"JobEntryUnZip.loadXML() wraps a KettleXMLException raised while reading the 'unzip' job entry's XML attributes into a new KettleXMLException with message \"Unable to load job entry of type 'unzip' from XML node\". It indicates the XML node for the unzip entry is malformed or contains values that cannot be parsed (e.g. the 'iffileexists' enum).","triggerScenarios":"Calling loadXML(...) with an entrynode whose attributes like 'iffileexists' or 'create_move_to_directory' are missing/unparseable, so getIfFileExistsInt or XMLHandler throws KettleXMLException.","commonSituations":".kjb files edited by hand or by third-party tools; unknown 'iffileexists' code from a newer/older Kettle version; truncated XML export.","solutions":["Open the .kjb and inspect the <entry type='UNZIP'> node; correct or remove invalid attribute values.","Ensure 'iffileexists' contains a recognized code (e.g. 'rename', 'overwrite', 'fail', 'skip').","Recreate the UnZip job entry in Spoon to regenerate valid XML.","Diff the XML against a working job from the same Kettle version."],"exampleFix":"// before: invalid iffileexists value in .kjb\n<iffileexists>replace</iffileexists>\n// after\n<iffileexists>overwrite</iffileexists>","handlingStrategy":"try-catch","validationCode":"// Validate unzip entry XML attributes before loadXML\nString iffe = XMLHandler.getTagValue(entrynode, \"iffileexists\");\nif ( iffe != null && !(iffe.equals(\"rename\")||iffe.equals(\"overwrite\")||iffe.equals(\"fail\")||iffe.equals(\"skip\")) )\n  throw new KettleXMLException(\"Unknown iffileexists code: \" + iffe);","typeGuard":"boolean isValidUnzipNode(Node entrynode) {\n  return entrynode != null\n    && XMLHandler.getTagValue(entrynode, \"zipfilename\") != null;\n}","tryCatchPattern":"try {\n  jobEntry.loadXML(entrynode, databases, slaveServers, rep, metaStore);\n} catch ( KettleXMLException e ) {\n  logError(\"Cannot parse unzip entry XML: \" + e.getCause().getMessage(), e);\n  // reject the job file or substitute defaults\n}","preventionTips":["Keep 'iffileexists' values limited to codes supported by your Kettle version.","Do not merge .kjb files across Pentaho versions without testing.","Version-control job files to catch corruption early.","Regenerate entries in Spoon rather than hand-editing XML."],"tags":["xml","serialization","kettle","unzip","job-entry"],"backgroundTag":"xml-parse-error","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"}