i am trying to run a piece of code in python which uses Cosmos DB from Microsoft Azure. I am currently using gremlinpython 3.2.6 and the latest version of Cosmos (default on microsoft azure) but there seems to be some compatibility issues between the two.
When i run my code i get the following error;
GremlinServerError: 498:
ActivityId : 5c05bb15-3aa1-41b8-9c10-ab3015152eab
ExceptionType : GraphMalformedException
ExceptionMessage :
Gremlin Malformed Request: GraphSON v3 IO is not supported.
GremlinRequestId : 5c05bb15-3aa1-41b8-9c10-ab3015152eab
Context : global
GraphInterOpStatusCode : MalformedRequest
HResult : 0x80131500
I have read that I should try using GraphSON v2 instead of V3 but don't know how, can anyone help?
welcome to this community. You just need to ensure that you use the schema of the GraphSON v2, since it is the version supported in Azure Cosmos DB. Check the json you are using and ensure that follows the supported schema. You have some examples in this link.
By default gremlin_python uses the GraphSONSerializersV3d0
, so you have to explicitly pass the GraphSONSerializersV2d0
when creating the client:
from gremlin_python.driver import client, serializer
client.Client(
message_serializer=serializer.GraphSONSerializersV2d0(),
password="...",
traversal_source='g',
url='wss://...:443/',
username="/dbs/.../colls/...",
)
Provide it as mime
type when you create client
var client = new GremlinClient(gremlinServer:gremlinServer,mimeType:GremlinClient.GraphSON2MimeType)
User contributions licensed under CC BY-SA 3.0