{"record":{"id":"10087c07839ea701","repo":"pentaho/pentaho-kettle","slug":"reference-key-0-value-is-null-while-the-compare-value-is-not","errorCode":null,"errorMessage":"Reference key '{0}': value is null while the compare value is not null","messagePattern":"Reference key '(.+?)': value is null while the compare value is not null","errorType":"validation","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/step/StepInjectionUtil.java","lineNumber":108,"sourceCode":"    if ( refEntries.size() != cmpEntries.size() ) {\n      throw new KettleException( \"The number of reference entries (\" + refEntries.size()\n        + \") is not the same as the number of compare entries(\" + cmpEntries.size() + \")\" );\n    }\n\n    for ( int i = 0; i < refEntries.size(); i++ ) {\n      StepInjectionMetaEntry refEntry = refEntries.get( i );\n      StepInjectionMetaEntry cmpEntry = cmpEntries.get( i );\n      if ( cmpEntry.getValueType() == ValueMetaInteger.TYPE_NONE ) {\n        compareEntryValues( refEntry.getDetails(), cmpEntry.getDetails() );\n      } else {\n        Object ref = refEntry.getValue();\n        Object cmp = cmpEntry.getValue();\n        if ( ref != null && cmp == null ) {\n          throw new KettleException( \"Reference key '\" + refEntry.getKey()\n            + \"': value is not null while the compare value is null\" );\n        }\n        if ( ref == null && cmp != null ) {\n          throw new KettleException( \"Reference key '\" + refEntry.getKey()\n            + \"': value is null while the compare value is not null\" );\n        }\n        if ( ref != null && cmp != null ) {\n          if ( !ref.equals( cmp ) ) {\n            throw new KettleException( \"Reference key '\" + refEntry.getKey()\n              + \"': reference value '\" + ref + \"' is not equal to '\" + cmp + \"'\" );\n          }\n        }\n      }\n    }\n  }\n}\n","sourceCodeStart":90,"sourceCodeEnd":121,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/step/StepInjectionUtil.java#L90-L121","documentation":"The mirror case of the null-vs-not-null check in StepInjectionUtil.compareEntryValues: the reference entry's value is null while the compare entry carries a value. The compared metadata contains a setting the reference does not have, so the trees differ and a KettleException is thrown.","triggerScenarios":"compareEntryValues on leaf entries where refEntry.getValue() == null but cmpEntry.getValue() != null for the same key.","commonSituations":"The compare transformation has an extra/overridden setting (e.g. a default changed, or a user set a value the reference snapshot left empty), or plugin defaults changed between versions.","solutions":["Clear the extra value in the compared transformation for the key named in the message.","Update the reference snapshot if the new value is intended.","Verify both sides use the same plugin version so defaults match."],"exampleFix":"// before\ncompareEntryValues(ref, modifiedMetaEntries); // modifiedMeta has extra value\n// after\nmodifiedMeta.deleteExtraSetting(key); compareEntryValues(ref, modifiedMeta.getStepInjectionMetadataEntries());","handlingStrategy":"validation","validationCode":"// Pre-check for unexpected values on the compare side\nfor (int i = 0; i < refEntries.size(); i++) {\n  StepInjectionMetaEntry r = refEntries.get(i), c = cmpEntries.get(i);\n  if (c.getValueType() != ValueMetaInterface.TYPE_NONE && r.getValue() == null && c.getValue() != null) {\n    log.warn(\"Unexpected compare value for key \" + r.getKey());\n  }\n}","typeGuard":null,"tryCatchPattern":"try { StepInjectionUtil.compareEntryValues(ref, cmp); } catch (KettleException e) { if (e.getMessage().contains(\"value is null while the compare value is not null\")) { log.error(\"Compared transformation has an extra value: \" + e.getMessage()); } else { throw e; } }","preventionTips":["Reset compared transformations to defaults before diffing","Document which keys are allowed to be non-null in the reference","Regenerate the reference when plugin defaults change"],"tags":["kettle","metadata-injection","comparison","null-value"],"backgroundTag":"unexpected-response-shape","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}