pentaho/pentaho-kettle · error · MetaStoreException

Unable to get element type with id

Error message

Unable to get element type with id '<elementTypeId>' in namespace '<namespace>'

What it means

Thrown by getElementType when looking up an element type by id fails for any reason in the database repository metastore. Any exception from resolving the namespace or fetching/parsing the row (including invalid id format) is wrapped in MetaStoreException with the id and namespace in the message. Note that a merely-missing id typically returns null rather than throwing, so this indicates an unexpected failure.

Solutions

  1. Validate elementTypeId is a proper ObjectId string (obtain it from getElementTypeIds/getElementType, not a name).
  2. Verify the id exists: getElementTypeIds(namespace).contains(elementTypeId) before lookup.
  3. Confirm you are connected to the same repository the id was issued from.
  4. Inspect the cause exception for JDBC/parse details and fix the repository connection or data.

Example fix

// before
IMetaStoreElementType t = metastore.getElementType(namespace, "MyTypeName"); // name, not id

// after
String id = metastore.getElementTypeIds(namespace).stream()
  .filter(i -> name.equals(metastore.getElementType(namespace, i).getName()))
  .findFirst().orElse(null);
IMetaStoreElementType t = id == null ? null : metastore.getElementType(namespace, id);
Defensive patterns

Strategy: validation

Validate before calling

if (elementTypeId == null || !metastore.getElementTypeIds(namespace).contains(elementTypeId)) {
  throw new IllegalArgumentException("Unknown element type id: " + elementTypeId);
}

Try / catch

try {
  return metastore.getElementType(namespace, elementTypeId);
} catch (MetaStoreException e) {
  throw new IllegalArgumentException("Bad id or repository failure: " + e.getCause(), e);
}

Prevention

When it happens

Trigger: Calling getElementType(namespace, elementTypeId) where delegate.getElementType(new LongObjectId(new StringObjectId(elementTypeId))) throws — e.g. elementTypeId is not a valid StringObjectId (garbage/null id), or the repository query fails.

Common situations: Passing a human-readable name where an ObjectId string is expected; using an id captured from a different repository; id strings truncated or altered when persisted in external config; repository connection failure.

Understand the failure class

Background: "invalid id" errors: invalid identifier format — why libraries reject IDs before lookup, and how to fix them — this error's family across 37 libraries.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/repository/kdr/delegates/metastore/KettleDatabaseRepositoryMetaStore.java:213

    }
    return ids;
  }

  @Override
  public IMetaStoreElementType getElementType( String namespace, String elementTypeId ) throws MetaStoreException {
    try {

      ObjectId namespaceId = delegate.getNamespaceId( namespace );
      if ( namespaceId == null ) {
        return null;
      }

      RowMetaAndData elementTypeRow =
        delegate.getElementType( new LongObjectId( new StringObjectId( elementTypeId ) ) );

      return delegate.parseElementType( namespace, namespaceId, elementTypeRow );
    } catch ( Exception e ) {
      throw new MetaStoreException( "Unable to get element type with id '"
        + elementTypeId + "' in namespace '" + namespace + "'", e );
    }
  }

  @Override
  public IMetaStoreElementType getElementTypeByName( String namespace, String elementTypeName ) throws MetaStoreException {
    try {
      LongObjectId namespaceId = delegate.getNamespaceId( namespace );
      if ( namespaceId == null ) {
        return null;
      }
      LongObjectId elementTypeId = delegate.getElementTypeId( namespaceId, elementTypeName );
      if ( elementTypeId == null ) {
        return null;
      }
      RowMetaAndData elementTypeRow = delegate.getElementType( elementTypeId );

      return delegate.parseElementType( namespace, namespaceId, elementTypeRow );

View on GitHub (pinned to f3058517a1)