pentaho/pentaho-kettle · error · KettleException

Field [ ] is specified at least twice! (position and ...)

Error message

Field [{0}] is specified at least twice! (position {1} and {2} ...)

What it means

SetValueConstant.processRow() throws KettleException 'SetValueConstant.Log.FieldSpecifiedMoreThatOne' when the same field name is configured more than once in the step. Duplicate replacement targets would cause non-deterministic overwrite order, so the step refuses to run.

Solutions

  1. Open the 'Set Value Constant' step and delete/merge the duplicate field rows
  2. Compare field names case-insensitively — 'Name' and 'name' still collide
  3. Re-save the transformation and re-run
  4. If both constants are intentionally different, use two chained steps

Example fix

// before
fields: [{name:'status', value:'A'}, {name:'STATUS', value:'B'}]
// after
fields: [{name:'status', value:'B'}]
Defensive patterns

Strategy: validation

Validate before calling

java.util.Set<String> seen = new java.util.HashSet<>();
for (SetValueConstantMeta.Field f : meta.getField()) {
  if (f.getFieldName() != null && !seen.add(f.getFieldName().toLowerCase()))
    throw new IllegalStateException("Duplicate field configured: " + f.getFieldName());
}

Try / catch

try { step.processRow(); } catch (KettleException e) { if (e.getMessage().contains("specified at least twice")) { /* reconfigure fields */ } else throw e; }

Prevention

When it happens

Trigger: First row processing (first==true) when the inner loop finds two Field entries with equal (case-insensitive, non-null) field names in the step's field list.

Common situations: Hand-editing the transformation XML or duplicating a row in the Fields grid; merging transformations that both set a constant on the same field.

Understand the failure class

Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/setvalueconstant/SetValueConstant.java:87

      // Create convert meta-data objects that will contain Date & Number formatters
      // data.convertRowMeta = data.outputRowMeta.clone();

      // For String to <type> conversions, we allocate a conversion meta data row as well...
      //
      data.setConvertRowMeta( data.getOutputRowMeta().cloneToType( ValueMetaInterface.TYPE_STRING ) );

      // Consider only selected fields
      List<SetValueConstantMeta.Field> fields = meta.getFields();
      int size = fields.size();
      if ( !Utils.isEmpty( fields ) ) {
        data.setFieldnrs( new int[size] );
        data.setRealReplaceByValues( new String[size] );
        for ( int i = 0; i < size; i++ ) {
          // Check if this field was specified only one time
          final SetValueConstantMeta.Field check = fields.get( i );
          for ( SetValueConstantMeta.Field field : fields ) {
            if ( field.getFieldName() != null && field != check && field.getFieldName().equalsIgnoreCase( check.getFieldName() ) ) {
              throw new KettleException( BaseMessages.getString( PKG, "SetValueConstant.Log"
                      + ".FieldSpecifiedMoreThatOne", check.getFieldName() ) );
            }
          }

          data.getFieldnrs()[i] = data.getOutputRowMeta().indexOfValue( meta.getField( i ).getFieldName() );

          if ( data.getFieldnrs()[i] < 0 ) {
            logError( BaseMessages.getString( PKG, "SetValueConstant.Log.CanNotFindField", meta.getField( i ).getFieldName() ) );
            throw new KettleException( BaseMessages.getString( PKG, "SetValueConstant.Log.CanNotFindField", meta
              .getField( i ).getFieldName() ) );
          }

          if ( meta.getField( i ).isEmptyString() ) {
            // Just set empty string
            data.getRealReplaceByValues()[i] = StringUtil.EMPTY_STRING;
          } else {
            // set specified value
            if ( meta.isUseVars() ) {

View on GitHub (pinned to f3058517a1)