Create timeout exception

Enonic version: 7.4
OS: Ubuntu

Hi,
I’m getting this exception when trying to create a node in our DB. This node can be large (I’m saving an entire content’s tree for speeding purposes).

I’m running it in a task, on a clustered environment (so I don’t know in which cluster it’s running, nor if it’s in only one).

The funny thing is that the object is created in the DB with the same ID as in the exception.

18:43:59.986 ERROR c.e.x.r.i.e.executor.StoreExecutor - Failed to store document with id [f28740cf-72b4-4519-809a-7586f2b0415c] in index [search-database-repo] branch master
org.elasticsearch.ElasticsearchTimeoutException: Timeout waiting for task.
	at org.elasticsearch.action.support.AdapterActionFuture.actionGet(AdapterActionFuture.java:70)
	at org.elasticsearch.action.support.AdapterActionFuture.actionGet(AdapterActionFuture.java:62)
	at org.elasticsearch.action.support.AdapterActionFuture.actionGet(AdapterActionFuture.java:52)
 	at com.enonic.xp.repo.impl.elasticsearch.executor.StoreExecutor.execute(StoreExecutor.java:48)
	at com.enonic.xp.repo.impl.elasticsearch.storage.StorageDaoImpl.store(StorageDaoImpl.java:77)
	at com.enonic.xp.repo.impl.storage.IndexDataServiceImpl.store(IndexDataServiceImpl.java:108)
	at com.enonic.xp.repo.impl.storage.NodeStorageServiceImpl.indexNode(NodeStorageServiceImpl.java:491)
 	at com.enonic.xp.repo.impl.storage.NodeStorageServiceImpl.store(NodeStorageServiceImpl.java:75)
 	at com.enonic.xp.repo.impl.node.StoreNodeCommand.execute(StoreNodeCommand.java:43)
	at com.enonic.xp.repo.impl.node.CreateNodeCommand.execute(CreateNodeCommand.java:107)
	at com.enonic.xp.repo.impl.node.NodeServiceImpl.doCreate(NodeServiceImpl.java:461)
	at com.enonic.xp.repo.impl.node.NodeServiceImpl.create(NodeServiceImpl.java:449)
	at com.enonic.xp.lib.node.CreateNodeHandler.execute(CreateNodeHandler.java:27)
	at com.enonic.xp.context.ContextImpl.callWith(ContextImpl.java:102)
  at com.enonic.xp.lib.node.NodeHandler.execute(NodeHandler.java:237)
  at com.enonic.xp.lib.node.NodeHandler.create(NodeHandler.java:32)
  at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$143655$3478A$node.L:1#create(helsedirektoratet:/lib/xp/node.js:120)

Do you have any idea of what is going on?
Although the object seems to be created correctly, I’m worried about the exceptions.

Hi!
Does it happen every run and depend on node size?
Could you share example of node and maybe the code, please?
Thanks!

You don’t receive an acknowledgement from Elasticsearch in certain time (timeout) because it is rather big - don’t save lots of documents in one request.
Elasticsearch still tries to store your document in the background - this is why you can find the document.

@maaubt did you figure out this one?

No, I haven’t figured that one yet.
I can’t provide an example of a node example for this because it may contain sensitive information, but I know that some of these can be large (230Kb for one in datatoolbox node exports).

I inserted a few logs and it seems to come after calling nodeLib.create. The whole procedure is running inside a task that creates a bunch of nodes one-by-one (it prepares the data then creates a single node). Thankfully, as @rymsha said, I usually find the node in the DB, but I’m not sure they are created every time (I don’t know if the creation actually fails after one of the exceptions).