Having a silly-hard time connecting locally. Windows, Docker-standalone, Spring Boot, Java 11

I’m sure it’s me, but I see nothing in the docs that I have found helpful.

I did get the async connection working with a SlashCloud schema … for a day. Then it stopped working.

I’m now looking to run this in test, on localhost. I have pulled the docker-standalone image and have set up a Spring configuration bean, autowired into a test /v1/test/dgraph endpoint.

I can hit my docker instance at localhost:8080/graphql via GraphQL Playground. I do have data out there.

I have tried to invoke the synchronous client thusly:

         @Autowired
    private DgraphConfigurerTest dgraphConfigurerTest;
...
         try {
            response = ResponseEntity.ok("Dgraph version: " + dgraphConfigurerTest.getDgraphClient().checkVersion().getTag());
        } catch (Exception e) {
            logger.error("Dgraph failure: " + e.getCause() + "\n" + e.getMessage());
        }

if I connect on 9080, I see java.util.concurrent.ExecutionException: io.grpc.StatusRuntimeException: UNAVAILABLE: io exception. If I connect on 8080, I see java.util.concurrent.ExecutionException: io.grpc.StatusRuntimeException: INTERNAL: http2 exception

Has anyone successfully connected to Dgraph using Spring Boot??

Wellp, that’s on me.

I strongly-suspect the issue was that I didn’t have all ports exposed. (Ouch)

Same configuration with an external change–FROM THE DOCS–of docker run -it -p 5080:5080 -p 6080:6080 -p 8080:8080 -p 9080:9080 -p 8000:8000 -v ~/dgraph:/dgraph --name dgraph dgraph/standalone:v21.03.0 and I’m away and running.

I also bumped versions from v20.03.0 to v21.03.0.

One actual improvement I can leave for someone coming behind me: change the catch to return a more-complete error: logger.error("Dgraph failure: " + e.getCause().getMessage() + e.getCause().getCause().getMessage());

:expressionless:

2 Likes