Bulk api cant handle scripts

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
2.19

Describe the issue:
Last sunday our bulk api requests using scripts stopped working suddenly. We still can do doc bulks, and single document updates, but as soon as we place a script inside the bulk it blows appart.

It was working fine until then, so I’m pretty sure the bulk body is fine.

Configuration:
Nothing relevant

Relevant Logs or Screenshots:
Bulk response is:
{“took”: 0, “errors”: true, “items”: [{“update”: {“_index”: “jobs_20250520_091635”, “_id”: “3bb45949314b51b15c2003291775e3ad”, “status”: 500, “error”: {“type”: “null_pointer_exception”, “reason”: “Cannot invoke "org.opensearch.action.index.IndexRequest.source()" because the return value of "org.opensearch.action.update.UpdateRequest.doc()" is null”}}}, {“update”: {“_index”: “jobs_20250520_091635”, “_id”: “f5e723654ab4e791a46972c31311c8ed”, “status”: 500, “error”: {“type”: “null_pointer_exception”, “reason”: “Cannot invoke "org.opensearch.action.index.IndexRequest.source()" because the return value of "org.opensearch.action.update.UpdateRequest.doc()" is null”}}}]}

This appears to be an issue specific to Amazon OpenSearch Service as it is not reproducible in the open source artifacts. Can you confirm this is an Amazon OpenSearch Service cluster and not a self-managed deployment?

facing the same issue! I am using an amazon opensearch service cluster

Yes facing same issue with latest software version update with AWS service.

Good morning, and sorry for the late response. Yeah it is an AWS Opensearch Service Cluster.

Good to know it may be a version error

What should be the work around then if it’s a version bug?
I am also facing the same issue, after upgrading the version to 2.19, the bulk updates with script are failing.

Hi Everyone -

It looks like in the meantime if you want to use the syntax for an upsert call -

It should start working again. I’m being told there’s a patch in the works for this issue. It seems that on the AWS managed service side they managed to bring in a breaking change. Here on the open source side of things we have pretty strong prevention for that kind of thing.

I’ll see if I can remind myself to come back and let everyone know when that patch has been posted.

Nate

Thanks for your answer! It appears to be solved already from today morning with update:

OpenSearch_2_19_R20250630-P4 (latest)

Thanks for your help everyone :blush: