pentaho/pentaho-kettle · error · KettleException

JsonInput.Exception.CouldnotFindField

JsonInput.Exception.CouldnotFindField

Error message

JsonInput.Exception.CouldnotFindField

What it means

JsonInput throws KettleException with key JsonInput.Exception.CouldnotFindField when the configured source field (meta.getFieldValue()) cannot be found in the incoming row metadata (indexOfValue returns -1). It logs JsonInput.Log.ErrorFindingField with the field name first.

Solutions

  1. Verify the exact field name in 'Field value' matches the upstream output (watch case).
  2. Preview the previous step's output to confirm the field exists and copy its exact name.
  3. Re-run 'Get Fields' in the JSON Input step to refresh available fields.
  4. If an upstream rename was intentional, update the field reference in this step.

Example fix

// before: field name that no longer exists upstream
meta.setFieldValue( "JsonColumn" );
// after: exact name as produced by the previous step
meta.setFieldValue( "jsonColumn" );
Defensive patterns

Strategy: validation

Validate before calling

RowMetaInterface prev = transMeta.getPrevStepFields(jsonInputStep);
if (prev.indexOfValue(meta.getFieldValue()) < 0) {
  throw new IllegalArgumentException("Field '" + meta.getFieldValue() + "' not present in input rows");
}

Try / catch

try { trans.execute(...); } catch (KettleException e) { if (e.getMessage().contains("CouldnotFindField")) { /* fix the field reference or upstream rename */ } }

Prevention

When it happens

Trigger: prepareToRowProcessing, called from the first processRow, looks up the configured field name in getInputRowMeta() and does not find it.

Common situations: Upstream step renamed or removed the field; case-sensitivity mismatch in the field name; transformation restructured so the JSON Input step no longer receives the field.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at plugins/json/core/src/main/java/org/pentaho/di/trans/steps/jsoninput/JsonInput.java:175

      if ( data.inputRowMeta == null ) {
        data.hasFirstRow = false;
        return;
      }
      data.hasFirstRow = true;
      data.outputRowMeta = data.inputRowMeta.clone();

      // Check if source field is provided
      if ( Utils.isEmpty( meta.getFieldValue() ) ) {
        logError( BaseMessages.getString( PKG, "JsonInput.Log.NoField" ) );
        throw new KettleException( BaseMessages.getString( PKG, "JsonInput.Log.NoField" ) );
      }

      // cache the position of the field
      if ( data.indexSourceField < 0 ) {
        data.indexSourceField = getInputRowMeta().indexOfValue( meta.getFieldValue() );
        if ( data.indexSourceField < 0 ) {
          logError( BaseMessages.getString( PKG, "JsonInput.Log.ErrorFindingField", meta.getFieldValue() ) );
          throw new KettleException( BaseMessages.getString( PKG, "JsonInput.Exception.CouldnotFindField",
            meta.getFieldValue() ) );
        }
      }

      // if RemoveSourceField option is set, we remove the source field from the output meta
      if ( meta.isRemoveSourceField() ) {
        data.outputRowMeta.removeValueMeta( data.indexSourceField );
        // Get total previous fields minus one since we remove source field
        data.totalpreviousfields = data.inputRowMeta.size() - 1;
      } else {
        // Get total previous fields
        data.totalpreviousfields = data.inputRowMeta.size();
      }
    }
    meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,
                    metaStore );

    // Create convert meta-data objects that will contain Date & Number formatters

View on GitHub (pinned to f3058517a1)