invana / invana-studio

Open source graph visualiser.
Apache License 2.0
174 stars 19 forks source link

Graph Explorer Unable to Connect #75

Closed Donny3000 closed 3 years ago

Donny3000 commented 3 years ago

Following the instruction on the Graph Explorer GitHub page, I'm presented with this error when trying to connect to my TinkerPop Graph DB

image

I know I can connect to my JanusGraph/TinkerPop Gremlin Server running at http://localhost:8182 as I can remotely connect to it through the gremlin console and perform queries.

Is there a step I might have missed or is there a configuration issue between the latest graph-explorer and invana-engine?

rrmerugu commented 3 years ago

Hey @Donny3000 , please check here https://github.com/invanalabs/graph-explorer/issues/73 for new instructions. The project is in the middle of design transition phase. Apologies for the poor documentation. Will fix it soon.

Donny3000 commented 3 years ago

Thanks, @rrmerugu for your prompt reply and incredible work on this great project! I took look at #73 and it all made sense to me. But, I seem to be getting the same error message/pop-up. To be clear these are the steps I'm performing:

  1. docker run -p 8000:8000 -d -e GREMLIN_SERVER_URL=ws://localhost:8182/gremlin --name invana-engine invanalabs/invana-engine
  2. docker run -p 8888:8888 -d --name graph-explorer invanalabs/graph-explorer
  3. Then, point my browser to http://localhost:8888

Is this the correct sequence/steps to perform?

rrmerugu commented 3 years ago

I see, in this case, the first thing you shall debug is whether Invana Engine GraphQL is configured correctly or not. Do a simple query by going to http://localhost:8000/graphql. If that is failing with error, there is some issue with the invana-engine deployment. All the above steps assume you are running a JanusGraph instance using docker run -it -p 8182:8182 janusgraph/janusgraph or other methods, and JanusGraph server is available at 8182 port

Screenshot 2020-12-04 at 10 31 49 AM
Donny3000 commented 3 years ago

Thanks again for the assistance. I'm am indeed running a JanusGraph instance with the docker command you showed. I can confirm that the JanusGraph instance is up and running correctly because I can start a gremlin console client to remotely connect to the server and issue the "g.V().limit(2).toList()" command and get results back. However, if I issue the command in your screenshot using the GraphQL interface, this is the error I get

image

Do you have any additional insight as to why this would be happening? Thanks again for your assistance!

rrmerugu commented 3 years ago

Looks like this is a docker issue, can you check the logs of the janusgraph and invana-engine container using docker logs <container ID>. That might lead you to some hints.

Donny3000 commented 3 years ago

Thanks, @rrmerugu for the docker logs advice! It seems invana_engine us running into connection issues when I issue the g.V().limit(5).toList() GraphQL query. It's still not clear as to why this "connection refused" error is happening since I can indeed connect to my JanusGraph server instance remotely through the gremlin client console.

image

Donny3000 commented 3 years ago

So, I was able to get it working by using the following docker run command to start the invana-engine

docker run -p 8000:8000 -d -h invana_engine -e GREMLIN_SERVER_URL=ws://172.17.0.2:8182/gremlin --name invana-engine invanalabs/invana-engine

where the IP address of 172.17.0.2 is the IP address assigned by the docker network to the JanusGraph server. Now, although I do have it working, this seems very suboptimal.

What is the correct way to solve this problem without having to resort to using the container's internal docker IP address for the GREMLIN_SERVER_URL?

rrmerugu commented 3 years ago

Glad it's working. I generally do something like this docker run --rm -d --network host --name my_nginx nginx , where I map the ports of the docker to host network directly. So I dont have to access the docker container over the docker network IP(172.17.0.2:8182), instead I can connect to localhost:8182 directly.

Hope this helps, https://docs.docker.com/network/network-tutorial-host/

Donny3000 commented 3 years ago

Thanks, @rrmerugu! I'll read through that documentation to see if that will help me.