couchbase.exceptions.UnAmbiguousTimeoutException

Hi there, I’m getting couchbase.exceptions.UnAmbiguousTimeoutException every time I try to connect to our Couchbase cluster using the python SDK. With the same naming and configuration, I have no issue connecting via .NET sdk.

This is my python code:

class CouchbaseBase:
    def __init__(self, endpoint, username, password, bucket_name):

        logging.basicConfig(filename='example.log',
                            filemode='w',
                            level=logging.DEBUG,
                            format='%(levelname)s::%(asctime)s::%(message)s',
                            datefmt='%Y-%m-%d %H:%M:%S')
        logger = logging.getLogger()
        couchbase.configure_logging(logger.name, level=logger.level)

        # Connect options - authentication
        auth = PasswordAuthenticator(username, password)
        timeout_opts = ClusterTimeoutOptions(connect_timeout=timedelta(seconds=60),
                                             kv_timeout=timedelta(seconds=60))

        # get a reference to our cluster
        options = ClusterOptions(auth, timeout_options=timeout_opts)
        cluster = Cluster.connect(f"couchbase://{endpoint}", options)

        # Wait until the cluster is ready for use.
        cluster.wait_until_ready(timedelta(seconds=5))

And this is the logs ( some parts are replaced for security reasons):

DEBUG::2024-06-24 09:58:57::{"openssl_default_cert_dir": "/etc/ssl/certs", "openssl_default_cert_file": "/etc/ssl/cert.pem", "openssl_headers": "OpenSSL 1.1.1 (compatible; BoringSSL)", "openssl_runtime": "BoringSSL", "txns_forward_compat_extensions": "TI,MO,BM,QU,SD,BF3787,BF3705,BF3838,RC,UA,CO,BF3791,CM,SI,QC,IX,TS,PU", "txns_forward_compat_protocol_version": "2.0", "version": "1.0.0"}
DEBUG::2024-06-24 09:58:57::Found DNS Servers: [10.70.0.2, 10.2.127.254, 8.8.8.8], selected nameserver: "10.70.0.2"
DEBUG::2024-06-24 09:58:57::open cluster, id: "a7e0e7-ee62-6f4b-ab4b-67f599fe7e4337", core version: "1.0.0+", {"bootstrap_nodes":[{"hostname":"couchbase-named-address.com","port":"11210"}],"options":{"analytics_timeout":"75000ms","bootstrap_timeout":"10000ms","config_idle_redial_timeout":"300000ms","config_poll_floor":"50ms","config_poll_interval":"2500ms","connect_timeout":"60000ms","disable_mozilla_ca_certificates":false,"dns_config":{"nameserver":"10.70.0.2","port":53,"timeout":"500ms"},"dump_configuration":false,"enable_clustermap_notification":true,"enable_compression":true,"enable_dns_srv":true,"enable_metrics":true,"enable_mutation_tokens":true,"enable_tcp_keep_alive":true,"enable_tls":false,"enable_tracing":true,"enable_unordered_execution":true,"idle_http_connection_timeout":"1000ms","key_value_durable_timeout":"10000ms","key_value_timeout":"60000ms","management_timeout":"75000ms","max_http_connections":0,"metrics_options":{"emit_interval":"600000ms"},"network":"auto","query_timeout":"75000ms","resolve_timeout":"2000ms","search_timeout":"75000ms","show_queries":false,"tcp_keep_alive_interval":"60000ms","tls_verify":"peer","tracing_options":{"analytics_threshold":"1000ms","key_value_threshold":"500ms","management_threshold":"1000ms","orphaned_emit_interval":"10000ms","orphaned_sample_size":64,"query_threshold":"1000ms","search_threshold":"1000ms","threshold_emit_interval":"10000ms","threshold_sample_size":64,"view_threshold":"1000ms"},"transactions_options":{"cleanup_config":{"cleanup_client_attempts":false,"cleanup_lost_attempts":false,"cleanup_window":"0ms","collections":[]},"durability_level":"none","query_config":{"scan_consistency":"not_bounded"},"timeout":"0ns"},"trust_certificate":"","use_ip_protocol":"any","user_agent_extra":"pycbc/4.2.1 (python/3.9.7)","view_timeout":"75000ms"}}
DEBUG::2024-06-24 09:58:57::Query DNS-SRV: address="couchbase-named-address.com", service="_couchbase", nameserver="10.70.0.2:53"
DEBUG::2024-06-24 09:58:57::DNS UDP returned 0 records
WARNING::2024-06-24 09:58:57::DNS SRV query returned 0 records for "couchbase-named-address.com", assuming that cluster is listening this address
DEBUG::2024-06-24 09:58:57::[a7e0e7-ee62-6f4b-ab4b-67f599fe7e4337/b49bd8-2d09-e440-6ac3-0b7691c4cef19e/plain/-] <couchbase-named-address.com:11210> attempt to establish MCBP connection
DEBUG::2024-06-24 09:58:57::[a7e0e7-ee62-6f4b-ab4b-67f599fe7e4337/b49bd8-2d09-e440-6ac3-0b7691c4cef19e/plain/-] <couchbase-named-address.com:11210> connecting to 127.0.0.1:11210 ("couchbase-named-address.com:11210"), timeout=60000ms
DEBUG::2024-06-24 09:58:59::[a7e0e7-ee62-6f4b-ab4b-67f599fe7e4337/b49bd8-2d09-e440-6ac3-0b7691c4cef19e/plain/-] <couchbase-named-address.com:11210> reached the end of list of bootstrap nodes, waiting for 500ms before restart
DEBUG::2024-06-24 09:59:00::[a7e0e7-ee62-6f4b-ab4b-67f599fe7e4337/b49bd8-2d09-e440-6ac3-0b7691c4cef19e/plain/-] <couchbase-named-address.com:11210> attempt to establish MCBP connection
DEBUG::2024-06-24 09:59:00::[a7e0e7-ee62-6f4b-ab4b-67f599fe7e4337/b49bd8-2d09-e440-6ac3-0b7691c4cef19e/plain/-] <couchbase-named-address.com:11210> connecting to 127.0.0.1:11210 ("couchbase-named-address.com:11210"), timeout=60000ms
DEBUG::2024-06-24 09:59:02::[a7e0e7-ee62-6f4b-ab4b-67f599fe7e4337/b49bd8-2d09-e440-6ac3-0b7691c4cef19e/plain/-] <couchbase-named-address.com:11210> reached the end of list of bootstrap nodes, waiting for 500ms before restart
DEBUG::2024-06-24 09:59:02::[a7e0e7-ee62-6f4b-ab4b-67f599fe7e4337/b49bd8-2d09-e440-6ac3-0b7691c4cef19e/plain/-] <couchbase-named-address.com:11210> attempt to establish MCBP connection
DEBUG::2024-06-24 09:59:02::[a7e0e7-ee62-6f4b-ab4b-67f599fe7e4337/b49bd8-2d09-e440-6ac3-0b7691c4cef19e/plain/-] <couchbase-named-address.com:11210> connecting to 127.0.0.1:11210 ("couchbase-named-address.com:11210"), timeout=60000ms
DEBUG::2024-06-24 09:59:04::[a7e0e7-ee62-6f4b-ab4b-67f599fe7e4337/b49bd8-2d09-e440-6ac3-0b7691c4cef19e/plain/-] <couchbase-named-address.com:11210> reached the end of list of bootstrap nodes, waiting for 500ms before restart
DEBUG::2024-06-24 09:59:05::[a7e0e7-ee62-6f4b-ab4b-67f599fe7e4337/b49bd8-2d09-e440-6ac3-0b7691c4cef19e/plain/-] <couchbase-named-address.com:11210> attempt to establish MCBP connection
DEBUG::2024-06-24 09:59:05::[a7e0e7-ee62-6f4b-ab4b-67f599fe7e4337/b49bd8-2d09-e440-6ac3-0b7691c4cef19e/plain/-] <couchbase-named-address.com:11210> connecting to 127.0.0.1:11210 ("couchbase-named-address.com:11210"), timeout=60000ms
DEBUG::2024-06-24 09:59:07::[a7e0e7-ee62-6f4b-ab4b-67f599fe7e4337/b49bd8-2d09-e440-6ac3-0b7691c4cef19e/plain/-] <couchbase-named-address.com:11210> reached the end of list of bootstrap nodes, waiting for 500ms before restart
DEBUG::2024-06-24 09:59:07::all nodes failed to bootstrap, triggering DNS-SRV refresh, ec=unambiguous_timeout (14), last endpoint="couchbase-named-address.com:11210"
WARNING::2024-06-24 09:59:07::[a7e0e7-ee62-6f4b-ab4b-67f599fe7e4337/b49bd8-2d09-e440-6ac3-0b7691c4cef19e/plain/-] <couchbase-named-address.com:11210> unable to bootstrap in time
DEBUG::2024-06-24 09:59:07::[a7e0e7-ee62-6f4b-ab4b-67f599fe7e4337/b49bd8-2d09-e440-6ac3-0b7691c4cef19e/plain/-] <couchbase-named-address.com:11210> stop MCBP connection, reason=do_not_retry
DEBUG::2024-06-24 09:59:07::Query DNS-SRV: address="couchbase-named-address.com", service="_couchbase", nameserver="10.70.0.2:53"
DEBUG::2024-06-24 09:59:07::PYCBC: create conn callback completed
DEBUG::2024-06-24 09:59:07::[a7e0e7-ee62-6f4b-ab4b-67f599fe7e4337/b49bd8-2d09-e440-6ac3-0b7691c4cef19e/plain/-] <couchbase-named-address.com:11210> destroy MCBP connection

