Couchbase 5.5 Error when trying DNS SRV

I have tried python and node SDK’s. They both say DNS SRV lookup failed: but node had a little more info…

0ms [I41dff1d0] {13635} [INFO] (instance - L:146) DNS SRV lookup failed: The requested feature is not supported by the client, either because of settings in the configured instance, or because of options disabled at the time the library was compiled. Ignore this if not relying on DNS SRV records

Here is record.

[ec2-user@sandboxcbfsdat1 ~]$ LCB_LOGLEVEL=5  python test.py
INFO:couchbase:Initializing Couchbase logging. lcb_version=('2.10.3', 135171)
0ms [Iccf62cb1] {8114} [INFO] (instance - L:469) Version=2.10.3, Changeset=b387722192f0bc49b0a846859610493e2f8129cd
0ms [Iccf62cb1] {8114} [INFO] (instance - L:470) Effective connection string: couchbase://bootstrap.couchbase.sandbox.example.org/MyBucket?username=Administrator. Bucket=MyBucket
3ms [Iccf62cb1] {8114} [INFO] (instance - L:146) DNS SRV lookup failed: Invalid reply received from nameserver. Ignore this if not relying on DNS SRV records

Record looks correct to me…

[ec2-user@sandboxcbfsdat1 ~]$ dig srv _couchbase._tcp.bootstrap.couchbase.sandbox.example.org

; <<>> DiG 9.9.4-RedHat-9.9.4-73.el7_6 <<>> srv _couchbase._tcp.bootstrap.couchbase.sandbox.example.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57484
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 4, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;_couchbase._tcp.bootstrap.couchbase.sandbox.example.org. IN SRV

;; ANSWER SECTION:
_couchbase._tcp.bootstrap.couchbase.sandbox.example.org. 60 IN SRV 10 10 0 ip-10-76-21-36.ec2.internal.
_couchbase._tcp.bootstrap.couchbase.sandbox.example.org. 60 IN SRV 10 10 0 ip-10-76-21-98.ec2.internal.
_couchbase._tcp.bootstrap.couchbase.sandbox.example.org. 60 IN SRV 10 10 0 ip-10-76-20-206.ec2.internal.
_couchbase._tcp.bootstrap.couchbase.sandbox.example.org. 60 IN SRV 10 10 0 ip-10-76-20-22.ec2.internal.

;; AUTHORITY SECTION:
sandbox.example.org.       119451  IN      NS      ns-1536.awsdns-00.co.uk.
sandbox.example.org.       119451  IN      NS      ns-1024.awsdns-00.org.
sandbox.example.org.       119451  IN      NS      ns-0.awsdns-00.com.
sandbox.example.org.       119451  IN      NS      ns-512.awsdns-00.net.

;; Query time: 3 msec
;; SERVER: 10.68.10.11#53(10.68.10.11)
;; WHEN: Thu Feb 28 08:45:33 CST 2019
;; MSG SIZE  rcvd: 405
0ms [I41dff1d0] {13635} [INFO] (instance - L:469) Version=2.9.5-njs, Changeset=2bf296af07b40e1b0163f900c4f8bf388ae4e8a3
0ms [I41dff1d0] {13635} [INFO] (instance - L:470) Effective connection string: couchbase://bootstrap.couchbase.sandbox.example.org/MyBucket?enable_errmap=true&enable_tracing=true&client_string=couchnode%2F2.6.3%20(node%2F11.10.0%3B%20v8%2F7.0.276.38-node.17%3B%20ssl%2F1.1.1a). Bucket=MyBucket
0ms [I41dff1d0] {13635} [DEBUG] (instance - L:318) Applying initial cntl enable_errmap=true
0ms [I41dff1d0] {13635} [DEBUG] (instance - L:318) Applying initial cntl enable_tracing=true
0ms [I41dff1d0] {13635} [DEBUG] (instance - L:318) Applying initial cntl client_string=couchnode/2.6.3 (node/11.10.0; v8/7.0.276.38-node.17; ssl/1.1.1a)
0ms [I41dff1d0] {13635} [INFO] (instance - L:146) DNS SRV lookup failed: The requested feature is not supported by the client, either because of settings in the configured instance, or because of options disabled at the time the library was compiled. Ignore this if not relying on DNS SRV records0ms [I41dff1d0] {13635} [DEBUG] (instance - L:83) Adding host bootstrap.couchbase.sandbox.g6hm.org:8091 to initial HTTP bootstrap list
0ms [I41dff1d0] {13635} [DEBUG] (instance - L:83) Adding host bootstrap.couchbase.sandbox.g6hm.org:11210 to initial CCCP bootstrap list
0ms [I41dff1d0] {13635} [TRACE] (instance - L:126) Bootstrap hosts loaded (cccp:1, http:1)

From a quick look at the code, it looks like they reason for the DNS SRV failure is in the string there:
The requested feature is not supported by the client, either because of settings in the configured instance, or because of options disabled at the time the library was compiled

Digging further, this may happen if your name resolution libs on the system don’t support SRV records.

@ingenthr It’s actually a bug in the documentation. Docs clearly say to use port 0. But when switching the port to mem cache port it works fine. Opening PR to fix now.

Ah, great! Glad you worked it out and let me know if I can help shepherd the PR forward.

@ingenthr https://github.com/couchbase/docs-cb4/pull/2890