Node: Failed to Discover after 10 attempts

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:

import { stringify } from 'querystring';
import { EventStoreDBClient } from '@eventstore/db-client';

      const options = {
        keepAliveInterval: 1000 * 60,
        keepAliveTimeout: 1000 * 60 * 10,
        tls: false
      };
      const params = stringify(options);
      this.client = EventStoreDBClient.connectionString`${connectionString}?${params}`;

There’s no documentation around this error, so we don’t even know where to begin to debug.

1 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