The only difference I’m seeing in my.NET configuration, is there are some options to HttpIgnoreRemoteCertificateMismatch and KvIgnoreRemoteCertificateNameMismatch which I set to true

The .net equivalent code that is working without any issue:

_clusterOptions = new ClusterOptions();
config.GetCouchbaseClientDefinition().Bind(_clusterOptions);

_clusterOptions.HttpCertificateCallbackValidation += new RemoteCertificateValidationCallback((object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) =>
{
    return true;
});
_clusterOptions.KvCertificateCallbackValidation += new RemoteCertificateValidationCallback((object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) =>
{
    return true;
});

_clusterOptions.NetworkResolution = config.GetCouchbaseNetworkResolution();
_clusterOptions.EnableDnsSrvResolution = config.GetCouchbaseEnableDnsSrvResolution();

_clusterOptions.WithSerializer(new CouchbaseSerializer());
_clusterOptions.AddLinq();
_clusterOptions.KvTimeout = TimeSpan.FromSeconds(10);

config.GetCouchbaseBucketMapping().Bind(_bucketNamesMapping);
_cluster = Cluster.ConnectAsync(_clusterOptions).Result;

Hi @aminrd

It looks like the issue is your endpoint you are provided is invalid, as from the logs it appears to be “couchbase-named-address.com

