Timeout Exception while creating an index


I’m using Python SDK 3.0.3 version.
I’m trying to create an index using the following code but I’m getting a timeout exception.
Note that the index is eventually get created but I get no indication. I got to know the index has been created by locating it at the UI.

from couchbase.cluster import Cluster, ClusterOptions, QueryOptions
from couchbase.cluster import PasswordAuthenticator
from couchbase.cluster import QueryIndexManager
from datetime import timedelta

cluster = Cluster(‘couchbase://xxx107.xxx.com:8091’, ClusterOptions(PasswordAuthenticator(‘Administrator’, ‘Administrator’)))
cb = cluster.bucket(‘com.xxx.individual’)
qm = QueryIndexManager(cluster)
cluster.query_indexes().create_index(‘com.xxx.individual’, ‘party_mig_ix’, [‘documentId’], timeout=timedelta(seconds=900))

What is wrong?

Not sure yet - the initial REST call will have been sent immediately after create_index is called,. Calls to the management API are, generally, asynchronous, so the call should return immediately and the behaviour you observe (minus the TimeoutException) would be expected. Perhaps there is some polling code underneath which is waiting for the index to come up - but one would still expect the index to be up in 900 seconds, normally. Will investigate, thanks.

https://issues.couchbase.com/browse/PYCBC-1021 - tracking JIRA

Please note that I get the TimeoutException after one or two minutes which far less than 900 seconds.