# PyDgraph client failed to connect to the cloud via endpoint

**URL:** <https://discuss.dgraph.io/t/pydgraph-client-failed-to-connect-to-the-cloud-via-endpoint/17317>\
**Category:** Dgraph Clients\
**Tags:** pydgraph\
**Created:** [May 18, 2022, 8:40pm UTC](https://discuss.dgraph.io/t/pydgraph-client-failed-to-connect-to-the-cloud-via-endpoint/17317 "2022-05-18T20:40:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ann\_Zhang](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/ann_zhang/32/10634_2.png) [@Ann\_Zhang](https://discuss.dgraph.io/u/Ann_Zhang)\
**Post date:** [May 18, 2022, 8:40pm UTC](https://discuss.dgraph.io/t/pydgraph-client-failed-to-connect-to-the-cloud-via-endpoint/17317/1 "2022-05-18T20:40:53Z")

</div>

* * *

## Report a Dgraph Client Bug

### What Dgraph client (and version) are you using?

(put “x” in the box to select)

- Dgo
- PyDgraph
- Dgraph4J
- Dgraph-js
- Dgraph-js-http
- [Dgraph.NET](http://Dgraph.NET)

Version: 21.3.2

### What version of Dgraph are you using?

v21.03.0

### Have you tried reproducing the issue with the latest release?

### What is the hardware spec (RAM, OS)?

### Steps to reproduce the issue (command/config used to run Dgraph).

Use the guidance provided by the document, try to alter database, but failed with error.  
code:  
client\_stub = pydgraph.DgraphClientStub.from\_cloud(“cloud endpoint url”, “\<api\_key\>”)  
client = pydgraph.DgraphClient(client\_stub)  
schema = ‘name: string @index(exact) .’  
op = pydgraph.Operation(schema=schema)  
client.alter(op)

### Expected behaviour and actual result.

error:  
E0518 16:39:14.209293000 4668954112 ssl\_transport\_security.cc:1495] Handshake failed with fatal error SSL\_ERROR\_SSL: error:1000007d:SSL  
grpc.\_channel.\_InactiveRpcError: \<\_InactiveRpcError of RPC that terminated with:  
status = StatusCode.UNAVAILABLE  
details = “failed to connect to all addresses”  
debug\_error\_string = “{“created”:”@1652906354.434495000",“description”:“Failed to pick subchannel”,“file”:“src/core/ext/filters/client\_channel/client\_channel.cc”,“file\_line”:3218,“referenced\_errors”:[{“created”:“@1652906354.434495000”,“description”:“failed to connect to all addresses”,“file”:“src/core/lib/transport/error\_utils.cc”,“file\_line”:165,“grpc\_status”:14}]}"

* * *

## Experience Report for Feature Request

Note: Feature requests are judged based on user experience and modeled on [Go Experience Reports](https://github.com/golang/go/wiki/ExperienceReports). These reports should focus on the problems: they should not focus on and need not propose solutions.

### What you wanted to do

### What you actually did

### Why that wasn’t great, with examples

### Any external references to support your case

---

<div class="post-metadata">

**Author:** ![Ann\_Zhang](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/ann_zhang/32/10634_2.png) [@Ann\_Zhang](https://discuss.dgraph.io/u/Ann_Zhang)\
**Post date:** [May 18, 2022, 9:04pm UTC](https://discuss.dgraph.io/t/pydgraph-client-failed-to-connect-to-the-cloud-via-endpoint/17317/2 "2022-05-18T21:04:09Z")

</div>

Tried with Rust client as well, not working, similar issue relating to gRPC.

> [@Cant connect to gRPC endpoint using dgraph-tonic client](http://discuss.hypermode.com/t/cant-connect-to-grpc-endpoint-using-dgraph-tonic-client/17308):
>
> using dgraph-tonic client having trouble connecting to Dgraph cloud. `thread ‘main’ panicked at 'committed: Dgraph: gRPC communication Error. Caused by: Client: cannot commit or abort. Status { code: Unknown, message: “hash mismatch the claimed startTs|namespace”, metadata: MetadataMap { headers: {“date”: “Tue, 17 May 2022 16:48:10 GMT”, “content-type”: “application/grpc”, “content-length”: “0”, “access-control-allow-credentials”: “true”, “access-control-allow-methods”: “GET,POST,OPTIONS”, “…
