How do I troubleshoot an InternalFailureException on AWS Neptune?

885 views
Skip to first unread message

James Render

unread,
Nov 18, 2019, 11:37:11 AM11/18/19
to Gremlin-users
Apologies for using this forum to ask this vendor specific question, I'm aware of the existence of other forums but believe this to be the place that will be most helpful.

How does one troublehshoot Neptune when a query goes rogue?

org.apache.tinkerpop.gremlin.driver.exception.ResponseException: {"requestId":"b23af552-2036-421d-b173-3de6b6855d48","code":"InternalFailureException","detailedMessage":"An unexpected error has occurred in Neptune."}

I've pottered aroung CloudWatch, its telling me there are errors, great.. can I see the logs to get details?

I've not much experience with AWS so might be missing something obvious.

The offending query in question works fine against Gremlin Server (and used to against AWS).

thanks

Kelvin Lawrence

unread,
Nov 18, 2019, 9:13:30 PM11/18/19
to Gremlin-users
Hi James, would you be able to share the Gremlin query that caused the error response?

Thanks
Kelvin

James Render

unread,
Nov 19, 2019, 4:39:20 AM11/19/19
to Gremlin-users
Thanks for the response Kelvin.  I've managed to resolve the issue with the query - one of the nice things about ascending a learning curve is the opportunity to revisit earlier work and go `what WAS I thinking?!`

I was after some advice on how to get error messages out of Neptune when I get stuck.

Kelvin Lawrence

unread,
Nov 19, 2019, 9:06:50 AM11/19/19
to Gremlin-users
Hi James, ff you could share the query that gave the error I would be happy to look into it for you. In my experience, there are a few cases  where the "internal exception" is really as simple as there was an issue with the query syntax itself and the error message could be improved.

Without getting too deep into specific implementations on this list, Neptune has Profile and Explain REST APIs for Gremlin queries that will tell you what the optimizer did with the query and many other useful items. You can read about that feature here [1]. Also please feel free to post to the Amazon Neptune support forum [2] if you would like to continue the conversation there.


Cheers
Kelvin

James Render

unread,
Nov 20, 2019, 5:05:45 AM11/20/19
to Gremlin-users
g.V(profile.getUserId()).as("user_vertex").
        coalesce
(
                outE
("likes").fold(),
                fold
()                              // using fold() as there won't be edges for a new profiles
       
).as("old_likes_edges").
        V
().hasLabel("interest").filter(values("name").is(within(interestNames))).
        addE
("likes").property(CREATED, now).from("user_vertex").
        sideEffect
(select("old_likes_edges").unfold().drop())
       
.iterate()
;

Kelvin Lawrence

unread,
Nov 20, 2019, 4:26:42 PM11/20/19
to Gremlin-users
Thanks for the query James,

I could not get it to fail but I had to make up some values for the cases where you have variables so perhaps there is something in those values that make a difference.

If you see any of these "internal failure" errors again I would be more than happy to look into what the actual issue is. As I mentioned above, in the other cases I have seen it is usually an issue with the query and an error message that needs to be improved. Running the query thru the explain() Gremlin step or the /gremlin/explain Neptune REST endpoint will usually find any issues in the query itself. If that does not show an error please always feel free to post to the support forum or reach out to me.

James Render

unread,
Nov 21, 2019, 8:22:43 AM11/21/19
to Gremlin-users
thanks for the tips on using explain() and the REST endpoint to trouble-shoot.  Appreciate your help.  I have been refering to your gremlin book on an almost daily basis for the past few months.
Reply all
Reply to author
Forward
0 new messages