pentaho/pentaho-kettle · error · KettleException

WebServiceAvailable.Exception.CouldnotFindField

Error message

WebServiceAvailable.Exception.CouldnotFindField

What it means

After the URL field name is configured, the step looks up its index in the incoming row metadata via indexOfValue. This error is thrown when the named field does not exist in the input rows, i.e. the configured URL field name doesn't match anything the previous step produces.

Solutions

  1. Verify the exact field name emitted by the upstream step (View fields / preview rows) and correct the 'URL field' setting.
  2. Reconnect the hop after changing upstream steps so row metadata refreshes.
  3. Ensure the upstream step always produces the URL field, not only on some branches.
  4. Use a Select values step to add/alias the field to the expected name if renaming upstream is not possible.

Example fix

// before
<urlField>Url</urlField>
// after (matching upstream field 'url')
<urlField>url</urlField>
Defensive patterns

Strategy: validation

Validate before calling

String urlField = meta.getURLField();
if (inputRowMeta.indexOfValue(urlField) < 0) {
  throw new IllegalArgumentException("Field not in input rows: " + urlField
    + "; available=" + Arrays.toString(inputRowMeta.getFieldNames()));
}

Try / catch

try {
  int idx = rowMeta.indexOfValue(meta.getURLField());
} catch (KettleException e) {
  logError("URL field missing from input stream", e);
}

Prevention

When it happens

Trigger: data.previousRowMeta.indexOfValue(meta.getURLField()) returns -1 on the first row; the step throws with the field name appended to the message.

Common situations: Typo in the configured field name; upstream step renamed/removed the field; case-sensitivity mismatch; field only produced conditionally upstream so it is absent from the row meta.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/webserviceavailable/WebServiceAvailable.java:85

      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 is URL field is provided
      if ( Utils.isEmpty( meta.getURLField() ) ) {
        logError( BaseMessages.getString( PKG, "WebServiceAvailable.Error.FilenameFieldMissing" ) );
        throw new KettleException( BaseMessages.getString( PKG, "WebServiceAvailable.Error.FilenameFieldMissing" ) );
      }

      // cache the position of the field
      data.indexOfURL = data.previousRowMeta.indexOfValue( meta.getURLField() );
      if ( data.indexOfURL < 0 ) {
        // The field is unreachable !
        logError( BaseMessages.getString( PKG, "WebServiceAvailable.Exception.CouldnotFindField" )
          + "[" + meta.getURLField() + "]" );
        throw new KettleException( BaseMessages.getString(
          PKG, "WebServiceAvailable.Exception.CouldnotFindField", meta.getURLField() ) );
      }
    } // End If first

    try {

      // get url
      String url = data.previousRowMeta.getString( r, data.indexOfURL );

      if ( Utils.isEmpty( url ) ) {
        throw new KettleException( BaseMessages.getString( PKG, "WebServiceAvailable.Error.URLEmpty" ) );
      }

      if ( isDetailed() ) {
        logDetailed( BaseMessages.getString( PKG, "WebServiceAvailable.Log.CheckingURL", url ) );
      }

      boolean WebServiceAvailable = false;

View on GitHub (pinned to f3058517a1)