Gremlin-Driver 3.2.5/3.3.0 + CosmosDB GraphSON serialization errors

320 views
Skip to first unread message

vijay chennupati

unread,
Aug 28, 2017, 1:05:05 PM8/28/17
to Gremlin-users
Hi,

   I am running in rounds, couldnt figure out how to solve this, I have a couple of 100 vertex stored in Cosmos Graph DB (using gremlin driver). When I try to query the vertex with a limit , I am not able to return more than 24 results, above 24 results it is giving an serialization exception, saying 

Caused by: org.apache.tinkerpop.shaded.jackson.core.io.JsonEOFException: Unexpected end-of-input within/between Object entries
 at [Source: {"requestId":"f4a94f29-e2e1-46b0-9754-141556f8e961","status":{"code":200,"attributes":{"RU":0.0},"message":""},"result":{"data":[{"id":

Even when I tried on the gremlion console I get the following error.

Caused by: org.apache.tinkerpop.gremlin.driver.ser.SerializationException: org.apache.tinkerpop.shaded.jackson.core.io.JsonEOFException: Unexpected end-of-input: expected close marker for Object (start marker at [Source: {"requestId":"a9d24361-6a73-4f83-952b-8f2447124bd1","status":{"code":206,"attributes":{"RU":0.0},"message":""},"result":{"data":[{"id":"0761639b-f3f1-4e91-89c1-24a26376f7c7","
......
at org.apache.tinkerpop.shaded.jackson.core.base.ParserMinimalBase._reportInvalidEOF(ParserMinimalBase.java:483)
at org.apache.tinkerpop.shaded.jackson.core.base.ParserBase._handleEOF(ParserBase.java:535)
at org.apache.tinkerpop.shaded.jackson.core.base.ParserBase._eofAsNextChar(ParserBase.java:547)
at org.apache.tinkerpop.shaded.jackson.core.json.ReaderBasedJsonParser._skipWSOrEnd(ReaderBasedJsonParser.java:2346)
at org.apache.tinkerpop.shaded.jackson.core.json.ReaderBasedJsonParser.nextFieldName(ReaderBasedJsonParser.java:886)
at org.apache.tinkerpop.shaded.jackson.databind.deser.std.UntypedObjectDeserializer$Vanilla.mapObject(UntypedObjectDeserializer.java:653)
.....

at org.apache.tinkerpop.shaded.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2861)
at org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0.deserializeResponse(GraphSONMessageSerializerV1d0.java:79)
... 36 more
ERROR org.apache.tinkerpop.gremlin.driver.Handler$GremlinResponseHandler  - Could not process the response
java.lang.NullPointerException
at org.apache.tinkerpop.gremlin.driver.Handler$GremlinResponseHandler.lambda$channelRead0$0(Handler.java:218)
at java.util.ArrayList.forEach(ArrayList.java:1249)
at org.apache.tinkerpop.gremlin.driver.Handler$GremlinResponseHandler.channelRead0(Handler.java:218)
at org.apache.tinkerpop.gremlin.driver.Handler$GremlinResponseHandler.channelRead0(Handler.java:195)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:367)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:353)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:346)
at org.apache.tinkerpop.gremlin.driver.Handler$GremlinSaslAuthenticationHandler.channelRead0(Handler.java:123)
at org.apache.tinkerpop.gremlin.driver.Handler$GremlinSaslAuthenticationHandler.channelRead0(Handler.java:67)
at io.netty.channel.SimpleChannelInboundHandler.channelR

Here is the remote yaml config (removed host port)

connectionPool: {
  enableSsl: true
  }
serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0, config: { serializeResultToString: true }}

Can anybody help me , what is that I am doing wrong

Thank you,
Vijay

Stephen Mallette

unread,
Aug 28, 2017, 1:46:42 PM8/28/17
to Gremlin-users
You mentioned two versions in the subject of your post: 3.2.5 and 3.3.0.  Did you mean 3.2.6 and 3.3.0? With 3.3.0 note that the default configuration for GraphSON is GraphSON 3.0. I don't think CosmosDB supports 3.3.0 yet, so you may need to wait until they become official with that version to use GraphSON 3.0. You could reconfigure the 3.3.0 driver to use an earlier version of GraphSON 1.0/2.0 depending on what CosmosDB supports. I would have thought 3.2.5/3.2.6 would be fine against CosmosDB as there were no changes to protocol or GraphSON format. Did your code and limit() work with the 3.2.4 version of the driver?

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/6bfb42fd-e6a8-45f9-a37f-961adc440455%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

vijay chennupati

unread,
Aug 28, 2017, 2:06:56 PM8/28/17
to Gremlin-users
Hi Steve,

   I have used 3.2.4/3.2.5/3.2.6 all of them don't return results if the results size is greater than 24. Will find out when CosmosDB will move to 3.3.0

Thank you,
Vijay
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.

Stephen Mallette

unread,
Aug 28, 2017, 2:13:16 PM8/28/17
to Gremlin-users
I think CosmosDB was on 3.2.4 when they first announced Gremlin for their Graph API. If it doesn't work at that version, then I guess it won't work in the newer ones. What is the query you are doing (and I assume you are sending a script and not trying to use withRemote()/GLV)?

To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/618aafba-872e-43f7-a08b-2b4a2cc423b5%40googlegroups.com.

vijay chennupati

unread,
Aug 28, 2017, 2:20:40 PM8/28/17
to Gremlin-users
Its a very naive query, let me post my query. By the way I am using the gremlin driver in java. I have a bunch of vertex of type Asset with 3 attributes, loaded the data for about 2000 vertex.

val cluster = Cluster.build(new File("conf/remote-secure.yaml")).create();

  

val client: Client = cluster.connect();


client.submit("g.V().hasLabel('Asset').limit(24)  --- works

client.submit("g.V().hasLabel('Asset').limit(27)  --- doesnt work

vijay chennupati

unread,
Aug 28, 2017, 2:30:36 PM8/28/17
to Gremlin-users
oops I have also properly closed the quotes 

client.submit("g.V().hasLabel('Asset')").limit(24)  --- works

client.submit("g.V().hasLabel('Asset')").limit(27)  --- doesnt work

Stephen Mallette

unread,
Aug 28, 2017, 2:53:26 PM8/28/17
to Gremlin-users
Are you sure that's what you're code? don't you mean:

client.submit("g.V().hasLabel('Asset').limit(24)")

where the limit() is part of the script you are sending? limit() used on the return object of submit() does not have a limit() method. That should present as a compile error.

assuming I'm correct, do you get any different behavior with:

g.V().hasLabel('Asset').range(25)?

or how about:

g.V().hasLabel('Asset').id().limit(25)

note that the TinkerPop java driver with Gremlin Server and TinkerGraph don't have problems with returning more than 24 things. I have at least one (probably others) integration test that deals with this issue explicitly. However, if you can recreate this problem with a TinkerPop only environment, I'd be interested to see that obviously.

To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/ceef18fc-7160-46de-a4ac-fdbbcbf914d3%40googlegroups.com.

Stephen Mallette

unread,
Aug 28, 2017, 2:53:52 PM8/28/17
to Gremlin-users
sorry - that range() traversal i wanted you to try was:

g.V().hasLabel('Asset').range(0,25)
Reply all
Reply to author
Forward
Message has been deleted
0 new messages