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?
Was this page helpful?