Couchbase connectivity error in Couchbase connector elastic search

In the default-connector.toml, mentioned the domain url along with port no, Able to login to couchbase server through browser from the host specified(http://domain:18091).
In connector It gives the error
hosts = [‘domain:18091’]
Exception in thread “main” com.couchbase.client.core.error.InvalidArgumentException: Specifying 8091 or 18091 in the connection string “domain:8091” is likely not what you want (it would connect to key/value via the management port which does not work). Please omit the port and use “domain” instead.

When port was removed from the hostname It throws error

com.couchbase.client.dcp.deps.io.netty.channel.ConnectTimeoutException: Handshake did not complete before deadline. If your seed nodes include a custom port, make sure it’s the port of the KV service which defaults to 11210 (or 11207 for TLS).

Able to connect to elastic cluster by mentioning the port number. Can anyone help me out to fix the issue?

Hi Karthik,

How you are deploying Couchbase? Are you using alternate addresses? Connecting to Couchbase from a different network?

Thanks,
David

Hi,
Deployed both elastic and couchbase in gcp instance with consul service as dns.

I tried with ip alone in host field in config file. other nodes were identified and Connectivity was established for couchbase. Still getting the below error and process gets ended

c.c.c.d.t.n.DcpConnectHandler - [id:, L:/ip:47784 - R:/ip:11210] Couchbase Server version 6.0.2-2413
Negotiated features: [0x0006 (XATTR), 0x0007 (XERROR), 0x0008 (SELECT_BUCKET), 0x000a (SNAPPY), 0x000c (DUPLEX), 0x000d (CLUSTERMAP_CHANGE_NOTIFICATION)]
com.couchbase.client.dcp.deps.io.netty.channel.ConnectTimeoutException: Handshake did not complete before deadline. If your seed nodes include a custom port, make sure it’s the port of the KV service which defaults to 11210 (or 11207 for TLS)
Did not receive initial configuration from cluster within 12000ms
ERROR c.c.c.c.StaticCoordinator - PANIC: DCP stream failure.
INFO c.c.c.d.c.Conductor - Shutdown complete.

Is the elasticsearch connector also deployed in the gcp network?

yes. elastic search also part of gcp instance

Hi Karthik,

yes. elastic search also part of gcp instance

Can you clarify please whether the connector is running in the same network?

Thanks,
David

No, I tried running connector in my local machine. but elastic connection was established through connector.

  1. Is it required to run connector in same network which elastic search runs?
  2. What does the provided error message infer?

thanks

Hi Karthik,

  1. Is it required to run connector in same network which elastic search runs?

No, as long as Elasticsearch is publicly accessible. The challenge is in talking to Couchbase from a different network.

  1. What does the provided error message infer?

Couchbase needs special configuration if you want to access it from another network. See About Alternate Addresses and Configuring Alternate Addresses using the REST API.

If you’re using Couchbase Capella, or deploying the Couchbase Operator in Kubernetes, this configuration happens automatically. But if you’re deploying by hand, it’s necessary to configure the alternate address settings yourself.

You’d want to configure it so that Couchbase Server advertises the external hostname and port for each service, in addition to the local hostname and port. Then you tell your client (the connector, in this case) to connect to the external hostname, using the port that’s mapped to the KV service.

Or… you could just run the connector in the same network as Couchbase, which is probably how you’d want to do things in a production environment anyway.

Thanks,
David

Hi David,

I tried running connector inside same vm where couchbase runs

Logs
Node connected {“coreId”:“0xe21b0a0500000001”,“managerPort”:“8091”,“remote”:“ip1”}
Node connected {“coreId”:“0xe21b0a0500000001”,“managerPort”:“8091”,“remote”:“ip2”}
Node connected {“coreId”:“0xe21b0a0500000001”,“managerPort”:“8091”,“remote”:“ip3”}

[com.couchbase.endpoint][EndpointConnectionFailedEvent][109ms] Connect attempt 1 failed because of NativeIoException: readAddress(…) failed: Connection reset by peer {“bucket”:“travel-sample”,“circuitBreaker”:“DISABLED”,“coreId”:“0xe21b0a0500000001”,“remote”:“ip1:11207”,“type”:“KV”}

com.couchbase.client.core.deps.io.netty.channel.unix.Errors$NativeIoException: readAddress(…) failed: Connection reset by peer

Detected Exception in IO Layer: readAddress(…) failed: Connection reset by peer, Cause: (none) {“bucket”:“travel-sample”,“coreId”:“0xe21b0a0500000001”,“local”:"/ip1:39174",“remote”:“ip1/ip1:11207”}

Opened bucket “travel-sample” {“coreId”:“0xe21b0a0500000001”}

[com.couchbase.endpoint][EndpointConnectionFailedEvent][10s] Connect attempt 1 failed because of TimeoutException: Did not observe any item or terminal signal within 10000ms in ‘source(MonoDefer)’ (and no fallback has been configured) {“circuitBreaker”:“DISABLED”,“coreId”:“0xe21b0a0500000001”,“remote”:“ip1:11207”,“type”:“KV”}

java.util.concurrent.TimeoutException: Did not observe any item or terminal signal within 10000ms in ‘source(MonoDefer)’ (and no fallback has been configured)

Exception in thread “main” com.couchbase.client.core.error.UnambiguousTimeoutException: WaitUntilReady timed out
at com.couchbase.client.java.AsyncUtils.block(AsyncUtils.java:51)
at com.couchbase.client.java.Bucket.waitUntilReady(Bucket.java:243)
at com.couchbase.connector.dcp.CouchbaseHelper.waitForBucket(CouchbaseHelper.java:256)
at com.couchbase.connector.elasticsearch.ElasticsearchConnector.run(ElasticsearchConnector.java:135)
at com.couchbase.connector.elasticsearch.ElasticsearchConnector.main(ElasticsearchConnector.java:103)
Suppressed: java.lang.Exception: The above exception was originally thrown by another thread at the following location.
at com.couchbase.client.core.diagnostics.WaitUntilReadyHelper.lambda$waitUntilReady$12(WaitUntilReadyHelper.java:165

connection is closed

Hi Karthik,

I see some of those log messages reference port 11207. This is the default KV port for secure connections with TLS. This makes me think the connector is [at least partially] configured to use secure connections. Can you check the value of the secureConnection config property in the [couchbase] section? If it’s true, can you try setting it to false?

Also, there’s a tool called SDK Doctor that’s useful for diagnosing connection issues. What does SDK Doctor tell you if you run it inside the same VM where you’re trying to run the connector?

https://docs.couchbase.com/server/current/sdk/sdk-doctor.html

Thanks,
David

1 Like