Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

javax.net.ssl.SSLHandshakeException while building Docker Image of Opensearch with analysis-kuromoji analysis-smartcn #2645

Closed
PailaGH opened this issue Sep 19, 2022 · 3 comments
Assignees
Labels
bug Something isn't working docker

Comments

@PailaGH
Copy link

PailaGH commented Sep 19, 2022

I got an exception while building docker image with OpenSearch 2.2.1 and analysis-smartcn analysis-kuromoji

dockerfile:
FROM opensearchproject/opensearch:2.2.1
RUN /usr/share/opensearch/bin/opensearch-plugin install --batch analysis-smartcn analysis-kuromoji

environment: windows 10
command:
docker build -t opensearchwithjplugins:1.0 .

I am not sure which certificate it is looking for.
Exception:

[9/9] RUN /usr/share/opensearch/bin/opensearch-plugin install --batch analysis-smartcn analysis-kuromoji:
#13 1.228 -> Installing analysis-smartcn
#13 1.804 -> Failed installing analysis-smartcn
#13 1.804 -> Rolling back analysis-smartcn
#13 1.804 -> Rolled back analysis-smartcn
#13 1.805 Exception in thread "main" javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
#13 1.805 at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131)
#13 1.805 at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:371)
#13 1.805 at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:314)
#13 1.805 at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:309)
#13 1.805 at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.checkServerCerts(CertificateMessage.java:1357)
#13 1.805 at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.onConsumeCertificate(CertificateMessage.java:1232)
#13 1.805 at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.consume(CertificateMessage.java:1175)
#13 1.806 at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:396)
#13 1.806 at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:480)
#13 1.806 at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:458)
#13 1.806 at java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:201)
#13 1.806 at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:172)
#13 1.806 at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1505)
#13 1.806 at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1420)
#13 1.806 at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:455)
#13 1.806 at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:426)
#13 1.807 at java.base/sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:580)
#13 1.807 at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:187)
#13 1.807 at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:142)
#13 1.807 at org.opensearch.plugins.InstallPluginCommand.urlExists(InstallPluginCommand.java:425)
#13 1.807 at org.opensearch.plugins.InstallPluginCommand.getOpenSearchUrl(InstallPluginCommand.java:392)
#13 1.807 at org.opensearch.plugins.InstallPluginCommand.download(InstallPluginCommand.java:309)
#13 1.807 at org.opensearch.plugins.InstallPluginCommand.execute(InstallPluginCommand.java:272)
#13 1.807 at org.opensearch.plugins.InstallPluginCommand.execute(InstallPluginCommand.java:249)
#13 1.807 at org.opensearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:104)
#13 1.807 at org.opensearch.cli.Command.mainWithoutErrorHandling(Command.java:138)
#13 1.807 at org.opensearch.cli.MultiCommand.execute(MultiCommand.java:104)
#13 1.808 at org.opensearch.cli.Command.mainWithoutErrorHandling(Command.java:138)
#13 1.808 at org.opensearch.cli.Command.main(Command.java:101)
#13 1.808 at org.opensearch.plugins.PluginCli.main(PluginCli.java:60)
#13 1.808 Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
#13 1.808 at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:439)
#13 1.808 at java.base/sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:306)
#13 1.808 at java.base/sun.security.validator.Validator.validate(Validator.java:264)
#13 1.808 at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:231)
#13 1.809 at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:132)
#13 1.809 at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.checkServerCerts(CertificateMessage.java:1341)
#13 1.809 ... 25 more
#13 1.809 Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
#13 1.809 at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
#13 1.809 at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
#13 1.809 at java.base/java.security.cert.CertPathBuilder.build(CertPathBuilder.java:297)
#13 1.809 at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:434)
#13 1.809 ... 30 more

executor failed running [/bin/sh -c /usr/share/opensearch/bin/opensearch-plugin install --batch analysis-smartcn analysis-kuromoji]: exit code: 1

@gaiksaya gaiksaya added bug Something isn't working untriaged Issues that have not yet been triaged labels Sep 19, 2022
@bbarani bbarani added docker and removed untriaged Issues that have not yet been triaged labels Sep 20, 2022
@prudhvigodithi
Copy link
Member

Hey @PailaGH, I was able to successfully build with your dockerfile, I suspect something is not right with your local machine that will download the plugins.

docker build -t test .
Sending build context to Docker daemon  2.048kB
Step 1/2 : FROM opensearchproject/opensearch:2.2.1
 ---> d9061b1eaade
Step 2/2 : RUN /usr/share/opensearch/bin/opensearch-plugin install --batch analysis-smartcn analysis-kuromoji
 ---> Running in c5d7a5724da4
-> Installing analysis-smartcn
-> Downloading analysis-smartcn from opensearch
-> Installed analysis-smartcn with folder name analysis-smartcn
-> Installing analysis-kuromoji
-> Downloading analysis-kuromoji from opensearch
-> Installed analysis-kuromoji with folder name analysis-kuromoji
Removing intermediate container c5d7a5724da4
 ---> 773c8ad0aaa5
Successfully built 773c8ad0aaa5
Successfully tagged test:latest

@prudhvigodithi
Copy link
Member

Just to add @PailaGH just try to see if you can download the plugin manually on to that Vm using
https://artifacts.opensearch.org/releases/plugins/analysis-kuromoji/2.2.1/analysis-kuromoji-2.2.1.zip

@PailaGH
Copy link
Author

PailaGH commented Sep 20, 2022

Thank you.
It worked after I copied locally to docker this file: https://artifacts.opensearch.org/releases/plugins/analysis-kuromoji/2.2.1/analysis-kuromoji-2.2.1.zip and installed.

@PailaGH PailaGH closed this as completed Sep 20, 2022
@prudhvigodithi prudhvigodithi self-assigned this Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working docker
Projects
None yet
Development

No branches or pull requests

4 participants