pentaho/pentaho-kettle · error · KettleException

GetTableNames.Exception.CouldnotFindField

GetTableNames.Exception.CouldnotFindField

Error message

GetTableNames.Exception.CouldnotFindField

What it means

processRow looks up the configured schema fieldname in the incoming row's RowMeta via indexOfValue. If the field is not present in the row stream, the step throws this KettleException indicating the configured field could not be found. Unlike error 1511, the field name IS configured — it just doesn't exist in the incoming rows.

Solutions

  1. Verify the 'schema fieldname' exactly matches (including case) a field produced by the previous step.
  2. Inspect the input rows with a 'Fields' preview or a dummy/log step to list actual incoming field names.
  3. Insert a 'Select values' / 'Rename' step to create or rename the expected field upstream.
  4. Reorder hops so the field-producing step executes before Get Table Names.

Example fix

// before: mismatched field name
meta.setSchemaFieldName( "SchemName" ); // typo, not in row stream
// after
meta.setSchemaFieldName( "schemaName" ); // matches field from previous step exactly
Defensive patterns

Strategy: validation

Validate before calling

// before executing
String field = meta.getSchemaFieldName();
if ( field != null && prevRowMeta.indexOfValue( field ) < 0 ) {
  throw new IllegalArgumentException( "Field not in input stream: " + field );
}

Try / catch

try {
  trans.execute( null );
} catch ( KettleException e ) {
  if ( e.getMessage().contains( "CouldnotFindField" ) ) {
    logError( "Verify field name and upstream step order" );
  }
}

Prevention

When it happens

Trigger: meta.getSchemaFieldName() is non-empty but data.inputRowMeta.indexOfValue(name) returns -1, i.e. no preceding step produces a field with exactly that name (case-sensitive match) when the Get Table Names step executes.

Common situations: Typo in the schema fieldname setting; upstream step renamed or removed the field; wrong hop order so the field arrives after this step; field name differs in case (Oracle upper-case vs. Kettle exact match).

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/bb9d8a5722fc4346. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/gettablenames/GetTableNames.java:98

        data.inputRowMeta = getInputRowMeta();
        data.outputRowMeta = data.inputRowMeta.clone();
        // Get total previous fields
        data.totalpreviousfields = data.inputRowMeta.size();

        // Check is filename field is provided
        if ( Utils.isEmpty( meta.getSchemaFieldName() ) ) {
          logError( BaseMessages.getString( PKG, "GetTableNames.Log.NoSchemaField" ) );
          throw new KettleException( BaseMessages.getString( PKG, "GetTableNames.Log.NoSchemaField" ) );
        }

        // cache the position of the field
        if ( data.indexOfSchemaField < 0 ) {
          data.indexOfSchemaField = data.inputRowMeta.indexOfValue( meta.getSchemaFieldName() );
          if ( data.indexOfSchemaField < 0 ) {
            // The field is unreachable !
            logError( BaseMessages.getString( PKG, "GetTableNames.Log.ErrorFindingField" )
              + "[" + meta.getSchemaFieldName() + "]" );
            throw new KettleException( BaseMessages.getString(
              PKG, "GetTableNames.Exception.CouldnotFindField", meta.getSchemaFieldName() ) );
          }
        }

      } else {
        data.outputRowMeta = new RowMeta();
      }

      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,
        metaStore );

    }

    if ( meta.isDynamicSchema() ) {
      // Get value of dynamic schema ...
      data.realSchemaName = data.inputRowMeta.getString( data.readrow, data.indexOfSchemaField );
    }

View on GitHub (pinned to f3058517a1)