{"record":{"id":"47561bfc53e6806e","repo":"pentaho/pentaho-kettle","slug":"jobpgpdecryptfiles-error-exception-unableloadxml","errorCode":null,"errorMessage":"JobPGPDecryptFiles.Error.Exception.UnableLoadXML","messagePattern":"JobPGPDecryptFiles\\.Error\\.Exception\\.UnableLoadXML","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/pgpdecryptfiles/JobEntryPGPDecryptFiles.java","lineNumber":264,"sourceCode":"\n      Node fields = XMLHandler.getSubNode( entrynode, \"fields\" );\n\n      // How many field arguments?\n      int nrFields = XMLHandler.countNodes( fields, \"field\" );\n      allocate( nrFields );\n\n      // Read them all...\n      for ( int i = 0; i < nrFields; i++ ) {\n        Node fnode = XMLHandler.getSubNodeByNr( fields, \"field\", i );\n\n        source_filefolder[i] = XMLHandler.getTagValue( fnode, \"source_filefolder\" );\n        passphrase[i] = Encr.decryptPasswordOptionallyEncrypted( XMLHandler.getTagValue( fnode, \"passphrase\" ) );\n        destination_filefolder[i] = XMLHandler.getTagValue( fnode, \"destination_filefolder\" );\n        wildcard[i] = XMLHandler.getTagValue( fnode, \"wildcard\" );\n      }\n    } catch ( KettleXMLException xe ) {\n\n      throw new KettleXMLException( BaseMessages.getString(\n        PKG, \"JobPGPDecryptFiles.Error.Exception.UnableLoadXML\" ), 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      gpglocation = rep.getJobEntryAttributeString( id_jobentry, \"gpglocation\" );\n      arg_from_previous = rep.getJobEntryAttributeBoolean( id_jobentry, \"arg_from_previous\" );\n      include_subfolders = rep.getJobEntryAttributeBoolean( id_jobentry, \"include_subfolders\" );\n      add_result_filesname = rep.getJobEntryAttributeBoolean( id_jobentry, \"add_result_filesname\" );\n      destination_is_a_file = rep.getJobEntryAttributeBoolean( id_jobentry, \"destination_is_a_file\" );\n      create_destination_folder = rep.getJobEntryAttributeBoolean( id_jobentry, \"create_destination_folder\" );\n      nr_errors_less_than = rep.getJobEntryAttributeString( id_jobentry, \"nr_errors_less_than\" );\n      success_condition = rep.getJobEntryAttributeString( id_jobentry, \"success_condition\" );\n      add_date = rep.getJobEntryAttributeBoolean( id_jobentry, \"add_date\" );\n      add_time = rep.getJobEntryAttributeBoolean( id_jobentry, \"add_time\" );\n      SpecifyFormat = rep.getJobEntryAttributeBoolean( id_jobentry, \"SpecifyFormat\" );","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/pgpdecryptfiles/JobEntryPGPDecryptFiles.java#L246-L282","documentation":"Thrown by JobEntryPGPDecryptFiles.loadXML when parsing the job entry's XML definition raises a KettleXMLException. The original XML parse exception is wrapped and identified with a localized message so callers know the PGP decrypt entry could not be deserialized.","triggerScenarios":"loadXML(entryNode, ...) reads attributes via XMLHandler.getTagValue on each node; if the XML is malformed, a required node/element is absent in a way XMLHandler rejects, or getNodes fails, KettleXMLException is caught and re-wrapped.","commonSituations":"Corrupt or hand-edited .kjb job file; XML exported from a newer/older Pentaho version with changed element structure; truncated file transfer; wrong node passed in by custom code.","solutions":["Open the .kjb file in Spoon to identify the malformed entry and repair or recreate it.","Validate the job XML against the expected JobEntryPGPDecryptFiles element structure (nodes with passphrase, destination_filefolder, wildcard, etc.).","Restore the job file from backup or source control.","Inspect getCause() (the wrapped KettleXMLException) for the exact parse error and line."],"exampleFix":"// before: hand-edited XML with missing closing tag on <wildcard>\n// after: regenerate the entry XML via Spoon, or repair:\n//   <wildcard>.*\\.pgp</wildcard>\n// ensure every file node contains passphrase, destination_filefolder and wildcard elements","handlingStrategy":"try-catch","validationCode":"// validate job XML before loading\nDocument doc = XMLHandler.loadXMLFile( jobFile );\nif ( doc == null || XMLHandler.getSubNode( doc, \"job\" ) == null ) {\n  throw new IllegalArgumentException( \"Not a valid Kettle job XML\" );\n}","typeGuard":null,"tryCatchPattern":"try {\n  jobEntry.loadXML( entryNode, databases, slaveServers, rep, metaStore );\n} catch ( KettleXMLException e ) {\n  logError( \"PGP decrypt entry XML is corrupt; restore from backup. Cause: \" + e.getCause(), e );\n}","preventionTips":["Don't hand-edit .kjb files; edit in Spoon.","Keep job files in source control for recovery.","Use consistent Pentaho versions between designer and runtime.","Verify file integrity after transfers."],"tags":["xml","deserialization","kettle","pgp"],"backgroundTag":"json-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"}