Exception in thread "Elasticsearch initialization thread" java.lang.RuntimeException: ElasticsearchException[failed to initialize a TrustManagerFactory]; nested: NoSuchFileException[/home/brunei/elasticsearch-6.5.0/config/ca/ca.crt];

Exception in thread "Elasticsearch initialization thread" java.lang.RuntimeException: ElasticsearchException[failed to initialize a TrustManagerFactory]; nested: NoSuchFileException[/home/brunei/elasticsearch-6.5.0/config/ca/ca.crt];
	at org.elasticsearch.xpack.core.XPackClientPlugin.getTransports(XPackClientPlugin.java:427)
	at org.elasticsearch.common.network.NetworkModule.<init>(NetworkModule.java:127)
	at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.java:188)
	at org.elasticsearch.client.transport.TransportClient.<init>(TransportClient.java:284)
	at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:128)
	at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.<init>(PreBuiltXPackTransportClient.java:47)
	at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.<init>(PreBuiltXPackTransportClient.java:42)
	at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.<init>(PreBuiltXPackTransportClient.java:38)
	at com.liferay.portal.search.elasticsearch6.internal.connection.RemoteElasticsearchConnection.createTransportClient(RemoteElasticsearchConnection.java:156)
	at com.liferay.portal.search.elasticsearch6.internal.connection.RemoteElasticsearchConnection.createClient(RemoteElasticsearchConnection.java:129)
	at com.liferay.portal.search.elasticsearch6.internal.connection.BaseElasticsearchConnection.connect(BaseElasticsearchConnection.java:65)
	at com.liferay.portal.search.elasticsearch6.internal.connection.ElasticsearchConnectionManager.connect(ElasticsearchConnectionManager.java:59)
	at com.liferay.portal.search.elasticsearch6.internal.ElasticsearchEngineConfigurator.lambda$initialize$0(ElasticsearchEngineConfigurator.java:90)
	at java.lang.Thread.run(Thread.java:748)
Caused by: ElasticsearchException[failed to initialize a TrustManagerFactory]; nested: NoSuchFileException[/home/brunei/elasticsearch-6.5.0/config/ca/ca.crt];
	at org.elasticsearch.xpack.core.ssl.PEMTrustConfig.createTrustManager(PEMTrustConfig.java:48)
	at org.elasticsearch.xpack.core.ssl.SSLService.createSslContext(SSLService.java:356)
	at org.elasticsearch.xpack.core.ssl.SSLService.loadSSLConfigurations(SSLService.java:389)
	at org.elasticsearch.xpack.core.ssl.SSLService.<init>(SSLService.java:93)
	at org.elasticsearch.xpack.core.XPackClientPlugin.getTransports(XPackClientPlugin.java:425)
	... 13 more
Caused by: java.nio.file.NoSuchFileException: /home/brunei/elasticsearch-6.5.0/config/ca/ca.crt
	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
	at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
	at java.nio.file.Files.newByteChannel(Files.java:361)
	at java.nio.file.Files.newByteChannel(Files.java:407)
	at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
	at java.nio.file.Files.newInputStream(Files.java:152)
	at org.elasticsearch.xpack.core.ssl.CertParsingUtils.readCertificates(CertParsingUtils.java:93)
	at org.elasticsearch.xpack.core.ssl.CertParsingUtils.readCertificates(CertParsingUtils.java:86)
	at org.elasticsearch.xpack.core.ssl.PEMTrustConfig.createTrustManager(PEMTrustConfig.java:45)
	... 17 more
2020-05-07 19:25:10.285 ERROR [Framework Event Dispatcher: Equinox Container: ec166b06-499e-4fa2-9ffe-92b44c01ead3][Framework:93] FrameworkEvent ERROR 
java.lang.NullPointerException
	at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:46)
	at org.elasticsearch.action.ActionRequestBuilder.get(ActionRequestBuilder.java:53)
	at com.liferay.portal.search.elasticsearch6.internal.search.engine.adapter.cluster.HealthClusterRequestExecutorImpl.execute(HealthClusterRequestExecutorImpl.java:45)
	at

I am getting the above error while connecting the Application server(tomcat) with elastic search remotely.

Please find the attached Screenshots of configurations and file location of ca and cert certificates.

1.Elasticsearch_ca_file_location

Elasticsearch_ca_file_location

2.Elasticsearch_cert_file_location

Elasticsearch_cert_file_location

3.Elasticsearch_ca_and_cert_file_location

4.Elasticsearch_yml_file_configuration

5.tomcat_to_elastisearch_connectivity_configuration

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.