# org.elasticsearch.hadoop.EsHadoopException: Could not write all entries for bulk operation \[1/1\]. Error sample (first \[5\] error messages):

**URL:** <https://discuss.elastic.co/t/org-elasticsearch-hadoop-eshadoopexception-could-not-write-all-entries-for-bulk-operation-1-1-error-sample-first-5-error-messages/355175>\
**Category:** Elasticsearch\
**Created:** [March 11, 2024, 4:53pm UTC](https://discuss.elastic.co/t/org-elasticsearch-hadoop-eshadoopexception-could-not-write-all-entries-for-bulk-operation-1-1-error-sample-first-5-error-messages/355175 "2024-03-11T16:53:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![programmer\_123](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/programmer_123/32/131075_2.png) [@programmer\_123](https://discuss.elastic.co/u/programmer_123)\
**Post date:** [March 11, 2024, 4:53pm UTC](https://discuss.elastic.co/t/org-elasticsearch-hadoop-eshadoopexception-could-not-write-all-entries-for-bulk-operation-1-1-error-sample-first-5-error-messages/355175/1 "2024-03-11T16:53:44Z")

</div>

Hi @all,

I am using pyspark program to write the data into elastic index by using upsert operation (sample code snippet below).

def writeDataToES(final\_df):  
write\_options = {  
"es.nodes": elastic\_host,  
"es.net.ssl": "false",  
"es.nodes.wan.only": "true",  
"es.net.http.auth.user": elastic\_user\_name,  
"es.net.http.auth.pass": elastic\_password,  
"es.port": elastic\_port,  
"es.net.ssl": "true",  
'es.spark.dataframe.write.null': "true",  
"es.mapping.id" : mapping\_id,  
"es.write.operation": "upsert"  
}  
final\_df.write.format( "org.elasticsearch.spark.sql").options(\*\*write\_options).mode("append").save( f"{index\_name}")

while writing data from delta table to elastic index, i am getting error for few records(error message below)

Py4JJavaError: An error occurred while calling o1305.save.  
: org.apache.spark.SparkException: Job aborted due to stage failure: Task 4 in stage 524.0 failed 4 times, most recent failure: Lost task 4.3 in stage 524.0 (TID 12805) (192.168.128.16 executor 1): org.elasticsearch.hadoop.EsHadoopException: Could not write all entries for bulk operation [1/1]. Error sample (first [5] error messages):  
org.elasticsearch.hadoop.rest.EsHadoopRemoteException: illegal\_argument\_exception: Illegal group reference: group index is missing

Could you guide me on it, am I missing anythings,

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 8, 2024, 4:54pm UTC](https://discuss.elastic.co/t/org-elasticsearch-hadoop-eshadoopexception-could-not-write-all-entries-for-bulk-operation-1-1-error-sample-first-5-error-messages/355175/2 "2024-04-08T16:54:17Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
