pentaho/pentaho-kettle · error · KettleException

CreditCardValidator.Error.CardFieldMissing

CreditCardValidator.Error.CardFieldMissing

Error message

CreditCardValidator.Error.CardFieldMissing

What it means

The Credit Card Validator step validates credit card numbers found in a stream field. During processRow initialization it requires the step metadata to name the input field containing the card number (dynamicField). If that field is empty, it logs the CardFieldMissing message and throws a KettleException, aborting the step.

Solutions

  1. Open the step dialog and set the 'field name to validate' to an existing input field
  2. Verify the saved transformation XML contains <field_to_validate> with a value
  3. Set the field programmatically via meta.setDynamicField("card_number") before execution

Example fix

// before
meta.setDynamicField(null);
// after
meta.setDynamicField("card_number"); // must exist in the input stream
Defensive patterns

Strategy: validation

Validate before calling

if (meta.getDynamicField() == null || meta.getDynamicField().isEmpty()) throw new IllegalArgumentException("Set the field to validate before running");

Try / catch

try { step.processRow(); } catch (KettleException e) { logError("Validator misconfigured: " + e.getMessage()); }

Prevention

When it happens

Trigger: Running a transformation where the CreditCardValidator step was configured without setting the 'field name to validate' in the step dialog.

Common situations: Kettle metadata XML/repertoire entry missing the dynamicField attribute; cloning a step and forgetting to configure it; environment substitution yielding an empty value.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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

Appendix: source

Thrown at plugins/credit-card-validator/impl/src/main/java/org/pentaho/di/trans/steps/creditcardvalidator/CreditCardValidator.java:80

    boolean isValid = false;
    String cardType = null;
    String unValid = null;

    if ( first ) {
      first = false;

      // get the RowMeta
      data.previousRowMeta = getInputRowMeta().clone();
      data.NrPrevFields = data.previousRowMeta.size();
      data.outputRowMeta = data.previousRowMeta;
      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,
        metaStore );

      // Check if field is provided
      if ( Utils.isEmpty( meta.getDynamicField() ) ) {
        logError( BaseMessages.getString( PKG, "CreditCardValidator.Error.CardFieldMissing" ) );
        throw new KettleException( BaseMessages.getString( PKG, "CreditCardValidator.Error.CardFieldMissing" ) );
      }

      // cache the position of the field
      if ( data.indexOfField < 0 ) {
        data.indexOfField = getInputRowMeta().indexOfValue( meta.getDynamicField() );
        if ( data.indexOfField < 0 ) {
          // The field is unreachable !
          throw new KettleException( BaseMessages.getString(
            PKG, "CreditCardValidator.Exception.CouldnotFindField", meta.getDynamicField() ) );
        }
      }
      data.realResultFieldname = environmentSubstitute( meta.getResultFieldName() );
      if ( Utils.isEmpty( data.realResultFieldname ) ) {
        throw new KettleException( BaseMessages
          .getString( PKG, "CreditCardValidator.Exception.ResultFieldMissing" ) );
      }
      data.realCardTypeFieldname = environmentSubstitute( meta.getCardType() );
      data.realNotValidMsgFieldname = environmentSubstitute( meta.getNotValidMsg() );

View on GitHub (pinned to f3058517a1)