gRPC connection to Secure Cluster fails
See original GitHub issueHi,
We are having trouble connecting to a secure cluster using this client.
I have followed this guide exactly - https://developers.eventstore.com/server/v20.10/installation/docker.html#secure-cluster - and I now have a working secure cluster running in docker compose.
When I try connect to the cluster to upload a projection using this connection string (using the default username and password)
export let eventStoreClient = EventStoreDBClient.connectionString`esdb://${user}:${password}@localhost:2113?tls=true&tlsVerifyCert=false`;
I get the following error
esdb:connection Createing client for updateProjection +1ms
esdb:connection Connecting to http://localhost:2113 +1ms
esdb:connection Got reconnection error 14 UNAVAILABLE: No connection established +1ms
esdb:connection Reconnection required +0ms
Error Uploading Projection: projection-continuous-emit-listings UnavailableError: 14 UNAVAILABLE: No connection established
at Object.convertToCommandError (/home/rowanp/work/platform/common/temp/node_modules/.pnpm/@eventstore+db-client@2.1.1/node_modules/@eventstore/db-client/dist/utils/CommandError.js:280:20)
at Object.callback (/home/rowanp/work/platform/common/temp/node_modules/.pnpm/@eventstore+db-client@2.1.1/node_modules/@eventstore/db-client/dist/projections/updateProjection.js:29:39)
at Object.onReceiveStatus (/home/rowanp/work/platform/common/temp/node_modules/.pnpm/@grpc+grpc-js@1.4.5/node_modules/@grpc/grpc-js/build/src/client.js:180:36)
at Object.onReceiveStatus (/home/rowanp/work/platform/common/temp/node_modules/.pnpm/@grpc+grpc-js@1.4.5/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:365:141)
at Object.onReceiveStatus (/home/rowanp/work/platform/common/temp/node_modules/.pnpm/@grpc+grpc-js@1.4.5/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:328:181)
at /home/rowanp/work/platform/common/temp/node_modules/.pnpm/@grpc+grpc-js@1.4.5/node_modules/@grpc/grpc-js/build/src/call-stream.js:182:78
at processTicksAndRejections (internal/process/task_queues.js:79:11) {
code: 14,
_raw: Error: 14 UNAVAILABLE: No connection established
at Object.callErrorFromStatus (/home/rowanp/work/platform/common/temp/node_modules/.pnpm/@grpc+grpc-js@1.4.5/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
at Object.onReceiveStatus (/home/rowanp/work/platform/common/temp/node_modules/.pnpm/@grpc+grpc-js@1.4.5/node_modules/@grpc/grpc-js/build/src/client.js:180:52)
at Object.onReceiveStatus (/home/rowanp/work/platform/common/temp/node_modules/.pnpm/@grpc+grpc-js@1.4.5/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:365:141)
at Object.onReceiveStatus (/home/rowanp/work/platform/common/temp/node_modules/.pnpm/@grpc+grpc-js@1.4.5/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:328:181)
at /home/rowanp/work/platform/common/temp/node_modules/.pnpm/@grpc+grpc-js@1.4.5/node_modules/@grpc/grpc-js/build/src/call-stream.js:182:78
at processTicksAndRejections (internal/process/task_queues.js:79:11) {
code: 14,
details: 'No connection established',
metadata: Metadata { internalRepr: Map {}, options: {} }
},
type: 'unavailable'
}
And when I use the suggested connection string
export let eventStoreClient = EventStoreDBClient.connectionString`esdb://127.0.0.1:2113,127.0.0.1:2112,127.0.0.1:2111?keepAliveTimeout=10000&keepAliveInterval=10000`;
I get this error
esdb:connection Failed to get cluster list from 127.0.0.1:2113 Error: 14 UNAVAILABLE: No connection established +2ms
esdb:connection Failed to get cluster list from 127.0.0.1:2112 Error: 14 UNAVAILABLE: No connection established +2ms
esdb:connection Failed to get cluster list from 127.0.0.1:2111 Error: 14 UNAVAILABLE: No connection established +2ms
Error Uploading Projection: projection-continuous-emit-listings Error: Failed to discover after 10 attempts.
at Object.discoverEndpoint (/home/rowanp/work/platform/common/temp/node_modules/.pnpm/@eventstore+db-client@2.1.1/node_modules/@eventstore/db-client/dist/Client/discovery.js:48:11)
at async Client.resolveUri (/home/rowanp/work/platform/common/temp/node_modules/.pnpm/@eventstore+db-client@2.1.1/node_modules/@eventstore/db-client/dist/Client/index.js:132:43)
at async Client.createChannel (/home/rowanp/work/platform/common/temp/node_modules/.pnpm/@eventstore+db-client@2.1.1/node_modules/@eventstore/db-client/dist/Client/index.js:109:25)
at async Client.createGRPCClient (/home/rowanp/work/platform/common/temp/node_modules/.pnpm/@eventstore+db-client@2.1.1/node_modules/@eventstore/db-client/dist/Client/index.js:64:37)
at async Client.execute (/home/rowanp/work/platform/common/temp/node_modules/.pnpm/@eventstore+db-client@2.1.1/node_modules/@eventstore/db-client/dist/Client/index.js:54:28)
at async uploadProjection (/home/rowanp/work/platform/eventstore/eventstore-projections/dist/projection.js:61:21)
at async Object.uploadAllProjections (/home/rowanp/work/platform/eventstore/eventstore-projections/dist/projection.js:146:17)
I have tried turning on all Eventstore debug but it does not seem like a connection is even established to eventstore at all. Using a much older Javascript TCP Client I can connect and write to a stream with no issues.
The debug from the gRPC connection shows that it is connecting to http
and not https
, which may just be bad debug, but it definitely won’t work because running eventstore with security enabled means there is no response on the http
endpoint, and there is no HSTS redirect either.
We are not sure if this is a bug in the client or perhaps some missing parameters in the connection string. We also cannot find any documentation describing how to connect to a secure cluster over gRPC.
Our code to upload projections does work with security disabled which is why we suspect the client is at fault here.
Any assistance is greatly appreciated
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
I’ve opened an issue in the documentation repo to address the lack of docs around this: https://github.com/EventStore/documentation/issues/487
And I’ve opened an issue here to improve the
tlsVerifyCert
warning: https://github.com/EventStore/EventStore-Client-NodeJS/issues/254I’ll close this one then, as both actionable points have been superseded by https://github.com/EventStore/documentation/issues/487 & https://github.com/EventStore/EventStore-Client-NodeJS/issues/254