If you try to index a document in ElasticSearch or try to re-indexing Magento 2 and you see an error message like this
php bin/magento indexer:reindex catalogsearch_fulltext Catalog Search indexer process unknown error: {"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}
The problem is with ElasticSearch, namely that less than 5% of free space is left on the disk. In order for everything to work, except for releasing the required number of bytes, you still need to run the following command:
curl -XPUT -H "Content-Type: application/json" https://localhost:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'
Note:
The underlying reason that caused ElasticSearch to lock writes to the index was caused by exceeding the disk watermark/quota.
See How to disable ElasticSearch disk quota/watermark for details on how to work around that.
Credits:
* StackOverflow solution by Imran273
Magento Website:
https://business.adobe.com/products/magento/magento-commerce.html