pentaho/pentaho-kettle · error · MetaStoreException

Unable to find element type with name

Error message

Unable to find element type with name '{}'

What it means

Thrown by deleteElement when no element type with the requested name exists in the namespace. getElementTypeByName returned null, so the delete is aborted early with a plain MetaStoreException (no rollback needed since nothing was written).

Solutions

  1. Look up the live type first: IMetaStoreElementType t = getElementTypeByName(namespace, elementType.getName()) and use it
  2. Verify the element type exists in the namespace (listElementTypes) before deleting elements
  3. Ensure the type was not renamed/deleted by another process; refresh type objects from the repository
  4. Correct the namespace argument so it matches where the type was created

Example fix

// before
metastore.deleteElement(namespace, elementType, elementId);
// after
if (metastore.getElementTypeByName(namespace, elementType.getName()) != null) {
  metastore.deleteElement(namespace, elementType, elementId);
}
Defensive patterns

Strategy: validation

Validate before calling

IMetaStoreElementType live = metastore.getElementTypeByName(namespace, elementType.getName());
if (live == null) {
  throw new IllegalStateException("Element type not in namespace: " + elementType.getName());
}

Try / catch

try {
  metastore.deleteElement(namespace, elementType, elementId);
} catch (MetaStoreException e) {
  if (metastore.getElementTypeByName(namespace, elementType.getName()) == null) {
    // type missing: nothing to delete, treat as no-op
  } else throw e;
}

Prevention

When it happens

Trigger: deleteElement(namespace, elementType, elementId) called with an elementType whose getName() is not present in namespace; also triggered from updateElement's internal delete step when the type name was renamed or removed.

Common situations: Passing an element type object from a different namespace or a stale in-memory type after the type was deleted/renamed; typo in type name when constructing a dummy IMetaStoreElementType; migration scripts referencing removed types.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


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

Appendix: source

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

      }

      delegate.insertElement( elementType, element );
      repository.commit();
    } catch ( MetaStoreElementExistException e ) {
      throw e;
    } catch ( Exception e ) {
      repository.rollback();
      throw new MetaStoreException( "Unable to create element with name '"
        + element.getName() + "' of type '" + elementType.getName() + "'", e );
    }
  }

  @Override
  public void deleteElement( String namespace, IMetaStoreElementType elementType, String elementId ) throws MetaStoreException {
    try {
      IMetaStoreElementType type = getElementTypeByName( namespace, elementType.getName() );
      if ( type == null ) {
        throw new MetaStoreException( "Unable to find element type with name '" + elementType.getName() + "'" );
      }

      delegate.deleteElement( new LongObjectId( new StringObjectId( elementId ) ) );
      repository.commit();
    } catch ( Exception e ) {
      repository.rollback();
      throw new MetaStoreException( "Unable to delete element with id '"
        + elementId + "' of type '" + elementType.getName() + "'", e );
    }
  }

  @Override
  public void updateElement( String namespace, IMetaStoreElementType elementType, String elementId,
    IMetaStoreElement element ) throws MetaStoreException {
    try {
      // This is a delete/insert operation
      //
      deleteElement( namespace, elementType, elementId );

View on GitHub (pinned to f3058517a1)