pentaho/pentaho-kettle · error · KettleStepException

It was not possible to find table

Error message

It was not possible to find table [<tablenameField>] in the input fields.

What it means

Thrown during processRow() initialization when 'table name defined in a field' is enabled but the configured table-name field cannot be found among the input row's fields (indexOfValue returns -1). The step logs the message and throws a KettleStepException before processing any rows.

Solutions

  1. Open the step dialog and re-select the table-name field from the actual input fields (fix typo/case).
  2. Check the previous step's output fields (preview) to confirm the field exists with the exact name.
  3. If upstream was changed, add a 'Select values' step to rename/recreate the expected field.
  4. If the table is actually static, disable 'table name defined in a field' and enter the table name directly.

Example fix

// before (dialog)
tablenameField: "TableName "  // trailing space
// after
tablenameField: "TableName"
Defensive patterns

Strategy: validation

Validate before calling

// In the dialog/metadata, assert the field exists in the input layout
List<String> fields = inputRowMeta.getFieldNames();
if (!fields.contains(tableNameField)) {
  throw new ValidationException("Field not in input stream: " + tableNameField);
}

Try / catch

catch (KettleStepException e) {
  if (e.getMessage().contains("not possible to find table")) {
    logError("Check the table-name field setting against upstream fields.");
  }
  throw e;
}

Prevention

When it happens

Trigger: meta.istablenameInField() is true; data.inputRowMeta.indexOfValue(meta.gettablenameField()) < 0 — i.e. the field name typed in the dialog does not exist in the incoming stream (typo, renamed upstream, case mismatch, field removed).

Common situations: Upstream step renamed or dropped the column; user typed the field name with wrong case or extra spaces; connecting the step to a different hop than intended; metadata ETL migration where the field mapping changed.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/synchronizeaftermerge/SynchronizeAfterMerge.java:670

      return false;
    }

    if ( first ) {
      first = false;
      data.outputRowMeta = getInputRowMeta().clone();
      data.inputRowMeta = data.outputRowMeta;
      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,
        metaStore );

      if ( meta.istablenameInField() ) {
        // Cache the position of the table name field
        if ( data.indexOfTableNameField < 0 ) {
          data.indexOfTableNameField = data.inputRowMeta.indexOfValue( meta.gettablenameField() );
          if ( data.indexOfTableNameField < 0 ) {
            String message =
              "It was not possible to find table [" + meta.gettablenameField() + "] in the input fields.";
            logError( message );
            throw new KettleStepException( message );
          }
        }
      } else {
        data.realTableName = environmentSubstitute( meta.getTableName() );
        if ( Utils.isEmpty( data.realTableName ) ) {
          throw new KettleStepException( "The table name is not specified (or the input field is empty)" );
        }
        data.realSchemaTable =
          data.db.getDatabaseMeta().getQuotedSchemaTableCombination( data.realSchemaName, data.realTableName );
      }

      // Cache the position of the operation order field
      if ( data.indexOfOperationOrderField < 0 ) {
        data.indexOfOperationOrderField = data.inputRowMeta.indexOfValue( meta.getOperationOrderField() );
        if ( data.indexOfOperationOrderField < 0 ) {
          String message =
            "It was not possible to find operation field [" + meta.getOperationOrderField()
              + "] in the input stream!";

View on GitHub (pinned to f3058517a1)