Unable to connect to containerized EventStoreDB from go client with ports other than 2113

Below is the ESDB running on docker mapped to port 33003:

607bca5de353 eventstore/eventstore:24.2 “/opt/eventstore/eve…” 18 minutes ago Up 18 minutes (healthy) 1112-1113/tcp, 0.0.0.0:33003->2113/tcp, :::33003->2113/tcp youthful_cohen

However, creating the client throws below error with connection string “esdb://localhost:33003?tls=false” :

failed to get server version: [ErrorUnavailable] the server is not ready to accept requests: maximum discovery attempt count reached: 10. Last Error: rpc error: code = Unavailable desc = connection error: desc = “error reading server preface: read tcp 127.0.0.1:44288->127.0.0.1:33003: read: connection reset by peer”

What should I do?

Hi,

I’m guessing you are using test containers to run your tests? If so, make sure to configure the nodes to advertise to the client in your server config (see Advertise to clients).

Let me know how it goes. :slightly_smiling_face:

Hi, William.

Yes, I am using test containers. Thanks, I will try it.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.