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,>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> read: connection reset by peer”

What should I do?


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.