SAP Netweaver WaitUntilReady timed out error when try to connect to Couchbase server

Hi All
I have some code to make the connection to the Couchbase server.
I want to test the connection to Couchbase server through 2 test cases

TC1: Connect to Couchbase server using Username / Password
TC2: Connect to Couchbase server using Java Keystore (JKS)

I tried running that code on 2 different environments

E1: My local computer
E2: SAP Netweaver system


E1: Both TC1 and TC2 connected successfully
E2: TC1 connected successfully
TC2: WaitUntilReady timed out error. Sometimes the connection is successful(Frequency 1/15)

Can someone show me what happened to ‘E2’. Or what can I modify to make TC2 run successfully on E2?

When you say …

Do you mean to be stating that you’re using TLS, or you’re using certificate authentication. The Java keystore may be used in both.

It’s just a guess, but there may be additional hostname verification through DNS in E2, and perhaps misconfigured DNS where it searches two or more DNS servers and times out before getting an answer from another could explain behavior like this. I don’t have any real evidence for that, but it is something I have seen before.

You may want to run Java Flight Recorder or some other profiler in E2 to see where the time is going in the application.

@dtnguyen in addition to what matt said, if you use a recent SDK version (i.e. 3.2.1) in the logs as part of the wait until ready timeout, you’ll see (or even better share with us) what part of it completed and where it timed out and how long it took.

@ingenthr In this case, I want to check TLS connect

My codes:

public void doUpsert() throws Exception {
protected CouchbaseSettingImpl setting;

SecurityConfig.Builder securityConfigBuilder = SecurityConfig.builder();
securityConfigBuilder.trustStore(java.nio.file.Paths.get(“trust-jks-file-path”), “trust-jks-file-password”, Optional.of(“JKS”));

ClusterEnvironment env = ClusterEnvironment.builder()

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());

// Do something when connecting successfully

Error displayed

Catching exception calling messaging system: javax.resource.ResourceException: com.couchbase.client.core.error.UnambiguousTimeoutException: WaitUntilReady timed out {“bucket”:“sample”,“checkedServices”:[ ],“currentState”:“ONLINE”,“desiredState”:“ONLINE”,“services”:{“kv”:[{“last_activity_us”:9393966,“state”:“connected”,“id”:“0xf17f6987”,“remote”:“”,“local”:“”}]},“timeoutMs”:10000}: com.couchbase.client.core.error.UnambiguousTimeoutException: WaitUntilReady timed out {“bucket”:“Advantco”,“checkedServices”:[ ],“currentState”:“ONLINE”,“desiredState”:“ONLINE”,“services”:{“kv”:[{“last_activity_us”:9393966,“state”:“connected”,“id”:“0xf17f6987”,“remote”:“”,“local”:“”}]},“timeoutMs”:10000}: WaitUntilReady timed out

Full trace log: (13.6 KB)

Please help me. Thanks.