Couchbase Kafka Source Connector DNS SRV lookup failed

Couchbase Kafka Source Connector fails with below error when using DNS instead of IP address. The connection succeeds with IP addresses however not with DNS. We are advised to use DNS for enabling TLS. Please advise how to fix this.

[2021-10-15 14:56:14,779] INFO [com.couchbase.core][DnsSrvLookupFailedEvent][172ms] DNS SRV lookup failed (name not found), trying to bootstrap from given hostname directly.

{“coreId”:“0xbd7437d00000007”,“seedNodes”:[{“address”:“couch-xxx.xx.xxxx.com”}]} (com.couchbase.core:537)

[2021-10-15 14:56:14,779] INFO [com.couchbase.node][NodeConnectedEvent] Node connected {“coreId”:“0xbd7437d00000007”,“managerPort”:“8091”,“remote”:" couch-xxx.xx.xxxx.com"} (com.couchbase.node:537)

[2021-10-15 14:56:44,768] WARN [com.couchbase.endpoint][EndpointConnectionFailedEvent][30s] Connect attempt 1 failed because of TimeoutException: Did not observe any item or terminal signal within 30000ms in ‘source(MonoDefer)’ (and no fallback has been configured) {“circuitBreaker”:“DISABLED”,“coreId”:“0xbd7437d00000007”,“remote”:" couch-xxx.xx.xxxx.com:11210",“type”:“KV”} (com.couchbase.endpoint:567)

java.util.concurrent.TimeoutException: Did not observe any item or terminal signal within 30000ms in ‘source(MonoDefer)’ (and no fallback has been configured)
[2021-10-15 14:56:44,783] ERROR WorkerConnector{id=xxxx-bucket} Error while starting connector (org.apache.kafka.connect.runtime.WorkerConnector:193)
java.lang.IllegalStateException: Timeout on blocking read for 30000000000 NANOSECONDS
at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:123)
at reactor.core.publisher.Mono.block(Mono.java:1727)
at com.couchbase.connect.kafka.util.CouchbaseHelper.getConfig(CouchbaseHelper.java:52)

Connector Details
sudo curl -X POST http://xx.xx.xx.xx:7088/connectors -H “Content-Type: application/json” -d @- <<BODY
{
“name”: “xxxx”,
“config”: {
“name”: “xxxx”,
“connector.class”: “com.couchbase.connect.kafka.CouchbaseSourceConnector”,
“tasks.max”: 2,
“couchbase.topic”:“xxxx-bucket”,
“couchbase.seed.nodes”:“xxxxx.com” ,
“couchbase.bootstrap.timeout”:“5s”,
“couchbase.bucket”:“xxxx”,
“couchbase.username”:“xxxxx”,
“couchbase.password”:“xxxxxxx”,
“use_snapshots”: “false”,
“couchbase.event.filter”:“com.couchbase.connect.kafka.filter.AllPassFilter”,
“couchbase.source.handler”: “com.couchbase.connect.kafka.handler.source.DefaultSchemaSourceHandler”,
“couchbase.stream.from”:“SAVED_OFFSET_OR_NOW”,
“couchbase.compression”:“ENABLED”,
“couchbase.flow.control.buffer”:“128m”,
“couchbase.persistence.polling.interval”:“100ms”,
“couchbase.xattrs”:true
}
}
BODY

NSLOOKUP

dig srv xxxx.com

; <<>> DiG 9.16.1-Ubuntu <<>> srv xxxx.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53818
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;xxxx.com. IN SRV

;; ANSWER SECTION:
xxxx.com. 128 IN CNAME xxxx.xxxx.com.

;; Query time: 144 msec
;; SERVER: xx.0.0.53#53(xx.0.0.53)
;; WHEN: Fri Oct 15 15:16:48 UTC 2021
;; MSG SIZE rcvd: 79

Hello @sshankar.sateesh which version of Kafka Connector are you using ?

Thanks for the quick turnaround. I am using kafka connect 4.1 and couchbase version 6.6. I was able to figure out the issue. Looks like I have to use the individual node names after doing nslookup srv request. Just wanted to enumerate the steps below for Ubuntu OS for others facing similar issue.

  1. Make sure your dns name is SRV enabled using below command
    dig srv <Your_couchbase_DNS_name.com>

Should return below results
Your_couchbase_DNS_name.com. 299 IN SRV 0 100 8091 node1.local.com.
Your_couchbase_DNS_name.com. 299 IN SRV 0 100 8091 node2.dv.local.com.
Your_couchbase_DNS_name.com. 299 IN SRV 0 100 8091 node3.dv.local.com.
Your_couchbase_DNS_name.com. 299 IN SRV 0 100 8091 node4.dv.local.com.

  1. Use node1.local.com, node2.dv.local.com, node3.dv.local.com, node4.dv.local.com in your connector

sudo curl -X POST http://xx.xx.xx.xx:7088/connectors -H “Content-Type: application/json” -d @- <<BODY
{
“name”: “testconnector”,
“config”: {
“name”: “testconnector”,
“connector.class”: “com.couchbase.connect.kafka.CouchbaseSourceConnector”,
“tasks.max”: 2,
“couchbase.topic”:“your-couchbase-target-topic”,
“couchbase.seed.nodes”:“node1.local.com,node2.local.com,node3.local.com.com,node4.local.com” ,
“couchbase.bootstrap.timeout”:“5s”,
“couchbase.bucket”:“your_couchbase_bucket”,
“couchbase.username”:“removed”,
“couchbase.password”:“removed”,
“use_snapshots”: “false”,
“couchbase.event.filter”:“com.couchbase.connect.kafka.filter.AllPassFilter”,
“couchbase.source.handler”: “com.couchbase.connect.kafka.handler.source.DefaultSchemaSourceHandler”,
“couchbase.stream.from”:“SAVED_OFFSET_OR_NOW”,
“couchbase.compression”:“ENABLED”,
“couchbase.flow.control.buffer”:“128m”,
“couchbase.persistence.polling.interval”:“100ms”,
“couchbase.xattrs”:true,
“couchbase.enable.tls”:true,
“couchbase.trust.certificate.path”:"/yourpath/Your_Cert_Chain.Pem"
}
}
BODY

  1. SDK Doctor really helped troubleshoot myself

Troubleshooting Cloud Connections During Development | Couchbase Docs