# org.elasticsearch.hadoop.rest.EsHadoopRemoteException: illegal\_argument\_exception: value for key \[X-Opaque-Id\] already present

**URL:** https://discuss.elastic.co/t/org-elasticsearch-hadoop-rest-eshadoopremoteexception-illegal-argument-exception-value-for-key-x-opaque-id-already-present/347380
**Category:** Elasticsearch
**Tags:** es-hadoop
**Created:** [November 17, 2023, 5:53am UTC](https://discuss.elastic.co/t/org-elasticsearch-hadoop-rest-eshadoopremoteexception-illegal-argument-exception-value-for-key-x-opaque-id-already-present/347380 "2023-11-17T05:53:32Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Akhil\_parmar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akhil_parmar/32/127689_2.png) [@Akhil\_parmar](https://discuss.elastic.co/u/Akhil_parmar)
#### Post date: [November 17, 2023, 5:53am UTC](https://discuss.elastic.co/t/org-elasticsearch-hadoop-rest-eshadoopremoteexception-illegal-argument-exception-value-for-key-x-opaque-id-already-present/347380/1 "2023-11-17T05:53:32Z")

</div>

I am working on ETL job where target to load data to elasticsearch, I am facing an error when trying to index document  
org.elasticsearch.hadoop.rest.EsHadoopRemoteException: illegal\_argument\_exception: value for key [X-Opaque-Id] already present

Versions:  
ES: 7.6.1  
ES spark SDK: 7.17.0  
java: 8  
spark: 3.1.0

Can someone please help if I am missing any config

---

<div class="post-metadata">

### Author: ![Keith\_Massey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/keith_massey/32/83666_2.png) [@Keith\_Massey](https://discuss.elastic.co/u/Keith_Massey)
#### Post date: [November 22, 2023, 4:54pm UTC](https://discuss.elastic.co/t/org-elasticsearch-hadoop-rest-eshadoopremoteexception-illegal-argument-exception-value-for-key-x-opaque-id-already-present/347380/2 "2023-11-22T16:54:36Z")

</div>

Hi @Akhil_parmar. Can you paste the stack trace from your elasticsearch logs? Also, what request were you making at the time of the error?

---

<div class="post-metadata">

### Author: ![Akhil\_parmar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akhil_parmar/32/127689_2.png) [@Akhil\_parmar](https://discuss.elastic.co/u/Akhil_parmar)
#### Post date: [November 23, 2023, 3:18am UTC](https://discuss.elastic.co/t/org-elasticsearch-hadoop-rest-eshadoopremoteexception-illegal-argument-exception-value-for-key-x-opaque-id-already-present/347380/3 "2023-11-23T03:18:13Z")

</div>

I was making an index request,  
StackTrace:  
org.elasticsearch.hadoop.rest.EsHadoopRemoteException: illegal\_argument\_exception: value for key [X-Opaque-Id] already present  
{"index":{"\_id"::123"}}  
{"id":"123", "name":"abc"}

We are using open source version of Elasticsearch hosted on private cloud.

I could see that X-Opaque-id header was added in 7.16.0 version.  
To resolve the issue I downgraded the ES spark SDK

```auto
<!-- https://mvnrepository.com/artifact/org.elasticsearch/elasticsearch-spark-30 -->
<dependency>
    <groupId>org.elasticsearch</groupId>
    <artifactId>elasticsearch-spark-30_2.12</artifactId>
    <version>7.15.0</version>
    <scope>provided</scope>
</dependency>

```

---

<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: [December 21, 2023, 3:19am UTC](https://discuss.elastic.co/t/org-elasticsearch-hadoop-rest-eshadoopremoteexception-illegal-argument-exception-value-for-key-x-opaque-id-already-present/347380/4 "2023-12-21T03:19:06Z")

</div>

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