Skip to content

[BUG] opensearch_api source: _bulk endpoint returns empty HTTP 200 with no JSON body #6877

@divakarsingh

Description

@divakarsingh

Describe the bug
The opensearch_api source _bulk endpoint returns an empty HTTP 200 response with no body. Clients using RestHighLevelClient (Flink OpenSearch Connector, Logstash, opensearch-py) expect a JSON response matching the OpenSearch _bulk API format: {took, errors, items[]} and fail with "Unable to parse response body" / NullPointerException.

To Reproduce

  1. Configure Data Prepper with opensearch_api source
  2. Send a _bulk request from any standard OpenSearch client (e.g. Flink OpenSearch Connector, opensearch-py, curl)
  3. Observe empty response body - no JSON returned

Expected behavior
The _bulk endpoint should return a JSON response with {took, errors, items[]} matching the OpenSearch Bulk API response format, so standard clients can parse it without error.

Screenshots
N/A

Environment (please complete the following information):

  • OS: Linux
  • Version: Data Prepper 2.15.1 / main branch

Additional context
Forum report: https://forum.opensearch.org/t/data-prepper-opensearch-api-return-value-for-bulk-endpoint-is-wrong/28068

The issue is in OpenSearchAPIService.processBulkRequest() which returns HttpResponse.of(HttpStatus.OK) with no body.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

Status

In review

Relationships

None yet

Development

No branches or pull requests

Issue actions