pentaho/pentaho-kettle · error · org.pentaho.di.core.exception.KettleValueException

Unable to find value metadata with name

Error message

Unable to find value metadata with name '${valueName}', so I can't delete it.

What it means

removeValueMeta(String) looks up the field index by name via indexOfValue; if no field with that name exists (index < 0), it throws KettleValueException saying it cannot delete the missing value metadata. The message interpolates the requested name, making it easy to spot typos or case mismatches.

Solutions

  1. Check indexOfValue(valueName) >= 0 before calling removeValueMeta, or wrap the call in try-catch for KettleValueException.
  2. Verify the exact field name/case with searchValueMeta or by logging rowMeta.getFieldNames().
  3. Guard with valueMeta != null / searchValueMeta first to make removal idempotent.
  4. Fix upstream steps that rename or remove the field so it is present when this step runs.

Example fix

// before
rowMeta.removeValueMeta("CustomerID"); // throws if absent
// after
if (rowMeta.indexOfValue("CustomerID") >= 0) {
  rowMeta.removeValueMeta("CustomerID");
}
Defensive patterns

Strategy: validation

Validate before calling

if (rowMeta.indexOfValue(valueName) < 0) {
  log.warn("Field '" + valueName + "' not present; skipping removal");
  return;
}

Try / catch

try {
  rowMeta.removeValueMeta(valueName);
} catch (KettleValueException e) {
  log.warn("Field not found, skipping: " + e.getMessage());
}

Prevention

When it happens

Trigger: rowMeta.removeValueMeta("fieldName") where fieldName is misspelled, differs in case, was already removed, or never existed in this RowMeta (e.g. after a mapping/field-filter step renamed or dropped it upstream).

Common situations: Hardcoded field names drifting from transformation changes; case-sensitive lookups against fields renamed by a Select/Field-mapping step; running removeValueMeta twice on the same name; fields missing because upstream steps produced empty rows.

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/5fe641e6d74aedfd. Report an issue: GitHub.

Appendix: source

Thrown at core/src/main/java/org/pentaho/di/core/row/RowMeta.java:792

  @Override
  public void clear() {
    lock.writeLock().lock();
    try {
      valueMetaList.clear();
      cache.invalidate();
      needRealClone = null;
    } finally {
      lock.writeLock().unlock();
    }
  }

  @Override
  public void removeValueMeta( String valueName ) throws KettleValueException {
    lock.writeLock().lock();
    try {
      int index = indexOfValue( valueName );
      if ( index < 0 ) {
        throw new KettleValueException( "Unable to find value metadata with name '"
          + valueName + "', so I can't delete it." );
      }
      removeValueMeta( index );
    } finally {
      lock.writeLock().unlock();
    }
  }

  @Override
  public void removeValueMeta( int index ) {
    lock.writeLock().lock();
    try {
      ValueMetaInterface old = valueMetaList.remove( index );
      if ( old != null ) {
        cache.removeMapping( old.getName() );
        cache.updateFrom( index, valueMetaList );
      }
      needRealClone = null;

View on GitHub (pinned to f3058517a1)