Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Searchkick: Elasticsearch not indexing "FORBIDDEN/12/index read-only"?

I've setup a new development environment on my iMac and moved my rails app from a macbook air. It was working fine and indexing the data as well. Using the same version of gems. When indexing it gives following error.

Searchkick::ImportError: {"type"=>"cluster_block_exception", "reason"=>"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"} on item with id '74'

Is there any way I can solve this issue by modifying my elasticsearch.yml?

like image 395
lightsaber Avatar asked Jan 03 '23 02:01

lightsaber


2 Answers

This solution from salihsagdilekon on https://github.com/ankane/searchkick/issues/1040 resolved this same issue for me:

curl -XPUT -H "Content-Type: application/json" > http://localhost:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'
like image 67
ktravers Avatar answered Jan 11 '23 23:01

ktravers


I had the same issue today, and the following worked for me:

Model.search_index.clean_indices
like image 26
AKN Avatar answered Jan 12 '23 01:01

AKN