{"record":{"id":"797c012510f513f0","repo":"pentaho/pentaho-kettle","slug":"unable-to-get-element-type-with-name-elementtypename-in","errorCode":null,"errorMessage":"Unable to get element type with name '<elementTypeName>' in namespace '<namespace>'","messagePattern":"Unable to get element type with name '<elementTypeName>' 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":233,"sourceCode":"    }\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 );\n    } catch ( Exception e ) {\n      throw new MetaStoreException( \"Unable to get element type with name '\"\n        + elementTypeName + \"' in namespace '\" + namespace + \"'\", e );\n    }\n  }\n\n  @Override\n  public void updateElementType( String namespace, IMetaStoreElementType elementType ) throws MetaStoreException {\n    try {\n      ObjectId namespaceId = delegate.verifyNamespace( namespace );\n      String elementTypeId = elementType.getId();\n      if ( elementTypeId == null ) {\n        IMetaStoreElementType type = getElementTypeByName( namespace, elementType.getName() );\n        if ( type != null ) {\n          elementTypeId = type.getId();\n        }\n      }\n\n      if ( elementTypeId != null ) {\n        delegate.updateElementType(","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/kdr/delegates/metastore/KettleDatabaseRepositoryMetaStore.java#L215-L251","documentation":"Thrown by getElementTypeByName when an exception (not a simple miss) occurs while resolving an element type by name in a namespace. The lookup flow verifies the namespace, finds the type id by name, and parses the row; any failure in those delegate calls is wrapped in MetaStoreException. A name that simply does not exist returns null instead of throwing.","triggerScenarios":"Calling getElementTypeByName(namespace, elementTypeName) where the namespace verification, id-by-name query, or delegate.parseElementType throws — e.g. repository connectivity failure or corrupted rows for that namespace.","commonSituations":"Repository database outage or dropped connection while resolving types; orphaned/corrupt R_ELEMENT_TYPE rows after an interrupted migration; passing null name into the lookup against a flaky repository.","solutions":["Check e.getCause() for the underlying JDBC failure and restore the repository connection.","Distinguish miss-vs-failure: a null return means not found; only exceptions trigger this error — retry after connectivity is restored.","Verify namespace exists via getNamespaceIds() before lookup to rule out namespace-level problems.","Repair corrupted repository tables with Pentaho repository maintenance/upgrade tooling."],"exampleFix":"// before\nIMetaStoreElementType t = metastore.getElementTypeByName(namespace, typeName); // may throw\n\n// after\ntry {\n  IMetaStoreElementType t = metastore.getElementTypeByName(namespace, typeName);\n} catch (MetaStoreException e) {\n  throw new RuntimeException(\"Repository failure resolving '\" + typeName + \"': \" + e.getCause(), e);\n}","handlingStrategy":"try-catch","validationCode":"if (!metastore.getNamespaceIds().contains(namespace)) {\n  return null; // namespace absent -> type can't exist\n}","typeGuard":null,"tryCatchPattern":"try {\n  return metastore.getElementTypeByName(namespace, name);\n} catch (MetaStoreException e) {\n  log.error(\"Repository failure resolving '{}': {}\", name, e.getCause(), e);\n  return null;\n}","preventionTips":["Treat null as not-found; exceptions as repository failures","Check namespace existence before type lookups","Repair corrupted repository tables promptly"],"tags":["metastore","lookup","repository","database"],"backgroundTag":"database-query-failed","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"}