# Elastic search error while adding http.cors.allow-origin : "\*" in elasticsearch.yml(5.3.3)

**URL:** https://discuss.elastic.co/t/elastic-search-error-while-adding-http-cors-allow-origin-in-elasticsearch-yml-5-3-3/106900
**Category:** Elasticsearch
**Created:** [November 8, 2017, 3:41pm UTC](https://discuss.elastic.co/t/elastic-search-error-while-adding-http-cors-allow-origin-in-elasticsearch-yml-5-3-3/106900 "2017-11-08T15:41:05Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![patil-akshay](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patil-akshay/32/15295_2.png) [@patil-akshay](https://discuss.elastic.co/u/patil-akshay)
#### Post date: [November 8, 2017, 3:41pm UTC](https://discuss.elastic.co/t/elastic-search-error-while-adding-http-cors-allow-origin-in-elasticsearch-yml-5-3-3/106900/1 "2017-11-08T15:41:05Z")

</div>

After adding  
http.cors.enabled : true  
http.cors.allow-origin : "\*"  
http.cors.allow-methods : OPTIONS, HEAD, GET, POST, PUT, DELETE  
http.cors.allow-headers : X-Requested-With,X-Auth-Token,Content-Type, Content-Length

these lines in elasticsearch.yml

on restart elasticsearch is throwing below error .

Caused by: while scanning a simple key  
in 'reader', line 59, column 1:  
http.cors.enabled : true  
^  
could not find expected ':'  
in 'reader', line 60, column 1:  
http.cors.allow-origin : "\*"

---

<div class="post-metadata">

### Author: ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)
#### Post date: [November 9, 2017, 1:48am UTC](https://discuss.elastic.co/t/elastic-search-error-while-adding-http-cors-allow-origin-in-elasticsearch-yml-5-3-3/106900/2 "2017-11-09T01:48:10Z")

</div>

Are you sure that you have an ascii colon `:` there (Hex char `3a`) ?

You would get the error you are seeing if you had a non-ascii colon (e.g. Unicode Full width colon `：`, character `xff1a`).

---

<div class="post-metadata">

### Author: ![zqc0512](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zqc0512/32/32141_2.png) [@zqc0512](https://discuss.elastic.co/u/zqc0512)
#### Post date: [November 9, 2017, 2:44am UTC](https://discuss.elastic.co/t/elastic-search-error-while-adding-http-cors-allow-origin-in-elasticsearch-yml-5-3-3/106900/3 "2017-11-09T02:44:24Z")

</div>

- http.cors.enabled: true the "http.cors.enabled" end not have space..
- http.cors.allow-origin: "\*"

---

<div class="post-metadata">

### Author: ![patil-akshay](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patil-akshay/32/15295_2.png) [@patil-akshay](https://discuss.elastic.co/u/patil-akshay)
#### Post date: [November 9, 2017, 6:57am UTC](https://discuss.elastic.co/t/elastic-search-error-while-adding-http-cors-allow-origin-in-elasticsearch-yml-5-3-3/106900/4 "2017-11-09T06:57:28Z")

</div>

Yeah worked like charm Thanks

---

<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 7, 2017, 7:11am UTC](https://discuss.elastic.co/t/elastic-search-error-while-adding-http-cors-allow-origin-in-elasticsearch-yml-5-3-3/106900/5 "2017-12-07T07:11:16Z")

</div>

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