pentaho/pentaho-kettle · error · KettleValueException

Unable to find ' ' in the row

Error message

Unable to find '<valueName>' in the row

What it means

removeValue(String) looks up the field index via rowMeta.indexOfValue(); if the field name is absent it throws this KettleValueException instead of silently ignoring the removal. It protects callers from assuming a column existed and was deleted.

Solutions

  1. Check field existence before removing: rowMeta.indexOfValue(valueName) >= 0
  2. Correct the field name spelling/case
  3. Make removal idempotent by guarding the call or catching KettleValueException
  4. Verify upstream steps still emit the field

Example fix

// before
row.removeValue("tempField");
// after
if ( row.getRowMeta().indexOfValue("tempField") >= 0 ) {
  row.removeValue("tempField");
}
Defensive patterns

Strategy: validation

Validate before calling

String[] names = row.getRowMeta().getFieldNames();
boolean exists = java.util.Arrays.asList(names).contains(valueName);
if (!exists) {
  log.warn("Skip removeValue: field " + valueName + " not present");
}

Try / catch

try {
  row.removeValue(valueName);
} catch (KettleValueException e) {
  if (e.getMessage().contains("Unable to find")) {
    log.warn("Field already absent: " + valueName);
  } else throw e;
}

Prevention

When it happens

Trigger: Calling removeValue("name") when the row has no column with that exact name — typo, case mismatch, field already removed, or the field was never produced upstream.

Common situations: Cleanup code removing temporary fields that a previous transformation version produced; double-invoked removal; fields removed earlier by a Select Values step.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


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

Appendix: source

Thrown at core/src/main/java/org/pentaho/di/core/RowMetaAndData.java:428

          return converter.number2long( vn );
        } else if ( boolean.class.isAssignableFrom( destinationType ) ) {
          return converter.number2booleanPrimitive( vn );
        } else if ( Boolean.class.isAssignableFrom( destinationType ) ) {
          return converter.number2boolean( vn );
        } else if ( destinationType.isEnum() ) {
          return converter.number2enum( destinationType, vn );
        } else {
          throw new RuntimeException( "Wrong value conversion to " + destinationType );
        }
    }

    throw new KettleValueException( "Unknown conversion from " + metaType.getTypeDesc() + " into " + destinationType );
  }

  public void removeValue( String valueName ) throws KettleValueException {
    int index = rowMeta.indexOfValue( valueName );
    if ( index < 0 ) {
      throw new KettleValueException( "Unable to find '" + valueName + "' in the row" );
    }
    removeValue( index );
  }

  public void removeValue( int index ) {
    rowMeta.removeValueMeta( index );
    data = RowDataUtil.removeItem( data, index );
  }

  public void mergeRowMetaAndData( RowMetaAndData rowMetaAndData, String originStepName ) {
    int originalMetaSize = rowMeta.size();
    rowMeta.mergeRowMeta( rowMetaAndData.getRowMeta(), originStepName );
    data = RowDataUtil.addRowData( data, originalMetaSize, rowMetaAndData.getData() );
  }
}

View on GitHub (pinned to f3058517a1)