pentaho/pentaho-kettle · error · KettleXMLException
JobPGPEncryptFiles.Error.Exception.UnableLoadXML
Error message
JobPGPEncryptFiles.Error.Exception.UnableLoadXML
What it means
KettleXMLException with key JobPGPEncryptFiles.Error.Exception.UnableLoadXML is thrown by JobEntryPGPEncryptFiles.loadXML when parsing the job entry's XML definition fails. It wraps the original KettleXMLException while reading fields such as source filefolder, userid, destination_filefolder, and wildcard from the <fields> nodes of a .kjb job file.
Solutions
- Open the .kjb in Spoon and fix or re-create the PGP Encrypt Files entry to regenerate valid XML.
- Validate the <fields> block contains the expected child tags (filefolder, userid, destination_filefolder, wildcard).
- Load the job with the same (or newer) Pentaho Kettle version that produced it.
- Check the cause chain (getCause() KettleXMLException) for the exact XML parse error and line.
Example fix
// before <fields> <filefolder>file.txt</filefolder> </fields> // after <fields> <filefolder>file.txt</filefolder> <userid>user@example.com</userid> <destination_filefolder>out/</destination_filefolder> <wildcard>.*\.txt</wildcard> </fields>
Defensive patterns
Strategy: validation
Validate before calling
// Validate the job XML before loading:
org.w3c.dom.Document doc = XMLHandler.loadXMLFile(new java.io.File(jobPath));
if (XMLHandler.getSubNode(doc, "job") == null) {
throw new IllegalStateException("Not a valid Kettle job file: " + jobPath);
} Try / catch
try {
jobMeta = new JobMeta(jobPath, rep, metaStore);
} catch (KettleXMLException xe) {
if (xe.getMessage().contains("UnableLoadXML")) {
// entry XML corrupt — inspect cause for parse line, re-export from Spoon
}
} Prevention
- Never hand-edit .kjb files; use Spoon
- Keep producer and consumer Kettle versions compatible
- Validate XML well-formedness before loading externally generated jobs
When it happens
Trigger: Loading a .kjb job whose JobPGPEncryptFiles entry XML is malformed: missing/wrong <fields> structure, unexpected node types, or XMLHandler.getTagValue encountering invalid XML.
Common situations: Hand-edited job files; job exported from a newer Pentaho version and loaded in an older one; truncated or corrupted .kjb files; encoding/BOM issues after external edits.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- JobEntryTruncateTables.UnableLoadXML
- JobEntryWaitForSQL.UnableLoadXML
- Unable to load job entry of type 'unzip' from XML node
- Unable to load job entry of type 'wait for file' from XML…
- AddSequenceMeta.Exception.ErrorLoadingStepInfo
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/9ac6dfda4a6d06ac.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/job/entries/pgpencryptfiles/JobEntryPGPEncryptFiles.java:288
Node fields = XMLHandler.getSubNode( entrynode, "fields" );
// How many field arguments?
int nrFields = XMLHandler.countNodes( fields, "field" );
allocate( nrFields );
// Read them all...
for ( int i = 0; i < nrFields; i++ ) {
Node fnode = XMLHandler.getSubNodeByNr( fields, "field", i );
action_type[i] = getActionTypeByCode( Const.NVL( XMLHandler.getTagValue( fnode, "action_type" ), "" ) );
source_filefolder[i] = XMLHandler.getTagValue( fnode, "source_filefolder" );
userid[i] = XMLHandler.getTagValue( fnode, "userid" );
destination_filefolder[i] = XMLHandler.getTagValue( fnode, "destination_filefolder" );
wildcard[i] = XMLHandler.getTagValue( fnode, "wildcard" );
}
} catch ( KettleXMLException xe ) {
throw new KettleXMLException( BaseMessages.getString(
PKG, "JobPGPEncryptFiles.Error.Exception.UnableLoadXML" ), xe );
}
}
private static int getActionTypeByCode( String tt ) {
if ( tt == null ) {
return 0;
}
for ( int i = 0; i < actionTypeCodes.length; i++ ) {
if ( actionTypeCodes[i].equalsIgnoreCase( tt ) ) {
return i;
}
}
return 0;
}
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,View on GitHub (pinned to f3058517a1)