{"record":{"id":"5184dbcfc587ef01","repo":"pentaho/pentaho-kettle","slug":"unable-to-find-element-type","errorCode":null,"errorMessage":"Unable to find element type ","messagePattern":"Unable to find element type ","errorType":"exception","errorClass":"MetaStoreException","httpStatus":null,"severity":"error","filePath":"ui/src/main/java/org/pentaho/di/ui/spoon/dialog/MetaStoreExplorerDialog.java","lineNumber":219,"sourceCode":"\n    shell.open();\n    while ( !shell.isDisposed() ) {\n      if ( !display.readAndDispatch() ) {\n        display.sleep();\n      }\n    }\n  }\n\n  private void removeElement( String metaStoreName, String namespace, String elementTypeName, String elementName ) {\n\n    try {\n      IMetaStore metaStore = findMetaStore( metaStoreName );\n      if ( metaStore == null ) {\n        throw new MetaStoreException( \"Unable to find metastore '\" + metaStoreName + \"'\" );\n      }\n      IMetaStoreElementType elementType = metaStore.getElementTypeByName( namespace, elementTypeName );\n      if ( elementType == null ) {\n        throw new MetaStoreException( \"Unable to find element type '\"\n          + elementTypeName + \"' from metastore '\" + metaStoreName + \"' in namespace '\" + namespace + \"'\" );\n      }\n      IMetaStoreElement element = metaStore.getElementByName( namespace, elementType, elementName );\n      if ( element == null ) {\n        throw new MetaStoreException( \"Unable to find element '\"\n          + elementName + \"' of type '\" + elementTypeName + \"' from metastore '\" + metaStoreName\n          + \"' in namespace '\" + namespace + \"'\" );\n      }\n      metaStore.deleteElement( namespace, elementType, element.getId() );\n\n      refreshTree();\n\n    } catch ( MetaStoreException e ) {\n      new ErrorDialog( shell, \"Error removing element\", \"There was an error removing the element '\"\n        + elementName + \"' of type '\" + elementTypeName + \"' from metastore '\" + metaStoreName\n        + \"' in namespace '\" + namespace + \"'\", e );\n    }\n","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/ui/src/main/java/org/pentaho/di/ui/spoon/dialog/MetaStoreExplorerDialog.java#L201-L237","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Refresh the Metastore Explorer tree to drop stale references, then retry.","Verify the element type still exists under the namespace via the explorer tree.","Restore or recreate the element type definition if it was accidentally deleted.","Check for PDI version upgrades that renamed built-in metastore types and migrate data accordingly."],"exampleFix":"// before\nIMetaStoreElementType elementType = metaStore.getElementTypeByName( namespace, elementTypeName );\nif ( elementType == null ) { throw new MetaStoreException( ... ); }\n// after\nIMetaStoreElementType elementType = metaStore.getElementTypeByName( namespace, elementTypeName );\nif ( elementType == null ) {\n  refreshView(); // stale entry: re-sync tree instead of throwing\n  return;\n}","handlingStrategy":"validation","validationCode":"IMetaStoreElementType type = metaStore.getElementTypeByName(namespace, elementTypeName);\nif (type == null) { /* refresh explorer or recreate the type before deleting elements */ }","typeGuard":"static boolean elementTypeExists(IMetaStore store, String ns, String typeName) {\n  try { return store.getElementTypeByName(ns, typeName) != null; } catch (MetaStoreException e) { return false; }\n}","tryCatchPattern":"try {\n  removeElement(metaStoreName, namespace, typeName, elementName);\n} catch (MetaStoreException e) {\n  if (e.getMessage().startsWith(\"Unable to find element type\")) {\n    refreshView(); // stale type reference\n  }\n}","preventionTips":["Refresh the explorer tree after deleting or renaming element types.","Migrate built-in metastore types after PDI upgrades.","Confirm namespace and type still exist before issuing deletions."],"tags":["metastore","pdi","resource-not-found","ui"],"backgroundTag":"entity-not-found","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}