pentaho/pentaho-kettle · error · KettleException

Reference key ' ': value is not null while the compare…

Error message

Reference key '{0}': value is not null while the compare value is null

What it means

StepInjectionUtil.compareEntryValues throws this when a leaf entry in the reference metadata has a non-null value but the corresponding compare entry's value is null, i.e. the compared transformation is missing a value that the reference defines.

Solutions

  1. Populate the missing value in the compared transformation for the key named in the message.
  2. Check whether the compare side's step defaults differ from the reference side's saved values.
  3. Re-export the reference entries after confirming both metas were built with the same plugin version.

Example fix

// before
meta.setFilename(null); // value dropped
// after
meta.setFilename("/data/input.csv");
Defensive patterns

Strategy: validation

Validate before calling

// Pre-check for null compare values on leaves
for (int i = 0; i < refEntries.size(); i++) {
  StepInjectionMetaEntry r = refEntries.get(i), c = cmpEntries.get(i);
  if (c.getValueType() != ValueMetaInterface.TYPE_NONE && r.getValue() != null && c.getValue() == null) {
    log.warn("Missing compare value for key " + r.getKey());
  }
}

Try / catch

try { StepInjectionUtil.compareEntryValues(ref, cmp); } catch (KettleException e) { if (e.getMessage().contains("value is not null while the compare value is null")) { log.error("Compared transformation missing a value: " + e.getMessage()); } else { throw e; } }

Prevention

When it happens

Trigger: compareEntryValues on leaf entries (valueType != TYPE_NONE) where refEntry.getValue() != null but cmpEntry.getValue() == null for the same key.

Common situations: A field in the reference transformation (e.g. a step setting or injected field mapping) was left unset in the transformation being compared, or a value was dropped during save/load round-trip.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/step/StepInjectionUtil.java:104

   */
  public static void compareEntryValues( List<StepInjectionMetaEntry> refEntries,
    List<StepInjectionMetaEntry> cmpEntries ) throws KettleException {

    if ( refEntries.size() != cmpEntries.size() ) {
      throw new KettleException( "The number of reference entries (" + refEntries.size()
        + ") is not the same as the number of compare entries(" + cmpEntries.size() + ")" );
    }

    for ( int i = 0; i < refEntries.size(); i++ ) {
      StepInjectionMetaEntry refEntry = refEntries.get( i );
      StepInjectionMetaEntry cmpEntry = cmpEntries.get( i );
      if ( cmpEntry.getValueType() == ValueMetaInteger.TYPE_NONE ) {
        compareEntryValues( refEntry.getDetails(), cmpEntry.getDetails() );
      } else {
        Object ref = refEntry.getValue();
        Object cmp = cmpEntry.getValue();
        if ( ref != null && cmp == null ) {
          throw new KettleException( "Reference key '" + refEntry.getKey()
            + "': value is not null while the compare value is null" );
        }
        if ( ref == null && cmp != null ) {
          throw new KettleException( "Reference key '" + refEntry.getKey()
            + "': value is null while the compare value is not null" );
        }
        if ( ref != null && cmp != null ) {
          if ( !ref.equals( cmp ) ) {
            throw new KettleException( "Reference key '" + refEntry.getKey()
              + "': reference value '" + ref + "' is not equal to '" + cmp + "'" );
          }
        }
      }
    }
  }
}

View on GitHub (pinned to f3058517a1)