I am trying to create a Node, which was working in ES7 and now am trying to do the same thing in ES v8.11.3. The simple code is
final Settings settings = Settings.builder()
.put(ACTION_AUTO_CREATE_INDEX, false)
.put(THREAD_POOL_WRITE_QUEUE_SIZE, 500)
.put(CLIENT_TRANSPORT_PING_TIMEOUT, "20s")
.put(TRANSPORT_TYPE, NETTY_TRANSPORT_NAME)
.put(INDEX_STORE_TYPE, IndexModule.Type.FS.getSettingsKey())
.put(PATH_HOME, new File(dir).getAbsolutePath())
.put(PATH_DATA, new File(dir, "data").getAbsolutePath())
.put(PATH_LOGS, new File(dir, "logs").getAbsolutePath())
.put(CLUSTER_NAME, name)
.put(NODE_NAME, name)
.build();
Path configDir = Path.of(dir, "config");
return new Node(InternalSettingsPreparer.prepareEnvironment(settings, Collections.emptyMap(), configDir, null);
When this code runs, it gets to PluginsService#addServerExportersService line elasticsearch/server/src/main/java/org/elasticsearch/plugins/PluginsService.java at v8.11.3 · elastic/elasticsearch · GitHub PluginsService.class.getModule();
which returns an unnamed module (my understanding is this is valid) but the descriptor is null (see screenshot)
and then gets an NPE when later calling .exports()
on the null descriptor (see elasticsearch/libs/core/src/main/java/org/elasticsearch/jdk/ModuleQualifiedExportsService.java at v8.11.3 · elastic/elasticsearch · GitHub)
Here is the call stack
I don't think my setup code is even relevant here, because PluginsService.class.getModule()
is hardcoded in ES code and the module has a null descriptor. What module is expected here and what ought the descriptor be?
If the issue is somehow my setup, might someone have an example for me to create a node correctly?