Hi guys!
I currently used the Java SDK 3.1.4 to connect with Couchbase Server Enterprise Edition.
When try to connect using Transport Layer Security and use Keystore file to client authentication, I have the WaitUntilReady timed out error:
public void doSomething() throws Exception {
protected CouchbaseSettingImpl setting;SecurityConfig.Builder securityConfigBuilder = SecurityConfig.builder();
securityConfigBuilder.enableHostnameVerification(false);
securityConfigBuilder.enableTls(true);
securityConfigBuilder.trustStore(java.nio.file.Paths.get(“trust-jks-file-path”), “trust-jks-file-password”, Optional.of(“JKS”));ClusterEnvironment env = ClusterEnvironment.builder()
.securityConfig(securityConfigBuilder)
.ioConfig(IoConfig.enableDnsSrv(false))
.build();Authenticator authenticator = CertificateAuthenticator.fromKeyStore(java.nio.file.Paths.get(“client-jks-file-path”), “client-jks-file-password”, Optional.of(“JKS”));
Cluster cluster = Cluster.connect(setting.connectionString(), ClusterOptions.clusterOptions(authenticator).environment(env));
Bucket bucket = cluster.bucket(setting.bucket());
// ERROR HERE
bucket.waitUntilReady(Duration.ofSeconds(15));// Do something when connect successfully
}
Issue:
com.couchbase.client.core.error.UnambiguousTimeoutException: WaitUntilReady timed out
{“bucket”:“Advantco”,“checkedServices”:
[ ]
,“currentState”:“DEGRADED”,“desiredState”:“ONLINE”,“services”:{“kv”:[{“namespace”:“Advantco”,“state”:“disconnected”},{“last_activity_us”:12684,“state”:“connected”,“id”:“0x209443a4”,“remote”:“hdfsslave2.sms.com:11207”,“local”:“172.16.6.38:57080”}],“mgmt”:[{“state”:“connected”,“id”:“0x55b96b08”,“remote”:“hdfsslave2.sms.com:18091”,“local”:“172.16.6.38:57210”},{“state”:“connected”,“id”:“0x34750064”,“remote”:“hdfsslave2.sms.com:18091”,“local”:“172.16.6.38:57211”}]},“timeoutMs”:10000}
Full log:
Message: caae0800-c2f7-11eb-b330-0000008016d3: Message processing failed.
Cause: com.couchbase.client.core.error.UnambiguousTimeoutException: WaitUntilReady timed out
{“bucket”:“Example”,“checkedServices”:[ ]
,“currentState”:“DEGRADED”,“desiredState”:“ONLINE”,“services”:{“kv”:[{“namespace”:“Example”,“state”:“disconnected”},{“last_activity_us”:12684,“state”:“connected”,“id”:“0x209443a4”,“remote”:“hdfsslave2.sms.com:11207”,“local”:“172.16.6.38:57080”}],“mgmt”:[{“state”:“connected”,“id”:“0x55b96b08”,“remote”:“hdfsslave2.sms.com:18091”,“local”:“172.16.6.38:57210”},{“state”:“connected”,“id”:“0x34750064”,“remote”:“hdfsslave2.sms.com:18091”,“local”:“172.16.6.38:57211”}]},“timeoutMs”:10000}
at com.couchbase.client.java.AsyncUtils.block(AsyncUtils.java:51)
at com.couchbase.client.java.Bucket.waitUntilReady(Bucket.java:232)
at com.example.couchbase.core.impl.ConnectionBase.open(ConnectionBase.java:96)
at com.example.adapterbase.impl.ProduceStrategy.process(ProduceStrategy.java:15)
…
Environment:
Couchbase Server Enterprise Edition 6.6.2 build 958
Couchbase-Java-Client-3.1.4
Frequency of appearance:
90%
Usually, it will fail to connect for 4-5 times, then I will have 1 successful connection
More information:
When I use another machine to run these lines of code, it’s successfully connected to the couchbase server
Can anyone help me solve this problem?
Thanks!