Thanks @graham.pople, but I replaced the real url with this one for privacy reasons. But the same url in configs works in .net code and I’m also able to access the web console via https://couchbase-named-address.com:8091

@aminrd ah, understood. In that case I would suspect an issue with the certs, based on this:

I think if you add ?ssl=no_verify to the end of your connection string in Python you will get the same behaviour, and it’ll likely work.

But this is an insecure configuration, and it would be better to fix the certs.

SSL port is 18091 or use couchbases://couchbase-named-address.com

Thanks @graham.pople I did use couchbases://couchbase-named-address.com?ssl=no_verity and still getting UnAmbiguousTimeoutException.

@vsr1 You’re right, I noticed that on the web, I’m connecting to https://couchbase-named-address.com:18091 and in my code, using couchbase://couchbase-named-address.com.

Actually, using the Couchbase .NET library, I’m passing couchbase-named-address.com as ConnectionString and have no issue there. In Python, I used both couchbase://couchbase-named-address.com and couchbase-named-address.com but both give me the same error unfortunately.

Is the bucket reference missing in your Python code?
I’m not a developer but from work experience, we found out that severl Python application couldn’t connect to Couchbase Server without adding the bucket to the endpoint.
Something like: couchbases://node:18091/bucket

Give it a try.

@fabiosst Thank you, but still no luck in that. I checked my .net options and wanted to post here the actual values in configs for that:

