question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

gRPC connection to Secure Cluster fails

See original GitHub issue

Hi,

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:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
George-Paynecommented, Dec 23, 2021

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/254

0reactions
George-Paynecommented, Dec 24, 2021

I’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

Read more comments on GitHub >

github_iconTop Results From Across the Web

GRPC does not work sometimes when cross cluster. (mtls
Forth step: I create serviceentry as below (internal elb), cross cluster access. Test grpc cross cluster, 4 out of 10 pass, 6 out...
Read more >
Having trouble reaching gRPC service running securely ...
I am having an issue connecting to a gRPC app running in kubernetes from outside the node/cluster. From within the cluster, connections work ......
Read more >
gRPC SSL connection to Etcdv3 cluster problem
I'm having a problem connecting to a etcd v3 database with gRPC using SSL in C++. I create the grpc::Channel like this:.
Read more >
gRPC Ingress Gateway with SIMPLE TLS : Remote Reset Error
We have been trying to Secure Gateways with SIMPLE TLS for our gRPC Backend which is deployed in Minikube (minikube version: v1.25.2) for ......
Read more >
Using gRPC | Cloud Run Documentation
This page shows Cloud Run-specific details for developers who want to use gRPC to connect a Cloud Run service with other services, for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found