Miki P
Miki P

Reputation: 652

Traversal Serialization error in JanusGraph

I've set up a JanusGraph instance backed by DynamoDB as described in the GitHub docs, created a simple API in Java to test CRUD operations, and I got creation and read to work. The problem arises when I try to remove data. When adding, I call:

Vertex v = this.g.addV("student").property("name", student.getName()).next()

and return

Long id = (Long) v.id()
return Long.toString(id)

When removing, I call:

this.g.V(Long.valueOf(id)).drop().iterate()

and get the following error from the Gremlin server:

    2631184 [gremlin-server-worker-1] ERROR 
    org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor  
    - Could not deserialize the Traversal instance
    2631186 [gremlin-server-worker-1] WARN  
    org.apache.tinkerpop.gremlin.server.handler.OpExecutorHandler  - Could 
    not deserialize the Traversal instance
org.apache.tinkerpop.gremlin.server.op.OpProcessorException: Could not deserialize the Traversal instance
    at org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor.iterateBytecodeTraversal(TraversalOpProcessor.java:369)
    at org.apache.tinkerpop.gremlin.server.handler.OpExecutorHandler.channelRead0(OpExecutorHandler.java:68)
    at org.apache.tinkerpop.gremlin.server.handler.OpExecutorHandler.channelRead0(OpExecutorHandler.java:43)
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)

My logs (on the server I'm calling the API from) show:

Caused by: org.apache.tinkerpop.gremlin.driver.exception.ResponseException: null:none([])
at org.apache.tinkerpop.gremlin.driver.Handler$GremlinResponseHandler.channelRead0(Handler.java:246) ~[gremlin-driver-3.3.2.jar:3.3.2]
at org.apache.tinkerpop.gremlin.driver.Handler$GremlinResponseHandler.channelRead0(Handler.java:197) ~[gremlin-driver-3.3.2.jar:3.3.2]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) ~[netty-all-4.1.jar:4.1.19.Final]

I'm using a org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0 as my serializer, and have tried others as well, but nothing seems to work.

I initialize the graph traversal with EmptyGraph in the following way:

this.g = EmptyGraph.instance().traversal().withRemote("some-path/remote-graph.properties");

I've been stuck on this problem for quite a bit, so any help is truly appreciated!

Upvotes: 2

Views: 899

Answers (1)

stephen mallette
stephen mallette

Reputation: 46226

I'm going to guess that you have some form of version issue. Try that call without using iterate(). Since you are doing just one deletion it should be safe to do next() instead of iterate() to see if that works around the problem. If not, I would align your driver (you are currently 3.3.2) to the version of TinkerPop that JanusGraph is using which for the current release of 0.2 is 3.2.6:

https://github.com/JanusGraph/janusgraph/blob/v0.2.0/pom.xml#L68

I think that you could safely use any version through 3.2.9 without too much worry. Ultimately, I think that the problem is with 3.3.1 with iterate() - see the first bullet point here:

https://github.com/apache/tinkerpop/blob/3.3.1/CHANGELOG.asciidoc#tinkerpop-331-release-date-december-17-2017

It's generally safe to use mis-matching versions of driver and server so long as you are aware of the upgrade changes like this, but we generally recommend that you don't so that you don't end up with these kinds of problems.

Upvotes: 1

Related Questions