from datetime import datetime
from elasticsearch import Elasticsearch
es = Elasticsearch()
doc = {
\'author\': \'kimchy\',
\'text\': \'Elasticsearch: cool.
The reasons for the timeout could be many and it seems worth checking the logs on elasticsearch side (logs/elasticsearch.log) to see the detailed error. In our case, the error on ES was:
primary shard is not active Timeout: [1m]
As described in this post, this was because our disk was full. We had resized it (and the partition) a day ago to take care of that but ES needs to be restarted if the high/low watermark has been hit once (we are on 5.5.x) which we had not done.
Simply restarting the ES on production resolved the issue for us.