pentaho/pentaho-kettle · error · KettleException

SyslogMessage.Exception.CouldnotFindField

Error message

SyslogMessage.Exception.CouldnotFindField

What it means

Thrown in SyslogMessage.processRow when the configured message field name cannot be found in the incoming row metadata (indexOfValue returns -1). The field name was specified but the row does not contain it.

Solutions

  1. Set the message fieldname to a field that actually exists in the incoming stream
  2. Check upstream steps (e.g. Select Values, Filter) for renames/removals of the field
  3. Preview upstream rows to confirm field names, then fix the setting
  4. Add a Select Values or User Defined Java Expression step to create the field if missing

Example fix

// before
meta.setMessageFieldName("msg"); // upstream emits "message"
// after
meta.setMessageFieldName("message");
Defensive patterns

Strategy: type-guard

Validate before calling

String field = meta.getMessageFieldName();
if (field != null && inputRowMeta.indexOfValue(field) < 0) { throw new IllegalArgumentException("Field not in stream: " + field); }

Type guard

boolean hasField = (meta.getMessageFieldName() != null) && (getInputRowMeta().indexOfValue(meta.getMessageFieldName()) >= 0);

Try / catch

try { ... } catch (KettleException e) { if (e.getMessage().contains("CouldnotFindField")) { logError("Field missing from incoming rows: " + meta.getMessageFieldName()); setErrors(1); } }

Prevention

When it happens

Trigger: Message fieldname set to a field the upstream step never produces; field renamed upstream; case mismatch in field name; step reading from a stream with different layout than designed.

Common situations: Renaming a field in a Select Values step upstream without updating Syslog Message; wiring the step into a different hop with a different row layout; typos in the field name.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/syslog/SyslogMessage.java:74

    Object[] r = getRow(); // Get row from input rowset & set row busy!
    if ( r == null ) { // no more input to be expected...

      setOutputDone();
      return false;
    }
    if ( first ) {
      first = false;
      // Check if message field is provided
      if ( Utils.isEmpty( meta.getMessageFieldName() ) ) {
        throw new KettleException( BaseMessages.getString( PKG, "SyslogMessage.Error.MessageFieldMissing" ) );
      }

      // cache the position of the source filename field
      data.indexOfMessageFieldName = getInputRowMeta().indexOfValue( meta.getMessageFieldName() );
      if ( data.indexOfMessageFieldName < 0 ) {
        // The field is unreachable !
        throw new KettleException( BaseMessages.getString( PKG, "SyslogMessage.Exception.CouldnotFindField", meta
            .getMessageFieldName() ) );
      }

    }

    try {
      // get message
      String message = getInputRowMeta().getString( r, data.indexOfMessageFieldName );

      if ( Utils.isEmpty( message ) ) {
        throw new KettleException( BaseMessages.getString( PKG, "SyslogMessage.Error.MessageEmpty" ) );
      }

      // Send message
      SyslogDefs.sendMessage( data.syslog, SyslogDefs.getPriority( meta.getPriority() ), message,
          meta.isAddTimestamp(), data.datePattern, meta.isAddHostName() );

      putRow( getInputRowMeta(), r ); // copy row to output rowset(s);

View on GitHub (pinned to f3058517a1)