codota / tabnine-intellij

Jetbrains IDEs client for TabNine. Compatible with all IntelliJ-based IDEs. https://plugins.jetbrains.com/plugin/12798-tabnine
https://www.tabnine.com/install/intellij
MIT License
525 stars 67 forks source link

Tabnine Hub will not load #723

Closed mosesyap closed 3 months ago

mosesyap commented 3 months ago

The errors on the logs seemed to be certificate related

2024-08-09 16:40:41,591 [ 1286] WARN - #com.tabnineCommon.binary.fetch.BinaryRemoteSource - Request of current version failed. Falling back to latest local version. javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131) at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:378) at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:321) at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:316) at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.checkServerCerts(CertificateMessage.java:1351) at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.onConsumeCertificate(CertificateMessage.java:1226) at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.consume(CertificateMessage.java:1169) at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:396) at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:480) at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:458) at java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:201) at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:172) at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1510) at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1425) at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:455) at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:426) at java.base/sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:589) at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:187) at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1687) at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1611) at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224) at com.tabnineCommon.binary.fetch.BinaryRemoteSource.remoteVersionRequest(BinaryRemoteSource.java:58) at com.tabnineCommon.binary.fetch.BinaryRemoteSource.fetchPreferredVersion(BinaryRemoteSource.java:27) at com.tabnineCommon.binary.fetch.BootstrapperSupport.lambda$downloadRemoteVersion$3(BootstrapperSupport.java:71) at java.base/java.util.Optional.flatMap(Optional.java:289) at com.tabnineCommon.binary.fetch.BootstrapperSupport.downloadRemoteVersion(BootstrapperSupport.java:68) at com.tabnineCommon.binary.fetch.BootstrapperSupport.bootstrapVersion(BootstrapperSupport.java:33) at com.tabnineCommon.binary.fetch.BinaryVersionFetcher.fetchBinary(BinaryVersionFetcher.java:38) at com.tabnineCommon.binary.BinaryRun.generateRunCommand(BinaryRun.java:41) at com.tabnineCommon.binary.BinaryProcessRequesterProvider.lambda$initProcess$1(BinaryProcessRequesterProvider.java:118) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699) at java.base/java.lang.Thread.run(Thread.java:840) Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:439) at java.base/sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:306) at java.base/sun.security.validator.Validator.validate(Validator.java:264) at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:231) at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:132) at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.checkServerCerts(CertificateMessage.java:1335) ... 34 more Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:148) at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:129) at java.base/java.security.cert.CertPathBuilder.build(CertPathBuilder.java:297) at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:434)

gz#34048

(related to Zendesk ticket #34048)

TzufTabnine commented 3 months ago

his error means that intellij (or rather, the jvm on which intellij is running on) does not trust the TLS certificate being used. This can happen when there is some network equipment - probably a proxy - that has a custom certificate.

Many times when intellij encounters this, it will pop up a dialog asking you if you trust the certificate. If you approve then things proceed as normal, and everything works. But on other occasions, intellij does not popup the dialog and simply denies the http request. In this case, downloading of the tabnine engine fails, and tabnine cannot function.

Here is what you can try:

Go to intellij Settings Dialog -> Tools -> Server certificates.

If there are some certificates there, you can try erasing them or accepting them. You can also check the "Accept non-trutsted certificates automatically" check box if you choose. Hit OK, restart your IDE and check if that fixed it.

If not, Go to intellij settings Dialog -> System Settings -> HTTP proxy

Assuming you have a proxy configured, you can hit "Check Connection" and in the given check box, type "https://update.tabnine.com". You might get prompted to trust the certificate. If the connection is successful, hit OK, restart your ide and check if things are now working.

If not, You can manually trust the certificate. That means you will have to obtain the certificate from whoever is managing the proxy, and then run the signtool command with the certificate file (it is a template; change accordingly to your version and path) keytool -import -keystore "C:\Program Files\JetBrains\IntelliJ Ultimate Edition 2024.1.4\jbr\lib\security\cacerts" -alias tabnine -file "{path-to-crt}"