Hi,
We are testing out the EventStore Cloud preview and are having some issues establishing a connection from our Node.js client to the cluster.
We have the VPC and peering configuration working.
We are using the Node.js official client (https://github.com/EventStore/EventStore-Client-NodeJS).
Could you provide an example on how to connect to the Cloud version?
We have tried using the singleNodeConnection as well as the gossipClusterConnection, both with secure and insecure modes.
E.g.:
const endpoint: EndPoint = new EndPoint();
endpoint.setAddress(EVENT_STORE_HOST);
endpoint.setPort(parseInt(EVENT_STORE_PORT, 10));
const connection = await EventStoreConnection.builder()
.gossipClusterConnection([
endpoint.toObject(),
]);
const events = await readEventsFromStream(streamName)
.fromStart()
.forward()
.count(10)
.execute(connection)
With the gossip method we get the following error message:
TypeError: Cannot read property 'getMembersList' of undefined
at Object.callback (/app/node_modules/@eventstore/db-client/dist/connection/discovery.js:111)
at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/src/client.ts:334)
at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/src/client-interceptors.ts:434)
at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/src/client-interceptors.ts:397)
at (/app/node_modules/@grpc/grpc-js/src/call-stream.ts:237)
at processTicksAndRejections (internal/process/task_queues.js:79)
const connection = await EventStoreConnection.builder()
.singleNodeConnection(`${EVENT_STORE_HOST}:${EVENT_STORE_PORT}`);
And with singleNodeConnection (I know we should be using gossip for the cluster but still) we get the following:
eventstore-poc-5dff4f7bd5-g4cwt eventstore-poc UnavailableError: 14 UNAVAILABLE:
eventstore-poc-5dff4f7bd5-g4cwt eventstore-poc at Object.exports.convertToCommandError (/app/node_modules/@eventstore/db-client/dist/utils/CommandError.js:276:20)
eventstore-poc-5dff4f7bd5-g4cwt eventstore-poc at ClientReadableStreamImpl.<anonymous> (/app/node_modules/@eventstore/db-client/dist/utils/handleBatchRead.js:27:38)
eventstore-poc-5dff4f7bd5-g4cwt eventstore-poc at ClientReadableStreamImpl.emit (events.js:314:20)
eventstore-poc-5dff4f7bd5-g4cwt eventstore-poc at ClientReadableStreamImpl.EventEmitter.emit (domain.js:483:12)
eventstore-poc-5dff4f7bd5-g4cwt eventstore-poc at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/src/client.ts:570:18)
eventstore-poc-5dff4f7bd5-g4cwt eventstore-poc at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/src/client-interceptors.ts:397:48)
eventstore-poc-5dff4f7bd5-g4cwt eventstore-poc at /app/node_modules/@grpc/grpc-js/src/call-stream.ts:237:24
eventstore-poc-5dff4f7bd5-g4cwt eventstore-poc at processTicksAndRejections (internal/process/task_queues.js:79:11) {
eventstore-poc-5dff4f7bd5-g4cwt eventstore-poc code: 14,
eventstore-poc-5dff4f7bd5-g4cwt eventstore-poc _raw: Error: 14 UNAVAILABLE:
eventstore-poc-5dff4f7bd5-g4cwt eventstore-poc at Object.callErrorFromStatus (/app/node_modules/@grpc/grpc-js/src/call.ts:81:24)
eventstore-poc-5dff4f7bd5-g4cwt eventstore-poc at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/src/client.ts:570:32)
eventstore-poc-5dff4f7bd5-g4cwt eventstore-poc at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/src/client-interceptors.ts:397:48)
eventstore-poc-5dff4f7bd5-g4cwt eventstore-poc at /app/node_modules/@grpc/grpc-js/src/call-stream.ts:237:24
eventstore-poc-5dff4f7bd5-g4cwt eventstore-poc at processTicksAndRejections (internal/process/task_queues.js:79:11) {
eventstore-poc-5dff4f7bd5-g4cwt eventstore-poc code: 14,
eventstore-poc-5dff4f7bd5-g4cwt eventstore-poc details: '',
eventstore-poc-5dff4f7bd5-g4cwt eventstore-poc metadata: Metadata { internalRepr: [Map], options: {} }
eventstore-poc-5dff4f7bd5-g4cwt eventstore-poc },
eventstore-poc-5dff4f7bd5-g4cwt eventstore-poc type: 'unavailable'
eventstore-poc-5dff4f7bd5-g4cwt eventstore-poc }
Any suggestions would be greatly appreciated.