pentaho/pentaho-kettle · error · MetaStoreException

Unable to update element type: no id was provided and the…

Error message

Unable to update element type: no id was provided and the name '<name>' didn't match

What it means

Thrown by updateElementType when neither a usable element type id could be determined nor the name matched an existing type, so there is nothing to update. The method tries to resolve the id from elementType.getId(); failing that it looks the id up by name, and if that also fails it throws this MetaStoreException. Effectively the target type does not exist under the given id or name.

Solutions

  1. Set the id: fetch the existing type with getElementTypeByName(namespace, name) and copy its id into the object before updating.
  2. Create the type instead if it truly does not exist (createElementType).
  3. Verify the namespace is correct so the name lookup can resolve.
  4. Log elementType.getId()/getName() before calling to confirm which one is stale.

Example fix

// before
metastore.updateElementType(namespace, new KDBRMetaStoreElementType(...)); // no id, name unknown

// after
IMetaStoreElementType existing = metastore.getElementTypeByName(namespace, elementType.getName());
if (existing == null) {
  metastore.createElementType(namespace, elementType);
} else {
  elementType.setId(existing.getId());
  metastore.updateElementType(namespace, elementType);
}
Defensive patterns

Strategy: validation

Validate before calling

if (elementType.getId() == null
    && metastore.getElementTypeByName(namespace, elementType.getName()) == null) {
  throw new IllegalStateException("No element type to update: id null and name unresolved");
}

Try / catch

try {
  metastore.updateElementType(namespace, elementType);
} catch (MetaStoreException e) {
  IMetaStoreElementType existing = metastore.getElementTypeByName(namespace, elementType.getName());
  if (existing == null) metastore.createElementType(namespace, elementType);
}

Prevention

When it happens

Trigger: Calling updateElementType(namespace, elementType) with an elementType whose getId() is null AND whose getName() does not resolve to an existing element type in that namespace.

Common situations: Updating a freshly constructed IMetaStoreElementType object that was never persisted (no id assigned); the type was renamed elsewhere so the stale name no longer matches; pointing at the wrong namespace where the name is absent.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


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

Appendix: source

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

  @Override
  public void updateElementType( String namespace, IMetaStoreElementType elementType ) throws MetaStoreException {
    try {
      ObjectId namespaceId = delegate.verifyNamespace( namespace );
      String elementTypeId = elementType.getId();
      if ( elementTypeId == null ) {
        IMetaStoreElementType type = getElementTypeByName( namespace, elementType.getName() );
        if ( type != null ) {
          elementTypeId = type.getId();
        }
      }

      if ( elementTypeId != null ) {
        delegate.updateElementType(
          namespaceId, new LongObjectId( new StringObjectId( elementType.getId() ) ), elementType );
        repository.commit();
      } else {
        throw new MetaStoreException( "Unable to update element type: no id was provided and the name '"
          + elementType.getName() + "' didn't match" );
      }
    } catch ( MetaStoreException e ) {
      throw e;
    } catch ( Exception e ) {
      repository.rollback();
      throw new MetaStoreException( "Unable to update element type", e );
    }
  }

  @Override
  public void deleteElementType( String namespace, IMetaStoreElementType elementType ) throws MetaStoreException,
    MetaStoreDependenciesExistsException {
    try {
      Collection<RowMetaAndData> elementTypeRows =
        delegate.getElements( new LongObjectId( new StringObjectId( elementType.getId() ) ) );
      if ( !elementTypeRows.isEmpty() ) {
        List<String> dependencies = new ArrayList<String>();

View on GitHub (pinned to f3058517a1)