Timeout Expection on running couchbase scripts

Hi ,

I’m running nickel scripts in parts to get the final results using Python SDK. Just to balance the load query is split across multiple parts (i.e results from part 1 will serve as input to part 2 and so on)since data is fetched from multiple buckets . Most of the time i get the couchbase time Expection and upsert operation is failing . I have set the query timeout & kV timeout to 9000 secs . Unfortunately the all parts on execution gets completed within 5 mins.

There are multiple such reports , only few are facing such issue .

The python script is running on kubernetes on daily basis (Cron job). Can anyone help me in resolving this issue ?

ERROR : self.bucket.upsert(ref_docname, id_dict)
couchbase.exceptions.TimeoutException: <Key=‘REFERENCE-PART-4’, RC=0xC9[LCB_ERR_TIMEOUT (201)], Operational Error, Results=1, C Source=(src/multiresult.c,316), Context={‘status_code’: 4, ‘opaque’: 7, ‘cas’: 0, ‘key’: ‘REFERENCE-PART-4’: ‘sample_bucket’, ‘collection’: ‘’, ‘scope’: ‘’, ‘context’: ‘’, ‘ref’: ‘’, ‘endpoint’: ‘IPV6:port’, ‘type’: ‘KVErrorContext’}, Tracing Output={“REFERENCE-PART-4”: {“s”: “kv:Unknown”, “i”: 111020012475772, “b”:…

Note : I have checked couchbase logs , no Error was recorded.

@Ashish_M_J which version of the Python SDK are you using ?
Do you have the right indexes when you are “getting data” ?
Or the other way do you have indexes on fields that are frequently updated ? (can hinder performance).
Did you execute your query using the Couchbase Console ? How much time does it take ?
Timeout can depend on several environmental factors, is your app code in the same network as Couchbase?

1 Like

Thanks for the help . After including the retry logic, upsert works fine.

1 Like

Hi @Ashish_M_J - Glad you were able to get things working.

For others to have a reference, we provide an example of retry logic in the online docs.