{"record":{"id":"f17f7495f2748363","repo":"pentaho/pentaho-kettle","slug":"unable-to-find-element-type-with-name","errorCode":null,"errorMessage":"Unable to find element type with name '{}'","messagePattern":"Unable to find element type with name '(.+?)'","errorType":"exception","errorClass":"MetaStoreException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/kdr/delegates/metastore/KettleDatabaseRepositoryMetaStore.java","lineNumber":389,"sourceCode":"      }\n\n      delegate.insertElement( elementType, element );\n      repository.commit();\n    } catch ( MetaStoreElementExistException e ) {\n      throw e;\n    } catch ( Exception e ) {\n      repository.rollback();\n      throw new MetaStoreException( \"Unable to create element with name '\"\n        + element.getName() + \"' of type '\" + elementType.getName() + \"'\", e );\n    }\n  }\n\n  @Override\n  public void deleteElement( String namespace, IMetaStoreElementType elementType, String elementId ) throws MetaStoreException {\n    try {\n      IMetaStoreElementType type = getElementTypeByName( namespace, elementType.getName() );\n      if ( type == null ) {\n        throw new MetaStoreException( \"Unable to find element type with name '\" + elementType.getName() + \"'\" );\n      }\n\n      delegate.deleteElement( new LongObjectId( new StringObjectId( elementId ) ) );\n      repository.commit();\n    } catch ( Exception e ) {\n      repository.rollback();\n      throw new MetaStoreException( \"Unable to delete element with id '\"\n        + elementId + \"' of type '\" + elementType.getName() + \"'\", e );\n    }\n  }\n\n  @Override\n  public void updateElement( String namespace, IMetaStoreElementType elementType, String elementId,\n    IMetaStoreElement element ) throws MetaStoreException {\n    try {\n      // This is a delete/insert operation\n      //\n      deleteElement( namespace, elementType, elementId );","sourceCodeStart":371,"sourceCodeEnd":407,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/kdr/delegates/metastore/KettleDatabaseRepositoryMetaStore.java#L371-L407","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Look up the live type first: IMetaStoreElementType t = getElementTypeByName(namespace, elementType.getName()) and use it","Verify the element type exists in the namespace (listElementTypes) before deleting elements","Ensure the type was not renamed/deleted by another process; refresh type objects from the repository","Correct the namespace argument so it matches where the type was created"],"exampleFix":"// before\nmetastore.deleteElement(namespace, elementType, elementId);\n// after\nif (metastore.getElementTypeByName(namespace, elementType.getName()) != null) {\n  metastore.deleteElement(namespace, elementType, elementId);\n}","handlingStrategy":"validation","validationCode":"IMetaStoreElementType live = metastore.getElementTypeByName(namespace, elementType.getName());\nif (live == null) {\n  throw new IllegalStateException(\"Element type not in namespace: \" + elementType.getName());\n}","typeGuard":null,"tryCatchPattern":"try {\n  metastore.deleteElement(namespace, elementType, elementId);\n} catch (MetaStoreException e) {\n  if (metastore.getElementTypeByName(namespace, elementType.getName()) == null) {\n    // type missing: nothing to delete, treat as no-op\n  } else throw e;\n}","preventionTips":["Resolve live type objects via getElementTypeByName instead of reusing stale ones","Confirm namespace matches where the type was created","List element types before bulk deletes","Watch for renames/deletes by other processes"],"tags":["metastore","element-type","not-found","repository"],"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"}