# Api\_key “Unexpected exception indices:data/write/index”

**URL:** <https://forum.opensearch.org/t/api-key-unexpected-exception-indices-data-write-index/3248>\
**Category:** Security\
**Created:** [July 6, 2020, 5:59pm UTC](https://forum.opensearch.org/t/api-key-unexpected-exception-indices-data-write-index/3248 "2020-07-06T17:59:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lorenzo95](https://avatars.discourse-cdn.com/v4/letter/l/c57346/32.png) [@lorenzo95](https://forum.opensearch.org/u/lorenzo95)\
**Post date:** [July 6, 2020, 5:59pm UTC](https://forum.opensearch.org/t/api-key-unexpected-exception-indices-data-write-index/3248/1 "2020-07-06T17:59:39Z")

</div>

HI All,

New user here. I grabbed the docker-compose file ([Docker - Open Distro Documentation](https://opendistro.github.io/for-elasticsearch-docs/docs/install/docker/)) and started up a cluster. Now I am trying to create an api key so I can try winlogbeat instead of using username/password.

When I login as admin and run  
POST /\_security/api\_key  
{  
“name”: “filebeat\_host001”,  
“role\_descriptors”: {  
“filebeat\_writer”: {  
“cluster”: [“monitor”, “read\_ilm”],  
“index”: [  
{  
“names”: [“filebeat-\*”],  
“privileges”: [“view\_index\_metadata”, “create\_doc”]}]}}}

or even if i try it via curl securely  
curl --insecure -XPOST -u admin:admin --header ‘Content-Type: application/json’ [https://192.168.1.45:9200/\_security/api\_key](https://192.168.1.45:9200/_security/api_key) -d ‘{  
“name”: “filebeat\_host001”  
}’

I get  
{  
“error” : {  
“root\_cause” : [  
{  
“type” : “security\_exception”,  
“reason” : “Unexpected exception indices:data/write/index”  
}  
],  
“type” : “security\_exception”,  
“reason” : “Unexpected exception indices:data/write/index”  
},  
“status” : 500  
}

That looks a bit strange. I also don’t see a place to view or create api keys in kibana?  
I don’t see any mention of api keys in the documentation. Any hint to what I am missing here?

Thank you

---

<div class="post-metadata">

**Author:** ![iamthealex-es](https://avatars.discourse-cdn.com/v4/letter/i/8491ac/32.png) [@iamthealex-es](https://forum.opensearch.org/u/iamthealex-es)\
**Post date:** [September 16, 2020, 5:05pm UTC](https://forum.opensearch.org/t/api-key-unexpected-exception-indices-data-write-index/3248/2 "2020-09-16T17:05:37Z")

</div>

POST \_security/api\_key is part of X-Pack.  
See the reference to X-Pack here:

> **[Grant access using API keys | Filebeat Reference \[8.4\] | Elastic](https://www.elastic.co/guide/en/beats/filebeat/current/beats-api-keys.html#beats-api-keys)**

And X-Pack is not part of OpenDistro:  
[https://stackoverflow.com/questions/53201190/is-security-free-in-elastic-search-stack-features](https://stackoverflow.com/questions/53201190/is-security-free-in-elastic-search-stack-features)

---

<div class="post-metadata">

**Author:** ![lorenzo95](https://avatars.discourse-cdn.com/v4/letter/l/c57346/32.png) [@lorenzo95](https://forum.opensearch.org/u/lorenzo95)\
**Post date:** [September 18, 2020, 3:00am UTC](https://forum.opensearch.org/t/api-key-unexpected-exception-indices-data-write-index/3248/3 "2020-09-18T03:00:57Z")

</div>

Thank you very much. I had a feeling but I wasn’t sure how to validate it. I get it now.

Thank you for taking the time. Much appreciated.
