We’ve recently setup an EventStore Cloud cluster, single node. Using the connection string provided by the cluster page UX, we’re attempting a connection and receiving:
Error: Failed to discover after 10 attempts.
at discoverEndpoint (/Users/code/test/node_modules/@eventstore/db-client/dist/Client/discovery.js:45:11)
at Client.resolveUri (/Users/code/test/node_modules/@eventstore/db-client/dist/Client/index.js:178:43)
at Client.createChannel (/Users/code/test/node_modules/@eventstore/db-client/dist/Client/index.js:151:25)
at Client.createGRPCClient (/Users/code/test/node_modules/@eventstore/db-client/dist/Client/index.js:112:37)
at /Users/code/test/node_modules/@eventstore/db-client/dist/Client/index.js:57:28
at Subscription2.initialize (/Users/code/test/node_modules/@eventstore/db-client/dist/streams/utils/Subscription.js:27:18)
Here’s what our code doing the connecting looks like:
The error can be translated to a simple “I can’t connect to the node”.
I am not sure where your application runs, but if you run it locally, your machine needs to be connected to your cloud VPC that is peered with ES Cloud via some sort of point to site connection (VPN). https://developers.eventstore.com/cloud/use/#networking
I have update my connection string based on the client documentation (Getting started | EventStoreDB Documentation) instead of the one in the server guide for the cluster install:
nestjs-app-1 | esdb+discover://admin:[email protected]:2113,node2.eventstore:2113,node3.eventstore:2113?tls=true&tlsVerifyCert=false
nestjs-app-1 | Error: Failed to discover after 10 attempts.
nestjs-app-1 | at discoverEndpoint (/app/node_modules/@eventstore/db-client/dist/Client/discovery.js:45:11)
nestjs-app-1 | at async Client.resolveUri (/app/node_modules/@eventstore/db-client/dist/Client/index.js:270:43)
nestjs-app-1 | at async Client.createChannel (/app/node_modules/@eventstore/db-client/dist/Client/index.js:244:25)
nestjs-app-1 | at async Client.createGRPCClient (/app/node_modules/@eventstore/db-client/dist/Client/index.js:200:37)
nestjs-app-1 | at async /app/node_modules/@eventstore/db-client/dist/Client/index.js:145:28
nestjs-app-1 | at async ReadStream.initialize (/app/node_modules/@eventstore/db-client/dist/streams/utils/ReadStream.js:25:18)
I can curl the nodes in the nest js docker container with out issue, I can also make requests from outside the container on localhost ports 2111-2113. The only thing I can’t seem to achieve is connecting via gRPC client. Any help would be greatly appreciated.