{"record":{"id":"0432b9f8a37e39ef","repo":"pentaho/pentaho-kettle","slug":"unable-to-get-element-type-with-id-elementtypeid-in","errorCode":null,"errorMessage":"Unable to get element type with id '<elementTypeId>' in namespace '<namespace>'","messagePattern":"Unable to get element type with id '<elementTypeId>' in namespace '<namespace>'","errorType":"exception","errorClass":"MetaStoreException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/kdr/delegates/metastore/KettleDatabaseRepositoryMetaStore.java","lineNumber":213,"sourceCode":"    }\n    return ids;\n  }\n\n  @Override\n  public IMetaStoreElementType getElementType( String namespace, String elementTypeId ) throws MetaStoreException {\n    try {\n\n      ObjectId namespaceId = delegate.getNamespaceId( namespace );\n      if ( namespaceId == null ) {\n        return null;\n      }\n\n      RowMetaAndData elementTypeRow =\n        delegate.getElementType( new LongObjectId( new StringObjectId( elementTypeId ) ) );\n\n      return delegate.parseElementType( namespace, namespaceId, elementTypeRow );\n    } catch ( Exception e ) {\n      throw new MetaStoreException( \"Unable to get element type with id '\"\n        + elementTypeId + \"' in namespace '\" + namespace + \"'\", e );\n    }\n  }\n\n  @Override\n  public IMetaStoreElementType getElementTypeByName( String namespace, String elementTypeName ) throws MetaStoreException {\n    try {\n      LongObjectId namespaceId = delegate.getNamespaceId( namespace );\n      if ( namespaceId == null ) {\n        return null;\n      }\n      LongObjectId elementTypeId = delegate.getElementTypeId( namespaceId, elementTypeName );\n      if ( elementTypeId == null ) {\n        return null;\n      }\n      RowMetaAndData elementTypeRow = delegate.getElementType( elementTypeId );\n\n      return delegate.parseElementType( namespace, namespaceId, elementTypeRow );","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/kdr/delegates/metastore/KettleDatabaseRepositoryMetaStore.java#L195-L231","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Validate elementTypeId is a proper ObjectId string (obtain it from getElementTypeIds/getElementType, not a name).","Verify the id exists: getElementTypeIds(namespace).contains(elementTypeId) before lookup.","Confirm you are connected to the same repository the id was issued from.","Inspect the cause exception for JDBC/parse details and fix the repository connection or data."],"exampleFix":"// before\nIMetaStoreElementType t = metastore.getElementType(namespace, \"MyTypeName\"); // name, not id\n\n// after\nString id = metastore.getElementTypeIds(namespace).stream()\n  .filter(i -> name.equals(metastore.getElementType(namespace, i).getName()))\n  .findFirst().orElse(null);\nIMetaStoreElementType t = id == null ? null : metastore.getElementType(namespace, id);","handlingStrategy":"validation","validationCode":"if (elementTypeId == null || !metastore.getElementTypeIds(namespace).contains(elementTypeId)) {\n  throw new IllegalArgumentException(\"Unknown element type id: \" + elementTypeId);\n}","typeGuard":null,"tryCatchPattern":"try {\n  return metastore.getElementType(namespace, elementTypeId);\n} catch (MetaStoreException e) {\n  throw new IllegalArgumentException(\"Bad id or repository failure: \" + e.getCause(), e);\n}","preventionTips":["Only pass ids obtained from getElementIds/getElementType, never names","Persist full ObjectId strings without truncation","Use the same repository that issued the id"],"tags":["metastore","lookup","object-id","repository"],"backgroundTag":"invalid-identifier-format","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"}