Suddenly Error: "dial tcp connect: cannot assign requested address" is coming


I am running my application API in Golang with Couchbase Community Edition 6.0.0 build 1693 with GoCb v2.0.3

My application was running fine for almost a year but today suddenly the queries started failing with following Error in log of API server:

dial tcp connect: cannot assign requested address

The error was coming continuously in every api call. This got fixed by restarting the api server.

I want to understand what was the root cause. Please help how should I investigate the issue further.


Hello @Devesh_Mittal welcome to the forums
I am not a go expert but the error upon some researching looks like more towards using ‘concurrent goroutine’ trying to open connection probably ? but I still cannot understand why that would happen after 1 year in production ! Did you update any component. ?

@chvck any thoughts ?

Hi @Devesh_Mittal this is an error that I’ve not encountered before. From some googling it looks like there’s quite a range of issues that could trigger it. Do you have SDK logs from that time period? That would help to indicate what sort of state that the SDK was in.

The issue happened only once and was resolved by restarting api server. It didn’t occur again.
Will setup couchbase SDK logging according to

And look into it if the issue happens again

1 Like

Issue was because some connection leakage was happening.

It got solved after updating couchbase sdk and server to latest version

Thanks for updating us @Devesh_Mittal