Why can't I reindex?

(Jonas) #1

Everytime I run the command "rake searchkick:reindex CLASS=Vehicle" I get this error:

Elasticsearch::Transport::Transport::Errors::Forbidden: [403] {"error":{"root_cause":[{"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"}],"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"},"status":403}

How to fix this?

I searched Google and StackOverflow for answers but they didn't work. Here's what I've tried:

  • to insert this line in elasticsearch.yml: "cluster.routing.allocation.disk.threshold_enabled: false"
  • to run "Vehicle.search_index.delete" followed by "Vehicle.reindex" in the console.

Thank you

  • Jonas

(Christian Dahlqvist) #2

This is often a sign that you are running out of disk space and have exceeded the flood_stage watermark which by default is set to 95% of disk capacity.

(Jonas) #3

Hello Christian

Thank you for reply.

Do you know of any solution to this?

I look at the page you linked to and I guess that I should place the following lines somewhere.. is it correct? And where?:

PUT /twitter/_settings
"index.blocks.read_only_allow_delete": null

Thank you

  • Jonas

(Christian Dahlqvist) #4

Have you first free up disk space?

(Jonas) #5

Do you mean free disk space on my laptop? On Heroku? On where?
Trying to free up 10 GB on the laptop now..

I get the same error on the local app and on the deployed app.

(Jonas) #6

Just freed up 11 gigabytes... the error persists locally... but seems to work in Heroku now.

(system) closed #7

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