pentaho/pentaho-kettle · error · KettleException

AccessInput.Exception.CouldnotFindField

AccessInput.Exception.CouldnotFindField

Error message

AccessInput.Exception.CouldnotFindField

What it means

KettleException thrown in AccessInput.openNextFile when the configured dynamic filename field does not exist in the incoming row stream. indexOfValue returned -1, meaning the field name set in the dialog matches no field produced by the previous step.

Solutions

  1. Open the Access Input step dialog and re-select the correct filename field from the available fields.
  2. Check the upstream step's output fields (preview rows) and confirm the field name matches exactly, including case.
  3. Add or fix the upstream step so it emits the filename field before the Access Input step.

Example fix

// before: Filename field = "Filename"  (upstream emits "filename")
// after:  Filename field = "filename"
meta.setDynamicFilenameField( "filename" );
Defensive patterns

Strategy: validation

Validate before calling

// verify the configured field exists in the incoming row layout
int idx = inputRowMeta.indexOfValue( meta.getDynamicFilenameField() );
if ( idx < 0 ) {
  throw new IllegalArgumentException( "Field '"
    + meta.getDynamicFilenameField() + "' not found in input row: "
    + Arrays.toString( inputRowMeta.getFieldNames() ) );
}

Try / catch

try { /* run transformation */ } catch ( KettleException e ) { if ( e.getMessage().contains( meta.getDynamicFilenameField() ) ) { logError( "Re-select the filename field in the Access Input step" ); } }

Prevention

When it happens

Trigger: getInputRowMeta().indexOfValue(meta.getDynamicFilenameField()) < 0: the filename field name configured in the Access Input step is misspelled, or the upstream step was changed/renamed/removed so the field no longer exists in the row layout.

Common situations: Renaming an upstream Select Values / Text File Input field without updating Access Input; the previous step outputs the path under a different name than configured; transformations edited by hand where the field name string drifted.

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

Appendix: source

Thrown at plugins/ms-access/impl/src/main/java/org/pentaho/di/trans/steps/accessinput/AccessInput.java:277

            ValueMetaInterface valueMeta = data.convertRowMeta.getValueMeta( i );
            data.convertRowMeta.setValueMeta( i, ValueMetaFactory.cloneValueMeta(
              valueMeta, ValueMetaInterface.TYPE_STRING ) );
          }

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

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

        } // End if first

        String filename = getInputRowMeta().getString( data.readrow, data.indexOfFilenameField );
        if ( log.isDetailed() ) {
          logDetailed( BaseMessages.getString( PKG, "AccessInput.Log.FilenameInStream", meta
            .getDynamicFilenameField(), filename ) );
        }

        data.file = KettleVFS.getInstance( getTransMeta().getBowl() ).getFileObject( filename, getTransMeta() );
        // Check if file exists!
      }
      // Add additional fields?
      if ( meta.getShortFileNameField() != null && meta.getShortFileNameField().length() > 0 ) {
        data.shortFilename = data.file.getName().getBaseName();

View on GitHub (pinned to f3058517a1)