pentaho/pentaho-kettle · error · KettleException

Unable to load repository meta object

Error message

Unable to load repository meta object

What it means

BaseRepositoryMeta.loadXML throws KettleException 'Unable to load repository meta object' when any exception occurs while parsing a <repository> node from repositories.xml (id, name, description, is_default tags). The cause is chained.

Solutions

  1. Read e.getCause() to identify the malformed tag
  2. Fix or regenerate repositories.xml (connect to the repository once in Spoon to rewrite it)
  3. Ensure <id>, <name>, <description>, <is_default> tags are present and well-formed
  4. Back up and restore repositories.xml from a known-good machine

Example fix

// before: broken tag
<repository><name>prod</name><is_default>yes-no-maybe</is_default></repository>
// after
<repository><id>KettleDatabaseRepository</id><name>prod</name><description>Prod</description><is_default>N</is_default></repository>
Defensive patterns

Strategy: validation

Validate before calling

// Validate repositories.xml structure before RepositoriesMeta loads it
org.w3c.dom.Document doc = org.pentaho.di.core.xml.XMLHandler.loadXMLFile(new java.io.File(repoXmlPath));
org.w3c.dom.NodeList reps = doc.getElementsByTagName("repository");
for (int i = 0; i < reps.getLength(); i++) {
  if (org.pentaho.di.core.xml.XMLHandler.getTagValue(reps.item(i), "id") == null)
    throw new IllegalStateException("repository #" + i + " missing <id>");
}

Type guard

static boolean isValidRepositoryNode(org.w3c.dom.Node repnode) {
  return org.pentaho.di.core.xml.XMLHandler.getTagValue(repnode, "id") != null
      && org.pentaho.di.core.xml.XMLHandler.getTagValue(repnode, "name") != null;
}

Try / catch

try {
  reposMeta.readData();
} catch (KettleException e) {
  if (e.getMessage().contains("Unable to load repository meta object")) {
    throw new IllegalStateException("repositories.xml has a malformed <repository> node: " + e.getCause(), e);
  }
  throw e;
}

Prevention

When it happens

Trigger: Loading repositories.xml containing a malformed repository element — unparseable is_default value, unexpected structure, or an exception in a subclass's loadXML extension.

Common situations: Hand-edited repositories.xml; repositories.xml migrated from PDI 3.2 to 4.0+ missing tags (see PDI-2508 fix); corrupted file after interrupted write.

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


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/repository/BaseRepositoryMeta.java:124

    this.name = name;
    this.description = description;
    this.isDefault = isDefault;
  }

  /*
   * (non-Javadoc)
   *
   * @see org.pentaho.di.repository.RepositoryMeta#loadXML(org.w3c.dom.Node, java.util.List)
   */
  public void loadXML( Node repnode, List<DatabaseMeta> databases ) throws KettleException {
    try {
      // Fix for PDI-2508: migrating from 3.2 to 4.0 causes NPE on startup.
      id = Const.NVL( XMLHandler.getTagValue( repnode, "id" ), id );
      name = XMLHandler.getTagValue( repnode, "name" );
      description = XMLHandler.getTagValue( repnode, "description" );
      isDefault = Boolean.valueOf( XMLHandler.getTagValue( repnode, "is_default" ) );
    } catch ( Exception e ) {
      throw new KettleException( "Unable to load repository meta object", e );
    }
  }

  /*
   * (non-Javadoc)
   *
   * @see org.pentaho.di.repository.RepositoryMeta#getXML()
   */
  public String getXML() {
    StringBuilder retval = new StringBuilder( 100 );

    retval.append( "    " ).append( XMLHandler.addTagValue( "id", id ) );
    retval.append( "    " ).append( XMLHandler.addTagValue( "name", name ) );
    retval.append( "    " ).append( XMLHandler.addTagValue( "description", description ) );
    retval.append( "    " ).append( XMLHandler.addTagValue( "is_default", isDefault.toString() ) );

    return retval.toString();
  }

View on GitHub (pinned to f3058517a1)