_clusterOptions = new ClusterOptions();
config.GetCouchbaseClientDefinition().Bind(_clusterOptions);

_clusterOptions.HttpCertificateCallbackValidation += new RemoteCertificateValidationCallback((object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) =>{return true;});
_clusterOptions.KvCertificateCallbackValidation += new RemoteCertificateValidationCallback((object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) =>{return true;});

_clusterOptions.NetworkResolution = "external";
_clusterOptions.EnableDnsSrvResolution = false;

_clusterOptions.WithSerializer(new CouchbaseSerializer());
_clusterOptions.AddLinq();
_clusterOptions.KvTimeout = TimeSpan.FromSeconds(10);

And then tried to match these configs on my Python code using:

        auth = PasswordAuthenticator(username, password)
        timeout_opts = ClusterTimeoutOptions(connect_timeout=timedelta(seconds=10),
                                             kv_timeout=timedelta(seconds=10))

        options = ClusterOptions(auth,
                                 timeout_options=timeout_opts,
                                 disable_mozilla_ca_certificates=True,
                                 enable_dns_srv=False,
                                 tls_verify=None)

But couldn’t find what is the equivalent for NetworkResolution in Python::ClusterOptions?

Actually, using the Couchbase .NET library, I’m passing couchbase-named-address.com as ConnectionString and have no issue there. In Python, I used both couchbase://couchbase-named-address.com and couchbase-named-address.com but both give me the same error unfortunately.

From your previous comment you used “couchbase://couchbase-named-address.com” but not “couchbases://couchbase-named-address.com” which is the secure endpoint.

From the first comment, you used in your code:
cluster = Cluster.connect(f"couchbase://{endpoint}", options)
which is still the non secure connection.

From the logs the connection is attempting on the 11210 port that’s no the encrypted one, which is the 11207

Is the cluster you’re connecting to exposed with certificates and encrypted ports only?

@fabiosst That’s a good point actually, I can give it a try. Do you know how can I make the python SDK connect to the encrypted port? I tried ClusterOptions->enabled_tls=True but didn’t help ( checked the logs, still using port 11210 )

What I updated was:

options = ClusterOptions(auth, ....., enable_tls=True, tls_verify=TLSVerifyMode.NONE,......)

You just need to specify the couchbases:// protocol, with an ending s.
This will tell the SDK to connect to the encrypted port.

@fabiosst I see, thank you, that made a progress. Based on logs, it could get connected to port 11207 and then get the time out exception for other reasons:

