Connect Error

Moved from GitHub pydgraph/15

Posted by zanghyu:

When I attempt to connect to dgraph, I follow the example write like this:

from pydgraph.client import DgraphClient

dg_client = DgraphClient('localhost',8080)

response = dg_client.query("""
         mutation
        {
             set
             {
                 <alice> <name> \"Alice\" .
                 <greg> <name> \"Greg\" .
                 <alice> <follows> <greg> .
             }
         }""")

there comes an error like this:
I1026 16:20:47.341823000 140735514100544 subchannel.c:642] Connect failed: {"created":"@1509006047.341751000","description":"Failed to connect to remote host","errno":35,"file":"src/core/lib/iomgr/error.c","file_line":246,"os_error":"Connection refused","target_address":"ipv6:[::1]:8080"} I1026 16:20:47.341858000 140735514100544 subchannel.c:647] Retry in 0.898440040 seconds E1026 16:20:47.342815000 140735514100544 chttp2_transport.c:1810] close_transport: {"created":"@1509006047.342749000","description":"Failed parsing HTTP/2","file":"src/core/ext/transport/chttp2/transport/chttp2_transport.c","file_line":1726,"referenced_errors":[{"created":"@1509006047.342727000","description":"Expected SETTINGS frame as the first frame, got frame type 80","file":"src/core/ext/transport/chttp2/transport/parsing.c","file_line":477}]} Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/anaconda2/lib/python2.7/site-packages/pydgraph/client.py", line 38, in query response = self.stub.Query(request, timeout) File "/anaconda2/lib/python2.7/site-packages/grpc/beta/_client_adaptations.py", line 300, in __call__ self._request_serializer, self._response_deserializer) File "/anaconda2/lib/python2.7/site-packages/grpc/beta/_client_adaptations.py", line 198, in _blocking_unary_unary raise _abortion_error(rpc_error_call) grpc.framework.interfaces.face.face.AbortionError: AbortionError(code=StatusCode.UNAVAILABLE, details="")

In browser, my dgraph can run correctly, but it goes something wrong when I want to use python connect it.

Can anybody help me?

manishrjain commented :

This client hasn’t been maintained for a while. So, no ideas what state it is in at the moment. We have plans to maintain the Python client, though no ETA yet. Community contributions are welcome!

gpahal commented :

The client has been updated for Dgraph v1.0.0 and the connection should now work properly.