I create the indices like this via the Python client:
es = elasticsearch.Elasticsearch(host, **ELASTICSEARCH_DEFAULTS)
es.indices.create(index, body, ignore=400)
In the failure scenario I'm describing, the index does not get created and that stack trace gets printed. I do not see any logging indicating that a document could not get created.
The only other errors that show up are in my test code output. Here is all the surrounding context that I have from the ES logs:
[2017-10-26T13:07:33,169][INFO ][o.e.c.m.MetaDataDeleteIndexService] [my8ovVE] [index2/ewaQnzcYS9iOaHsYbcE5JA] deleting index
[2017-10-26T13:07:33,169][INFO ][o.e.c.m.MetaDataDeleteIndexService] [my8ovVE] [index3/7aP6Wx8yRXW_1i7Ox2736w] deleting index
[2017-10-26T13:07:33,169][INFO ][o.e.c.m.MetaDataDeleteIndexService] [my8ovVE] [myindex/Dahm9qx8Q3mJOsi1JxnneA] deleting index
[2017-10-26T13:07:33,170][INFO ][o.e.c.m.MetaDataDeleteIndexService] [my8ovVE] [index4/Pu8o8VXVTUWYI-PfNkeHew] deleting index
[2017-10-26T13:07:33,170][INFO ][o.e.c.m.MetaDataDeleteIndexService] [my8ovVE] [index5/2f1iHrIcSP2tYKIr24-uag] deleting index
[2017-10-26T13:07:33,170][INFO ][o.e.c.m.MetaDataDeleteIndexService] [my8ovVE] [index5/PxLJndP7SESctud1bC3k5w] deleting index
[2017-10-26T13:07:34,358][INFO ][o.e.c.m.MetaDataCreateIndexService] [my8ovVE] [index5] creating index, cause [api], templates [], shards [1]/[0], mappings [docs]
[2017-10-26T13:07:34,378][INFO ][o.e.c.m.MetaDataCreateIndexService] [my8ovVE] [index5] creating index, cause [api], templates [], shards [1]/[0], mappings [urls]
[2017-10-26T13:07:34,529][INFO ][o.e.c.m.MetaDataCreateIndexService] [my8ovVE] [docs] creating index, cause [api], templates [], shards [1]/[0], mappings [docs]
[2017-10-26T13:07:34,541][INFO ][o.e.c.m.MetaDataCreateIndexService] [my8ovVE] [index3] creating index, cause [api], templates [], shards [1]/[0], mappings [status]
[2017-10-26T13:07:34,565][INFO ][o.e.c.m.MetaDataCreateIndexService] [my8ovVE] [errors] creating index, cause [api], templates [], shards [1]/[0], mappings [docs]
[2017-10-26T13:07:34,667][INFO ][o.e.c.m.MetaDataCreateIndexService] [my8ovVE] [index4] creating index, cause [api], templates [], shards [1]/[0], mappings [document]
[2017-10-26T13:07:34,690][INFO ][o.e.c.m.MetaDataCreateIndexService] [my8ovVE] [myindex] creating index, cause [api], templates [], shards [1]/[0], mappings [document]
[2017-10-26T13:07:34,706][WARN ][o.e.a.b.TransportShardBulkAction] [my8ovVE] unexpected error during the primary phase for action [indices:data/write/bulk[s]], request [BulkShardRequest [[myindex][0]] containing [index {[myindex][document][31694573011], source[{"parent_doc_id": 31694573011, "moar_doc_ids": []}]}]]
org.elasticsearch.index.IndexNotFoundException: no such index
at org.elasticsearch.cluster.routing.RoutingTable.shardRoutingTable(RoutingTable.java:137) ~[elasticsearch-6.0.0-rc1.jar:6.0.0-rc1]
at org.elasticsearch.action.support.replication.TransportReplicationAction$ReroutePhase.primary(TransportReplicationAction.java:797) ~[elasticsearch-6.0.0-rc1.jar:6.0.0-rc1]
at org.elasticsearch.action.support.replication.TransportReplicationAction$ReroutePhase.doRun(TransportReplicationAction.java:732) ~[elasticsearch-6.0.0-rc1.jar:6.0.0-rc1]
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) ~[elasticsearch-6.0.0-rc1.jar:6.0.0-rc1]
at org.elasticsearch.action.support.replication.TransportReplicationAction$ReroutePhase$2.onNewClusterState(TransportReplicationAction.java:886) ~[elasticsearch-6.0.0-rc1.jar:6.0.0-rc1]
at org.elasticsearch.cluster.ClusterStateObserver$ContextPreservingListener.onNewClusterState(ClusterStateObserver.java:303) ~[elasticsearch-6.0.0-rc1.jar:6.0.0-rc1]
at org.elasticsearch.cluster.ClusterStateObserver$ObserverClusterStateListener.clusterChanged(ClusterStateObserver.java:191) ~[elasticsearch-6.0.0-rc1.jar:6.0.0-rc1]
at org.elasticsearch.cluster.service.ClusterApplierService.lambda$callClusterStateListeners$7(ClusterApplierService.java:506) ~[elasticsearch-6.0.0-rc1.jar:6.0.0-rc1]
at java.util.concurrent.ConcurrentHashMap$KeySpliterator.forEachRemaining(ConcurrentHashMap.java:3527) [?:1.8.0_112]
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:743) [?:1.8.0_112]
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580) [?:1.8.0_112]
at org.elasticsearch.cluster.service.ClusterApplierService.callClusterStateListeners(ClusterApplierService.java:503) [elasticsearch-6.0.0-rc1.jar:6.0.0-rc1]
at org.elasticsearch.cluster.service.ClusterApplierService.applyChanges(ClusterApplierService.java:486) [elasticsearch-6.0.0-rc1.jar:6.0.0-rc1]
at org.elasticsearch.cluster.service.ClusterApplierService.runTask(ClusterApplierService.java:429) [elasticsearch-6.0.0-rc1.jar:6.0.0-rc1]
at org.elasticsearch.cluster.service.ClusterApplierService$UpdateTask.run(ClusterApplierService.java:158) [elasticsearch-6.0.0-rc1.jar:6.0.0-rc1]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:569) [elasticsearch-6.0.0-rc1.jar:6.0.0-rc1]
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:247) [elasticsearch-6.0.0-rc1.jar:6.0.0-rc1]
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:210) [elasticsearch-6.0.0-rc1.jar:6.0.0-rc1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_112]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_112]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_112]
[2017-10-26T13:07:37,020][INFO ][o.e.c.m.MetaDataCreateIndexService] [my8ovVE] [index2] creating index, cause [api], templates [], shards [1]/[0], mappings [docs]
I will try running with -ea
for future tests.