bricaud / graphexp

Interactive visualization of the Gremlin graph database with D3.js
Apache License 2.0
780 stars 215 forks source link

Connectivity established but search doesn;t seem to work #96

Closed gautam199 closed 4 years ago

gautam199 commented 4 years ago

Hi,

I'm able to connect to my backend AWS Neptune database instance via REST protocol.

The "Get Graph Info" option works and results are returned correctly.

However, the "Search" feature seems to be broken. For any search query, I get the below exception:

CaptureNeptune

I have tried with Gremlin version 3.4/3.3 and 3.2 with the same error. Would be great if you could help fix this.

Thanks!

jwalton922 commented 4 years ago

I am able to search against my Neptune database. I could not replicate your issue. Can you share the body of the request? It should show the query. It might be helpful to show your graphConf.js, your input into the search UI, and the console logs.

gautam199 commented 4 years ago

Thanks for your reply.

From what I see, the query executes successfully when not passing string params. The issue seems to be with executing Gremlin queries with single quotes (for instance, when we pass in a node label as part of search criteria). I have tried escaping the quotes in multiple ways but none work. See UI below:

GraphExp

Note: The Gremlin query highlighted above successfully executes when I run it in the backend, however the POST request returns the following exception in the response:

{"requestId": "", "code": "InvalidParameterException", "detailedMessage": "body could not be parsed"}

image

Attaching below the contents of my graphconf.js: graphconf.txt

jwalton922 commented 4 years ago

What version of graphexp are you using? I don't see the box for the API key that you have so I'm wondering if you've made some changes, or aren't using the latest version?

Are you connecting directly to Neptune, or using gremlin server (or something else) as a proxy? Are you trying to get it to work with IAM authentication enabled? I don't see why that query would fail.

gautam199 commented 4 years ago

Hi...I'm using the latest version of Graphexp (v 0.8.0). The API key I'm setting within the code (there are some other minor local changes to do with logging etc. which can be ignored)

Yes, I'm using a proxy lambda function based on https://docs.aws.amazon.com/neptune/latest/userguide/iam-auth-connecting-python.html exposed via API gateway. Authentication wise, the setup seems to be fine since the "GetGraphInfo" queries seem to work fine.

jwalton922 commented 4 years ago

Since it looks like Graphexp is sending the request correctly, I would assume the issue is with the proxy. Can you disable IAM Authentication temporarily and try using the Neptune host directly from Graphexp, or log your request from your proxy?

gautam199 commented 4 years ago

The issue does seem to be in the proxy where the POST request is being made to Neptune instance. Specifically, the issue seems to be with the double quotes in the Gremlin query that is part of the request payload.

The proxy function converts {'gremlin': "g.V().hasLabel('PO').limit(50).toList()"} to {"gremlin": "g.V().hasLabel("PO").limit(50).toList()"}

which when issued against the Neptune endpoint gives 'InvalidParameterException', 'detailedMessage': 'body could not be parsed' exception.

I won't be able to debug/test it for a couple of days due to IT constraints but will update here with my findings.

Thanks @jwalton922 !

gautam199 commented 4 years ago

The issue was in the lambda function where the quotes were an issue in the POST requests that were constructed. This is fixed now... thanks for pointing me in the right direction