Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FORBIDDEN/12/index read-only / allow delete (api) problem

When importing items into my Rails app I keep getting the above error being raised by SearchKick on behalf of Elasticsearch.

I'm running Elasticsearch in a Docker. I start my app by running docker-compose up. I've tried running the command recommended above but i just get "No such file or directory" returned. Any ideas?

I do have port 9200 exposed to outside but nothing seems to help. Any ideas?

like image 237
rctneil Avatar asked Jan 03 '19 18:01

rctneil


2 Answers

Use the following command in linux:

 curl -s -H 'Content-Type: application/json' -XPUT 'http://localhost:9200/_all/_settings?pretty' -d ' {
    "index":{
             "blocks" : {"read_only_allow_delete":"false"}
    }
}'

the same command in Kibana's DEV TOOL format :

PUT _all/_settings
{
    "index":{
             "blocks" : {"read_only_allow_delete":"false"}
    }
}
like image 190
hamid bayat Avatar answered Oct 25 '22 03:10

hamid bayat


Indeed, running curl -XPUT -H "Content-Type: application/json" http://localhost:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}' as suggested by @Nishant Saini resolves the very similar issue I ran just into.

I hit disk watermarks limits on my machine.

like image 34
kghbln Avatar answered Oct 25 '22 02:10

kghbln