Gremlingo with Neptune - Read loop error

Code that works perfectly on my local TinkerPop Gremlin server, fails in a (to me right now anyway ;), strange manner when connected to AWS Neptune serverless. The connection is fine and a tiny test to do a vertex count, then write and delete a test works, but when I try and insert vertices, it immediately files and closes the web socket with: 2023/06/09 07:49:44 Read loop error 'websocket: close 1000 (normal): Bye', closing read loop. 2023/06/09 07:49:44 Read loop error 'websocket: close 1000 (normal): Bye', closing read loop. 2023/06/09 07:49:44 Connection error callback invoked, closing protocol. 2023/06/09 07:49:44 Error upserting record: websocket: close 1000 (normal): Bye I can only think that this must be some kind of configuration issue or some coding issue that I am getting away with on TinkerPop but not AWS Neptune. My connection code is as per the AWS example: gc, err = gremlingo.NewDriverRemoteConnection("wss://xxxxxxxxxx.neptune.amazonaws.com:8182/gremlin", func(settings *gremlingo.DriverRemoteConnectionSettings) { settings.TraversalSource = "g" }) And then all I am doing (after stripping down to bare bones is: g := gremlingo.Traversal_().WithRemote(gc) match := map[interface{}]interface{}{ gremlingo.T.Id: ac.Identifier, // I have also tried without the T.Id gremlingo.T.Label: "areacode", } res, err := g.MergeV(match).HasNext() But my simple test code for connection verification: g.AddV("LUFC").Property("captain", "Billy").Next() Is fine. I know I am staring the answer in the face and it is perhaps something that Gremlin Server allows, but Neptune doesn't, such as specifying the T.Id (they are strings OK). So what am I missing such that GremlinServer has no problems, but Neptune just seems to want to connect when the query is sent, but fails to connect and th at's the end of it? Is this maybe just the Neptune connection timing out?
7 Replies
Valentyn Kahamlyk
Valentyn Kahamlyk•2y ago
What version of Neptune? Only latest supports MergeV
Jim Idle
Jim IdleOP•2y ago
Yes - I thought of that, but I just created the serverless instance a few days ago . I will double check compatibility, but the serverless engine is 1.2.0.1 according to the console. You may well be correct that this is just that I may have to go back to the older pattern of fold, coallesce etc. Thanks for the reply @valentyn_kahamlyk - despite Neptune docs directing one to use MergeV, there does seem to be some issue with this. Going back to the older pattern works, but I would like to work out what the issue is here.Version 1.2.0.1 of the engine is supposed to support mergeV/mergeE and is supposedly the preferred way to do an upsert
ColeGreer
ColeGreer•2y ago
This doc shows the relationship between Neptune and TinkerPop versions. https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-gremlin-client.html Neptune 1.2.0.1 still uses TinkerPop 3.5.x, Neptune 1.2.1.0 is the first engine using TinkerPop 3.6.x
Java-based Gremlin clients to use with Amazon Neptune - Amazon Neptune
You can use either of two open-source Java-based Gremlin clients with Amazon Neptune: the Apache TinkerPop Java Gremlin client , or the Gremlin client for Amazon Neptune .
Jim Idle
Jim IdleOP•2y ago
You are correct - I think it is because I chose to use serverless and obviously that has not yet caught up. Sorry for the noise here, but maybe having this information here might save someone else a little time.
ColeGreer
ColeGreer•2y ago
Don't worry about noise, there's no bad questions here. I'm sure someone will find this thread helpful down the line. Also just an FYI, Neptune serverless 1.2.1.0 with TinkerPop 3.6 support is available now. It doesn't upgrade automatically. You can upgrade the version selecting the cluster in the Neptune console and hitting the Modify button.
Jim Idle
Jim IdleOP•2y ago
Cheers Cole - what happened is I misread all the 2s and 1s 😉
Want results from more Discord servers?
Add your server