DEBUG::2024-06-30 08:51:33::{"openssl_default_cert_dir": "/etc/ssl/certs", "openssl_default_cert_file": "/etc/ssl/cert.pem", "openssl_headers": "OpenSSL 1.1.1 (compatible; BoringSSL)", "openssl_runtime": "BoringSSL", "txns_forward_compat_extensions": "TI,MO,BM,QU,SD,BF3787,BF3705,BF3838,RC,UA,CO,BF3791,CM,SI,QC,IX,TS,PU", "txns_forward_compat_protocol_version": "2.0", "version": "1.0.0"}
DEBUG::2024-06-30 08:51:33::Found DNS Servers: [1.2.3.5, 8.8.8.8], selected nameserver: "1.2.3.5"
DEBUG::2024-06-30 08:51:33::open cluster, id: "97f792-8148-fc4a-9de8-80a56f5ffe9d19", core version: "1.0.0+", {"bootstrap_nodes":[{"hostname":"couchbase-named-address.com","port":"11207"}],"options":{"analytics_timeout":"75000ms","bootstrap_timeout":"10000ms","config_idle_redial_timeout":"300000ms","config_poll_floor":"50ms","config_poll_interval":"2500ms","connect_timeout":"10000ms","disable_mozilla_ca_certificates":true,"dns_config":{"nameserver":"10.70.0.2","port":53,"timeout":"500ms"},"dump_configuration":false,"enable_clustermap_notification":true,"enable_compression":true,"enable_dns_srv":false,"enable_metrics":true,"enable_mutation_tokens":true,"enable_tcp_keep_alive":true,"enable_tls":true,"enable_tracing":true,"enable_unordered_execution":true,"idle_http_connection_timeout":"1000ms","key_value_durable_timeout":"10000ms","key_value_timeout":"10000ms","management_timeout":"75000ms","max_http_connections":0,"metrics_options":{"emit_interval":"600000ms"},"network":"auto","query_timeout":"75000ms","resolve_timeout":"2000ms","search_timeout":"75000ms","show_queries":false,"tcp_keep_alive_interval":"60000ms","tls_verify":"none","tracing_options":{"analytics_threshold":"1000ms","key_value_threshold":"500ms","management_threshold":"1000ms","orphaned_emit_interval":"10000ms","orphaned_sample_size":64,"query_threshold":"1000ms","search_threshold":"1000ms","threshold_emit_interval":"10000ms","threshold_sample_size":64,"view_threshold":"1000ms"},"transactions_options":{"cleanup_config":{"cleanup_client_attempts":false,"cleanup_lost_attempts":false,"cleanup_window":"0ms","collections":[]},"durability_level":"none","query_config":{"scan_consistency":"not_bounded"},"timeout":"0ns"},"trust_certificate":"","use_ip_protocol":"any","user_agent_extra":"pycbc/4.2.1 (python/3.9.7)","view_timeout":"75000ms"}}
DEBUG::2024-06-30 08:51:33::[97f792-8148-fc4a-9de8-80a56f5ffe9d19]: use default CA for TLS verify
DEBUG::2024-06-30 08:51:33::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/d988d4-2aa8-e144-7b86-6efc61377697c6/tls/-] <couchbase-named-address.com:11207> attempt to establish MCBP connection
DEBUG::2024-06-30 08:51:33::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/d988d4-2aa8-e144-7b86-6efc61377697c6/tls/-] <couchbase-named-address.com:11207> connecting to 1.2.3.4:11207 ("couchbase-named-address.com:11207"), timeout=10000ms
DEBUG::2024-06-30 08:51:34::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/d988d4-2aa8-e144-7b86-6efc61377697c6/tls/-] <couchbase-named-address.com:11207> connected to 1.2.3.4:11207
DEBUG::2024-06-30 08:51:34::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/d988d4-2aa8-e144-7b86-6efc61377697c6/tls/-] <couchbase-named-address.com/1.2.3.4:11207> user_agent={"a":"cxx/1.0.0/;Windows/AMD64;bssl/0x1010107f;pycbc/4.2.1 (python/3.9.7)","i":"97f792-8148-fc4a-9de8-80a56f5ffe9d19/d988d4-2aa8-e144-7b86-6efc61377697c6"}, requested_features=[tcp_nodelay, xattr, xerror, select_bucket, json, duplex, alt_request_support, tracing, sync_replication, vattr, collections, subdoc_create_as_deleted, preserve_ttl, subdoc_replica_read, unordered_execution, clustermap_change_notification, deduplicate_not_my_vbucket_clustermap, snappy, mutation_seqno]
DEBUG::2024-06-30 08:51:34::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/d988d4-2aa8-e144-7b86-6efc61377697c6/tls/-] <couchbase-named-address.com/1.2.3.4:11207> supported_features=[tcp_nodelay, mutation_seqno, xattr, xerror, select_bucket, snappy, json, duplex, clustermap_change_notification, unordered_execution, tracing, alt_request_support, sync_replication, collections, preserve_ttl, vattr, subdoc_create_as_deleted]
DEBUG::2024-06-30 08:51:34::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/d988d4-2aa8-e144-7b86-6efc61377697c6/tls/-] <couchbase-named-address.com/1.2.3.4:11207> detected network is "default"
DEBUG::2024-06-30 08:51:34::PYCBC: create conn callback completed
ERROR::2024-06-30 08:51:35::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/e9f6c6-4eee-9648-605a-8c7ded04a23e01] error on resolve "couchbase-named-0086.couchbase-named.couchbase-named.svc:18093": No such host is known.
ERROR::2024-06-30 08:51:35::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/62a41a-2ca7-7045-ec6c-58221bdfc6caad] error on resolve "couchbase-named-0086.couchbase-named.couchbase-named.svc:18094": No such host is known.
ERROR::2024-06-30 08:51:35::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/58c8ac-c98f-d941-8c31-cef4aa984b6b0e] error on resolve "couchbase-named-0086.couchbase-named.couchbase-named.svc:18092": No such host is known.
ERROR::2024-06-30 08:51:35::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/7d2fa9-affe-d14e-a584-5c418e054fc674] error on resolve "couchbase-named-0086.couchbase-named.couchbase-named.svc:18091": No such host is known.
ERROR::2024-06-30 08:51:35::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/e307f8-627e-1943-2dce-d0625ef0fc625e] error on resolve "couchbase-named-0087.couchbase-named.couchbase-named.svc:18093": No such host is known.
ERROR::2024-06-30 08:51:35::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/09dfe2-19ad-5f4e-4117-45a0b62a9e9675] error on resolve "couchbase-named-0087.couchbase-named.couchbase-named.svc:18094": No such host is known.
ERROR::2024-06-30 08:51:35::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/eefa0d-b6f9-ca40-f820-97041ae877ac4b] error on resolve "couchbase-named-0087.couchbase-named.couchbase-named.svc:18092": No such host is known.
ERROR::2024-06-30 08:51:35::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/53b486-b052-b74a-8c75-daf380d62b714f] error on resolve "couchbase-named-0087.couchbase-named.couchbase-named.svc:18091": No such host is known.
DEBUG::2024-06-30 08:52:49::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/dcf5ef-c597-9644-9ac9-f4ad41ac714807/tls/nontrips] <couchbase-named-0086.couchbase-named.couchbase-named.svc:11207> attempt to establish MCBP connection
ERROR::2024-06-30 08:52:50::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/dcf5ef-c597-9644-9ac9-f4ad41ac714807/tls/nontrips] <couchbase-named-0086.couchbase-named.couchbase-named.svc:11207> error on resolve: 11001 (No such host is known.)
DEBUG::2024-06-30 08:52:50::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/dcf5ef-c597-9644-9ac9-f4ad41ac714807/tls/nontrips] <couchbase-named-0087.couchbase-named.couchbase-named.svc:11207> attempt to establish MCBP connection
ERROR::2024-06-30 08:52:51::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/dcf5ef-c597-9644-9ac9-f4ad41ac714807/tls/nontrips] <couchbase-named-0087.couchbase-named.couchbase-named.svc:11207> error on resolve: 11001 (No such host is known.)
DEBUG::2024-06-30 08:52:51::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/dcf5ef-c597-9644-9ac9-f4ad41ac714807/tls/nontrips] <couchbase-named-0087.couchbase-named.couchbase-named.svc:11207> reached the end of list of bootstrap nodes, waiting for 500ms before restart
DEBUG::2024-06-30 08:52:51::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/dcf5ef-c597-9644-9ac9-f4ad41ac714807/tls/nontrips] <couchbase-named-0086.couchbase-named.couchbase-named.svc:11207> attempt to establish MCBP connection
ERROR::2024-06-30 08:52:51::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/dcf5ef-c597-9644-9ac9-f4ad41ac714807/tls/nontrips] <couchbase-named-0086.couchbase-named.couchbase-named.svc:11207> error on resolve: 11001 (No such host is known.)
.........
DEBUG::2024-06-30 08:52:53::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/dcf5ef-c597-9644-9ac9-f4ad41ac714807/tls/nontrips] <couchbase-named-0087.couchbase-named.couchbase-named.svc:11207> attempt to establish MCBP connection
ERROR::2024-06-30 08:52:53::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/dcf5ef-c597-9644-9ac9-f4ad41ac714807/tls/nontrips] <couchbase-named-0087.couchbase-named.couchbase-named.svc:11207> error on resolve: 11001 (No such host is known.)
DEBUG::2024-06-30 08:52:53::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/dcf5ef-c597-9644-9ac9-f4ad41ac714807/tls/nontrips] <couchbase-named-0087.couchbase-named.couchbase-named.svc:11207> reached the end of list of bootstrap nodes, waiting for 500ms before restart
WARNING::2024-06-30 08:52:53::Operations over threshold: {"count":2,"service":"query","top":[{"last_local_id":"e9f6c6-4eee-9648-605a-8c7ded04a23e01","last_local_socket":"","last_operation_id":"c74302-f53b-1b42-26e2-41515892a34b56","last_remote_socket":"","operation_name":"cb.query","total_duration_us":75007662},{"last_local_id":"e307f8-627e-1943-2dce-d0625ef0fc625e","last_local_socket":"","last_operation_id":"5111de-7f30-db4a-2b53-5d5b35130c5503","last_remote_socket":"","operation_name":"cb.query","total_duration_us":75007544}]}
WARNING::2024-06-30 08:52:53::Operations over threshold: {"count":2,"service":"search","top":[{"last_local_id":"62a41a-2ca7-7045-ec6c-58221bdfc6caad","last_local_socket":"","last_operation_id":"57f40c-8710-9c41-eb38-b84b91f3fc8c07","last_remote_socket":"","operation_name":"cb.search","total_duration_us":75007630},{"last_local_id":"09dfe2-19ad-5f4e-4117-45a0b62a9e9675","last_local_socket":"","last_operation_id":"eb6248-0b1b-bf42-0621-5ed63f25fc9fdf","last_remote_socket":"","operation_name":"cb.search","total_duration_us":75007503}]}
WARNING::2024-06-30 08:52:53::Operations over threshold: {"count":2,"service":"views","top":[{"last_local_id":"58c8ac-c98f-d941-8c31-cef4aa984b6b0e","last_local_socket":"","last_operation_id":"17d8c1-cbf6-1a40-41bb-1d51dd4ea968f8","last_remote_socket":"","operation_name":"cb.views","total_duration_us":75007599},{"last_local_id":"eefa0d-b6f9-ca40-f820-97041ae877ac4b","last_local_socket":"","last_operation_id":"6127c5-6b7d-204c-4019-b78c7b42a2f741","last_remote_socket":"","operation_name":"cb.views","total_duration_us":75007433}]}
WARNING::2024-06-30 08:52:53::Operations over threshold: {"count":2,"service":"mgmt","top":[{"last_local_id":"7d2fa9-affe-d14e-a584-5c418e054fc674","last_local_socket":"","last_operation_id":"5ecede-170e-aa47-6e89-a0a4f62e768a03","last_remote_socket":"","operation_name":"cb.manager","total_duration_us":75007571},{"last_local_id":"53b486-b052-b74a-8c75-daf380d62b714f","last_local_socket":"","last_operation_id":"42d96c-c635-9548-075a-3b29c53a7be839","last_remote_socket":"","operation_name":"cb.manager","total_duration_us":75007390}]}
DEBUG::2024-06-30 08:52:54::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/dcf5ef-c597-9644-9ac9-f4ad41ac714807/tls/nontrips] <couchbase-named-0086.couchbase-named.couchbase-named.svc:11207> attempt to establish MCBP connection
ERROR::2024-06-30 08:52:54::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/dcf5ef-c597-9644-9ac9-f4ad41ac714807/tls/nontrips] <couchbase-named-0086.couchbase-named.couchbase-named.svc:11207> error on resolve: 11001 (No such host is known.)
DEBUG::2024-06-30 08:52:54::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/dcf5ef-c597-9644-9ac9-f4ad41ac714807/tls/nontrips] <couchbase-named-0087.couchbase-named.couchbase-named.svc:11207> attempt to establish MCBP connection
ERROR::2024-06-30 08:52:54::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/dcf5ef-c597-9644-9ac9-f4ad41ac714807/tls/nontrips] <couchbase-named-0087.couchbase-named.couchbase-named.svc:11207> error on resolve: 11001 (No such host is known.)
..........
DEBUG::2024-06-30 08:52:58::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/dcf5ef-c597-9644-9ac9-f4ad41ac714807/tls/nontrips] <couchbase-named-0087.couchbase-named.couchbase-named.svc:11207> attempt to establish MCBP connection
ERROR::2024-06-30 08:52:59::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/dcf5ef-c597-9644-9ac9-f4ad41ac714807/tls/nontrips] <couchbase-named-0087.couchbase-named.couchbase-named.svc:11207> error on resolve: 11001 (No such host is known.)
DEBUG::2024-06-30 08:52:59::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/dcf5ef-c597-9644-9ac9-f4ad41ac714807/tls/nontrips] <couchbase-named-0087.couchbase-named.couchbase-named.svc:11207> reached the end of list of bootstrap nodes, waiting for 500ms before restart
WARNING::2024-06-30 08:52:59::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/dcf5ef-c597-9644-9ac9-f4ad41ac714807/tls/nontrips] <couchbase-named-0087.couchbase-named.couchbase-named.svc:11207> unable to bootstrap in time
WARNING::2024-06-30 08:52:59::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/dcf5ef-c597-9644-9ac9-f4ad41ac714807/tls/nontrips] <couchbase-named-0087.couchbase-named.couchbase-named.svc:11207> failed to bootstrap session ec=unambiguous_timeout (14), bucket="nontrips"
DEBUG::2024-06-30 08:52:59::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/dcf5ef-c597-9644-9ac9-f4ad41ac714807/tls/nontrips] <couchbase-named-0087.couchbase-named.couchbase-named.svc:11207> stop MCBP connection, reason=do_not_retry
DEBUG::2024-06-30 08:52:59::PYCBC: open/close bucket callback completed
DEBUG::2024-06-30 08:52:59::[97f792-8148-fc4a-9de8-80a56f5ffe9d19/dcf5ef-c597-9644-9ac9-f4ad41ac714807/tls/nontrips] <couchbase-named-0087.couchbase-named.couchbase-named.svc:11207> destroy MCBP connection

