1

I am running a Neptune Server on AWS and making gremlin queries to the db ipython cell magic in an jupyter notebook. I've got a number of traversals running and I am getting an error that is coming from aiogoblin in their resultset.py file: GremlinServerError: 499: {"requestId":"5bb1e6ea-49ec-4a1d-9364-2b1bf717df9c","code":"InvalidParameterException","detailedMessage":"The [eval] message contains 66 bindings which is more than is allowed by the server 64 configuration"}

How can I make continued queries against the server without this error message popping up?

Kelvin Lawrence
  • 14,674
  • 2
  • 16
  • 38
Justin Gerard
  • 147
  • 1
  • 7

1 Answers1

2

I believe there was a known issue with the client/magic you are using and I don't think it has been updated in four years or so. I vaguely remember you could work around it by doing something like %reset in the cell but I really think you would be better off using a different client that is regularly updated and supported.

You could instead use the Apache TinkerPop Gremlin Python client (pip install gremlinpython) or try the new Amazon Neptune Workbench which offers a %%gremlin cell magic.

If you use the Gremlin Python client in a Jupyter notebook you can still issue queries in much the same way, you would just need to establish a connection to the server in a cell before issuing Python based queries. There is a blog post that may be of interest located here [1] and a stand alone Python example you could use to create a cell containing the imports and setup steps can be found here [2] and here [3]. In the sample you would replace localhost with the DNS name of your Neptune endpoint.

If you decide to try the new Neptune Workbench you can create one from the AWS Neptune Console web page.

[1] https://aws.amazon.com/blogs/database/let-me-graph-that-for-you-part-1-air-routes/
[2] https://github.com/krlawrence/graph/blob/master/sample-code/basic-client.py
[3] https://github.com/krlawrence/graph/blob/master/sample-code/glv-client.py

Kelvin Lawrence
  • 14,674
  • 2
  • 16
  • 38
  • Thank you @Kelvin Lawrence. Very helpful. – Justin Gerard Feb 03 '20 at 14:37
  • My pleasure. Happy graphing :-) – Kelvin Lawrence Feb 04 '20 at 02:54
  • I created a fresh environment with jupyter, gremlin python and now I am getting `RuntimeError: Cannot run the event loop while another loop is running` which is being propagated by tornado. Did something change in `gremlinpython` in the past few weeks? I would use the `%%gremlin` magic but I want to do visualizations in the notebook – Justin Gerard Feb 21 '20 at 20:38
  • I am using Gremlin Python 3.4.3 and Tornado 4.5.1 with no issues in a notebook. What versions do you have installed? – Kelvin Lawrence Feb 22 '20 at 16:27
  • I was using python3.6. But I tried with python3.5 since Python 3.4 is not available in conda. I installed version 4.5.1 tornado and also tried 3.4.5 and 3.4.4 for gremlinpython. With this installation I get `HTTP 599: Timeout while connecting`. – Justin Gerard Feb 22 '20 at 19:38
  • I was referring to My GremlinPython version being 3.4.3 not Python itself. Can you reach the /status endpoint using curl from a %%bash cell in the notebook just to make sure that there is not an issue reaching Neptune? – Kelvin Lawrence Feb 22 '20 at 21:05
  • All good. Thank you Kelvin. Problem solved. I had forgotten that I needed to be in the same VPC as the instance... – Justin Gerard Feb 24 '20 at 17:17