pentaho/pentaho-kettle · error · KettleException

Unable to load XML object from object with ID [ + id + ]…

Error message

Unable to load XML object from object with ID [ + id + ] and tag [ + tag + ]

What it means

loadNodeFromXML(id, tag) resolves the repository file for the given ObjectId, loads it through KettleVFS, and extracts the requested XML subnode. Any failure in file resolution, VFS access, XML parsing, or missing subnode handling is wrapped into this KettleException that names both the object id and the requested tag. It is the low-level workhorse behind most load* methods of the file repository.

Solutions

  1. Confirm the object file for the id exists under the repository base directory
  2. Validate the file is well-formed XML and contains the requested tag
  3. Fix the repository base-directory configuration if paths resolve incorrectly
  4. Re-export/recreate the object if the file is truncated or corrupt

Example fix

// before
Node node = repository.loadNodeFromXML(objectId, DatabaseMeta.XML_TAG);
// after
File f = new File(repoBase, objectId.getId()); // or resolve via directory tree
if (!f.exists()) { throw new KettleException("Object file missing: " + f); }
Node node = repository.loadNodeFromXML(objectId, DatabaseMeta.XML_TAG);
Defensive patterns

Strategy: validation

Validate before calling

File f = resolveObjectFile(repoBaseDirectory, id);
if (!f.isFile()) throw new KettleException("Repository object file missing: " + f);
try { new XmlValidator().validate(f.toPath()); } catch (Exception ex) { throw new KettleException("Object file is not valid XML: " + f, ex); }

Try / catch

try {
  Node node = repository.loadNodeFromXML(id, tag);
} catch (KettleException e) {
  logger.error("loadNodeFromXML failed for id=" + id + " tag=" + tag + ": " + e.getCause(), e);
  throw e;
}

Prevention

When it happens

Trigger: Calling any repository load that routes through loadNodeFromXML when the object's file does not exist, the path cannot be resolved by the VFS, the file contains malformed XML, or Document/subnode lookup throws.

Common situations: ObjectId from a stale cache referencing a deleted file; repository base directory misconfigured so relative paths resolve elsewhere; file moved by external tools; non-XML or truncated file left by an interrupted save.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/e6dacdfe503e3132. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/repository/filerep/KettleFileRepository.java:903

  @Override
  public Condition loadConditionFromStepAttribute( ObjectId id_step, String code ) throws KettleException {

    return null;
  }

  public Node loadNodeFromXML( ObjectId id, String tag ) throws KettleException {
    try {
      // The object ID is the base name of the file in the Base directory folder
      //
      String filename = calcDirectoryName( null ) + id.getId();
      FileObject fileObject = KettleVFS.getInstance( DefaultBowl.getInstance() ).getFileObject( filename );
      Document document = XMLHandler.loadXMLFile( fileObject );
      Node node = XMLHandler.getSubNode( document, tag );

      return node;
    } catch ( Exception e ) {
      throw new KettleException( "Unable to load XML object from object with ID ["
        + id + "] and tag [" + tag + "]", e );
    }
  }

  @Override
  public DatabaseMeta loadDatabaseMeta( ObjectId id_database, String versionName ) throws KettleException {
    try {
      return new DatabaseMeta( loadNodeFromXML( id_database, DatabaseMeta.XML_TAG ) );
    } catch ( Exception e ) {
      throw new KettleException( "Unable to load database connection from the file repository", e );
    }
  }

  @Override
  public DatabaseMeta loadDatabaseMetaFromJobEntryAttribute( ObjectId id_jobentry, String nameCode, int nr,
    String idCode, List<DatabaseMeta> databases ) throws KettleException {
    return null;
  }

View on GitHub (pinned to f3058517a1)