Deserializing of Vertex ID with Custom String value
Hi,
I've come across an issue with deserialization from users enabling custom vertex ID values and types as documented on https://docs.janusgraph.org/advanced-topics/custom-vertex-id/. Below is a sample GraphSON serialization error highlighting the issue, where a vertex has a custom string ID value (U933779):
java.lang.IllegalArgumentException: Invalid id - each token expected to be a number at [Source: (byte[])"{"requestId":"171a7723-7b62-4131-8035-e735ff368ffd","status":{"message":"","code":200,"attributes":{"@type":"g:Map","@value":["host","localhost"]}},"result":{"data":{"@type":"g:List","@value":[{"@type":"g:Vertex","@value":{"id":"U933779","label":"user","properties":{"phone":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"janusgraph:RelationIdentifier","@value":{"relationId":"9g3yj-SU933779-8p1"}},"value":"[REDACTED]","label":"phone","properties":{"metadata":"{}"}}}],"profile"[truncated 645 bytes]; line: 1, column: 415]
java.lang.IllegalArgumentException: Invalid id - each token expected to be a number at [Source: (byte[])"{"requestId":"171a7723-7b62-4131-8035-e735ff368ffd","status":{"message":"","code":200,"attributes":{"@type":"g:Map","@value":["host","localhost"]}},"result":{"data":{"@type":"g:List","@value":[{"@type":"g:Vertex","@value":{"id":"U933779","label":"user","properties":{"phone":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"janusgraph:RelationIdentifier","@value":{"relationId":"9g3yj-SU933779-8p1"}},"value":"[REDACTED]","label":"phone","properties":{"metadata":"{}"}}}],"profile"[truncated 645 bytes]; line: 1, column: 415]
JanusGraph: an open-source, distributed graph database - JanusGraph/janusgraph
Solution
Hey, turns out it was a mismatch between driver and server version due to the user being on an older version of G.V(), i need to remember to make this the first thing i check