Hi @aminrd – There seems to be a lot going on here. For better or worse the Python SDK is very different than the .NET SDK w.r.t. how it handles the I/O layer. Granted, we need to do better w/ documentation (and we will get there) so that users have more details on the various options available. That said, can you give details on what type of connection you are aiming for?

  1. Use DNS lookup – yes or no?
  2. Use an encrypted connection – yes or no?
  3. Skip TLS verification – yes or no?
  4. Use alternate network – yes or no?

If #1 is no: ClusterOptions(enable_dns_srv=False)
If #2 is yes: The connection string scheme should be: couchbases (as previously mentioned, note the ending s)
If #3 is yes: ClusterOptions(tls_verify=TLSVerifyMode.NO_VERIFY) (can also add tls_verify=none as a query param in the connection string)
If #4 is yes: ClusterOptions(network='external') (can also add network=external as a query param in the connection string).

So, an example w/ #1 = no, #2 = yes, #3 = yes, #4 = yes:

from couchbase.auth import PasswordAuthenticator
from couchbase.cluster import Cluster
from couchbase.options import (ClusterOptions,
                               TLSVerifyMode)

auth = PasswordAuthenticator('Administrator', 'password')
opts = ClusterOptions(auth,
                      enable_dns_srv=False,
                      tls_verify=TLSVerifyMode.NO_VERIFY,
                      network='external')
cluster = Cluster.connect('couchbases://localhost', opts)
2 Likes

Thanks a lot @jcasey finally Python SDK was connected successfully! I guess the problem was I couldn’t find alternate network option in the Python SDK to use external network and now, I was able to get connected with TLS enabled and using the alternate network (external)

        options = ClusterOptions(auth,
                                 timeout_options=timeout_opts,
                                 disable_mozilla_ca_certificates=True,
                                 enable_tls=enable_tls,
                                 enable_dns_srv=False,
                                 network='external',
                                 tls_verify=TLSVerifyMode.NO_VERIFY)