{"record":{"id":"00f60ff055c22734","repo":"pentaho/pentaho-kettle","slug":"unable-to-get-list-of-elements-from-namespace-namespace-and","errorCode":null,"errorMessage":"Unable to get list of elements from namespace '<namespace>' and for element type '<elementTypeName>'","messagePattern":"Unable to get list of elements from namespace '<namespace>' and for element type '<elementTypeName>'","errorType":"exception","errorClass":"MetaStoreException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/kdr/delegates/metastore/KettleDatabaseRepositoryMetaStore.java","lineNumber":309,"sourceCode":"  }\n\n  @Override\n  public List<IMetaStoreElement> getElements( String namespace, IMetaStoreElementType elementType ) throws MetaStoreException {\n    try {\n      IMetaStoreElementType type = getElementTypeByName( namespace, elementType.getName() );\n      if ( type == null ) {\n        return new ArrayList<IMetaStoreElement>();\n      }\n      Collection<RowMetaAndData> elementRows =\n        delegate.getElements( new LongObjectId( new StringObjectId( type.getId() ) ) );\n      List<IMetaStoreElement> elements = new ArrayList<IMetaStoreElement>();\n      for ( RowMetaAndData elementRow : elementRows ) {\n        IMetaStoreElement element = delegate.parseElement( elementType, elementRow );\n        elements.add( element );\n      }\n      return elements;\n    } catch ( Exception e ) {\n      throw new MetaStoreException( \"Unable to get list of elements from namespace '\"\n        + namespace + \"' and for element type '\" + elementType.getName() + \"'\", e );\n    }\n  }\n\n  @Override\n  public List<String> getElementIds( String namespace, IMetaStoreElementType elementType ) throws MetaStoreException {\n    List<String> ids = new ArrayList<String>();\n    List<IMetaStoreElement> elements = getElements( namespace, elementType );\n    for ( IMetaStoreElement element : elements ) {\n      ids.add( element.getId() );\n    }\n    return ids;\n  }\n\n  @Override\n  public IMetaStoreElement getElement( String namespace, IMetaStoreElementType elementType, String elementId ) throws MetaStoreException {\n    try {\n      RowMetaAndData elementRow = delegate.getElement( new LongObjectId( new StringObjectId( elementId ) ) );","sourceCodeStart":291,"sourceCodeEnd":327,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/kdr/delegates/metastore/KettleDatabaseRepositoryMetaStore.java#L291-L327","documentation":"Wrapper thrown by getElements when listing all elements of an element type fails unexpectedly in the database repository metastore. Any delegate failure — resolving the type id, querying element rows, or parseElement — is wrapped in MetaStoreException with namespace and type name included. An empty type returns an empty list rather than throwing.","triggerScenarios":"Calling getElements(namespace, elementType) when delegate.getElementType/parseElement throws: malformed elementType object (no id), broken repository connection, or rows that fail to parse into KDBRMetaStoreElement.","commonSituations":"elementType obtained from a different namespace/repo so its id does not resolve; JDBC connection dropped mid-list; corrupted R_ELEMENT rows after a failed write; version-mismatched repository schema.","solutions":["Check e.getCause() for the JDBC/parse error and fix the repository connection or data.","Ensure the elementType was loaded from the same namespace via getElementTypeByName/getElementType (fresh id).","Verify repository schema matches your Pentaho version (run repository upgrade).","Retry the listing after connectivity is restored."],"exampleFix":"// before\nList<IMetaStoreElement> els = metastore.getElements(namespace, staleType); // throws\n\n// after\nIMetaStoreElementType fresh = metastore.getElementTypeByName(namespace, staleType.getName());\nList<IMetaStoreElement> els = fresh == null ? Collections.emptyList() : metastore.getElements(namespace, fresh);","handlingStrategy":"try-catch","validationCode":"IMetaStoreElementType fresh = metastore.getElementTypeByName(namespace, elementType.getName());\nif (fresh == null) return Collections.emptyList();","typeGuard":null,"tryCatchPattern":"try {\n  return metastore.getElements(namespace, elementType);\n} catch (MetaStoreException e) {\n  log.error(\"Element listing failed: {}\", e.getCause(), e);\n  return Collections.emptyList();\n}","preventionTips":["Use freshly loaded element types (valid ids) when listing","Keep repository schema and client versions aligned","Log getCause() to diagnose JDBC/parse failures"],"tags":["metastore","elements","listing","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"}