pentaho/pentaho-kettle · error · MetaStoreException

Unable to find element type

Error message

Unable to find element type 

What it means

In MetaStoreExplorerDialog.removeElement, after finding the metastore, metaStore.getElementTypeByName(namespace, elementTypeName) is consulted; if the element type is missing, MetaStoreException "Unable to find element type '<type>' from metastore ..." is thrown, preventing deletion of elements whose type definition no longer exists.

Solutions

  1. Refresh the Metastore Explorer tree to drop stale references, then retry.
  2. Verify the element type still exists under the namespace via the explorer tree.
  3. Restore or recreate the element type definition if it was accidentally deleted.
  4. Check for PDI version upgrades that renamed built-in metastore types and migrate data accordingly.

Example fix

// before
IMetaStoreElementType elementType = metaStore.getElementTypeByName( namespace, elementTypeName );
if ( elementType == null ) { throw new MetaStoreException( ... ); }
// after
IMetaStoreElementType elementType = metaStore.getElementTypeByName( namespace, elementTypeName );
if ( elementType == null ) {
  refreshView(); // stale entry: re-sync tree instead of throwing
  return;
}
Defensive patterns

Strategy: validation

Validate before calling

IMetaStoreElementType type = metaStore.getElementTypeByName(namespace, elementTypeName);
if (type == null) { /* refresh explorer or recreate the type before deleting elements */ }

Type guard

static boolean elementTypeExists(IMetaStore store, String ns, String typeName) {
  try { return store.getElementTypeByName(ns, typeName) != null; } catch (MetaStoreException e) { return false; }
}

Try / catch

try {
  removeElement(metaStoreName, namespace, typeName, elementName);
} catch (MetaStoreException e) {
  if (e.getMessage().startsWith("Unable to find element type")) {
    refreshView(); // stale type reference
  }
}

Prevention

When it happens

Trigger: Deleting an element in the Metastore Explorer after its element type was deleted or renamed (e.g. by a PDI upgrade changing built-in metastore types), so the type lookup returns null.

Common situations: Stale tree view after the element type was removed in another dialog or session; upgraded PDI renamed default element types; namespace deleted externally while the explorer still shows old entries.

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/5184dbcfc587ef01. Report an issue: GitHub.

Appendix: source

Thrown at ui/src/main/java/org/pentaho/di/ui/spoon/dialog/MetaStoreExplorerDialog.java:219

    shell.open();
    while ( !shell.isDisposed() ) {
      if ( !display.readAndDispatch() ) {
        display.sleep();
      }
    }
  }

  private void removeElement( String metaStoreName, String namespace, String elementTypeName, String elementName ) {

    try {
      IMetaStore metaStore = findMetaStore( metaStoreName );
      if ( metaStore == null ) {
        throw new MetaStoreException( "Unable to find metastore '" + metaStoreName + "'" );
      }
      IMetaStoreElementType elementType = metaStore.getElementTypeByName( namespace, elementTypeName );
      if ( elementType == null ) {
        throw new MetaStoreException( "Unable to find element type '"
          + elementTypeName + "' from metastore '" + metaStoreName + "' in namespace '" + namespace + "'" );
      }
      IMetaStoreElement element = metaStore.getElementByName( namespace, elementType, elementName );
      if ( element == null ) {
        throw new MetaStoreException( "Unable to find element '"
          + elementName + "' of type '" + elementTypeName + "' from metastore '" + metaStoreName
          + "' in namespace '" + namespace + "'" );
      }
      metaStore.deleteElement( namespace, elementType, element.getId() );

      refreshTree();

    } catch ( MetaStoreException e ) {
      new ErrorDialog( shell, "Error removing element", "There was an error removing the element '"
        + elementName + "' of type '" + elementTypeName + "' from metastore '" + metaStoreName
        + "' in namespace '" + namespace + "'", e );
    }

View on GitHub (pinned to f3058517a1)