pentaho/pentaho-kettle · error · MetaStoreException

Unable to get list of elements from namespace

Error message

Unable to get list of elements from namespace '<namespace>' and for element type '<elementTypeName>'

What it means

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.

Solutions

  1. Check e.getCause() for the JDBC/parse error and fix the repository connection or data.
  2. Ensure the elementType was loaded from the same namespace via getElementTypeByName/getElementType (fresh id).
  3. Verify repository schema matches your Pentaho version (run repository upgrade).
  4. Retry the listing after connectivity is restored.

Example fix

// before
List<IMetaStoreElement> els = metastore.getElements(namespace, staleType); // throws

// after
IMetaStoreElementType fresh = metastore.getElementTypeByName(namespace, staleType.getName());
List<IMetaStoreElement> els = fresh == null ? Collections.emptyList() : metastore.getElements(namespace, fresh);
Defensive patterns

Strategy: try-catch

Validate before calling

IMetaStoreElementType fresh = metastore.getElementTypeByName(namespace, elementType.getName());
if (fresh == null) return Collections.emptyList();

Try / catch

try {
  return metastore.getElements(namespace, elementType);
} catch (MetaStoreException e) {
  log.error("Element listing failed: {}", e.getCause(), e);
  return Collections.emptyList();
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/00f60ff055c22734. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/repository/kdr/delegates/metastore/KettleDatabaseRepositoryMetaStore.java:309

  }

  @Override
  public List<IMetaStoreElement> getElements( String namespace, IMetaStoreElementType elementType ) throws MetaStoreException {
    try {
      IMetaStoreElementType type = getElementTypeByName( namespace, elementType.getName() );
      if ( type == null ) {
        return new ArrayList<IMetaStoreElement>();
      }
      Collection<RowMetaAndData> elementRows =
        delegate.getElements( new LongObjectId( new StringObjectId( type.getId() ) ) );
      List<IMetaStoreElement> elements = new ArrayList<IMetaStoreElement>();
      for ( RowMetaAndData elementRow : elementRows ) {
        IMetaStoreElement element = delegate.parseElement( elementType, elementRow );
        elements.add( element );
      }
      return elements;
    } catch ( Exception e ) {
      throw new MetaStoreException( "Unable to get list of elements from namespace '"
        + namespace + "' and for element type '" + elementType.getName() + "'", e );
    }
  }

  @Override
  public List<String> getElementIds( String namespace, IMetaStoreElementType elementType ) throws MetaStoreException {
    List<String> ids = new ArrayList<String>();
    List<IMetaStoreElement> elements = getElements( namespace, elementType );
    for ( IMetaStoreElement element : elements ) {
      ids.add( element.getId() );
    }
    return ids;
  }

  @Override
  public IMetaStoreElement getElement( String namespace, IMetaStoreElementType elementType, String elementId ) throws MetaStoreException {
    try {
      RowMetaAndData elementRow = delegate.getElement( new LongObjectId( new StringObjectId( elementId ) ) );

View on GitHub (pinned to f3058517a1)