pentaho/pentaho-kettle · error · KettleStepException

ElasticSearchBulk.Log.Exception

ElasticSearchBulk.Log.Exception

Error message

ElasticSearchBulk.Log.Exception

What it means

ElasticSearchBulk.processRow rejects all incoming rows and throws a KettleStepException wrapping this message whenever any unexpected exception occurs while processing a row against Elasticsearch (after rethrowing KettleStepException untouched). The message includes the original exception's localized text, so it is a generic failure wrapper for the step's row loop.

Solutions

  1. Read e.getLocalizedMessage() embedded in msg for the root cause
  2. Verify Elasticsearch host/port/cluster settings and that the cluster is reachable
  3. Check the index mapping against the fields being sent
  4. Enable step logging / run with a sample of rows to find the offending row
Defensive patterns

Strategy: validation

Validate before calling

// preview the stream and confirm JSON field content is valid before the step
Object raw = row[jsonFieldIdx];
if (raw == null) throw new KettleStepException("JSON field is null in input row");
new JSONObject(raw.toString()); // throws if not valid JSON

Try / catch

try { processRow flows via step error handling } catch (KettleStepException e) { logError("ES bulk row error: " + e.getLocalizedMessage(), e); }

Prevention

When it happens

Trigger: Any non-KettleStepException thrown in processRow: transport/client failures, mapping errors, null or malformed row data, document parsing errors during bulk indexing.

Common situations: Elasticsearch cluster unreachable or returning errors; field mapping conflicts; rows whose JSON field content is invalid; wrong index/document type configuration.

Understand the failure class

Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.

Related errors


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

Appendix: source

Thrown at plugins/elasticsearch-bulk-insert/core/src/main/java/org/pentaho/di/trans/steps/elasticsearchbulk/ElasticSearchBulk.java:139

    if ( first ) {
      first = false;
      setupData();
      currentRequest = client.prepareBulk();
      requestsBuffer = new ArrayList<IndexRequestBuilder>( this.batchSize );
      initFieldIndexes();
    }

    try {
      data.inputRowBuffer[data.nextBufferRowIdx++] = rowData;
      return indexRow( data.inputRowMeta, rowData ) || !stopOnError;
    } catch ( KettleStepException e ) {
      throw e;
    } catch ( Exception e ) {
      rejectAllRows( e.getLocalizedMessage() );
      String msg = BaseMessages.getString( PKG, "ElasticSearchBulk.Log.Exception", e.getLocalizedMessage() );
      logError( msg );
      throw new KettleStepException( msg, e );
    }
  }

  /**
   * Initialize <code>this.data</code>
   *
   * @throws KettleStepException
   */
  private void setupData() throws KettleStepException {
    data.nextBufferRowIdx = 0;
    data.inputRowMeta = getInputRowMeta().clone(); // only available after first getRow();
    data.inputRowBuffer = new Object[batchSize][];
    data.outputRowMeta = data.inputRowMeta.clone();
    meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,
                    metaStore );
  }

  private void initFieldIndexes() throws KettleStepException {

View on GitHub (pinned to f3058517a1)