orientechnologies / orientdb

OrientDB is the most versatile DBMS supporting Graph, Document, Reactive, Full-Text and Geospatial models in one Multi-Model product. OrientDB can run distributed (Multi-Master), supports SQL, ACID Transactions, Full-Text indexing and Reactive Queries.
https://orientdb.dev
Apache License 2.0
4.75k stars 871 forks source link

Gremlin server serialization error ORecordId not found #10008

Open tglman opened 1 year ago

tglman commented 1 year ago

Discussed in https://github.com/orientechnologies/orientdb/discussions/10007

Originally posted by **fenriquez1** August 2, 2023 How do I add the serializer "com.orientechnologies.orient.core.id.ORecordId"? I get the following error when adding or searching for a vertex: `'result': {'data': None, 'meta': {}}, 'status': {'attributes': {...'message': 'Error during serialization: Serializer for type com.orientechnologies.orient.core.id.ORecordId not found'}` I can write and read using gremlin console with no errors. I'm running orientdb-tp3-3.2.19 Using Python 3.10.12 to connect, read, write to orientDB through gremlin server with gremlinpython 3.6.4. Gremlin server yaml: ```yaml host: 0.0.0.0 port: 8182 evaluationTimeout: 30000 channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer graphManager : com.orientechnologies.tinkerpop.server.OrientGremlinGraphManager graphs: { graph : ../config/demodb.properties } scriptEngines: { gremlin-groovy: { plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, org.apache.tinkerpop.gremlin.orientdb.jsr223.OrientDBGremlinPlugin: {}, org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [../config/demodb.groovy]}}}} serializers: - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.orientdb.io.OrientIoRegistry] }} # application/vnd.gremlin-v3.0+gryo - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }} # application/vnd.gremlin-v3.0+gryo-stringd - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.orientdb.io.OrientIoRegistry] }} # application/json - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1, config: { ioRegistries: [org.apache.tinkerpop.gremlin.orientdb.io.OrientIoRegistry] }} # application/vnd.gremlin-binary - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1, config: { serializeResultToString: true }} # application/vnd.gremlin-binary processors: - { className: org.apache.tinkerpop.gremlin.server.op.session.SessionOpProcessor, config: { sessionTimeout: 28800000 }} - { className: org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor, config: { cacheExpirationTime: 600000, cacheMaxSize: 1000 }} metrics: { consoleReporter: {enabled: true, interval: 180000}, csvReporter: {enabled: true, interval: 180000, fileName: /tmp/gremlin-server-metrics.csv}, jmxReporter: {enabled: true}, slf4jReporter: {enabled: true, interval: 180000}} strictTransactionManagement: false maxInitialLineLength: 4096 maxHeaderSize: 8192 maxChunkSize: 8192 maxContentLength: 65536 maxAccumulationBufferComponents: 1024 resultIterationBatchSize: 64 writeBufferLowWaterMark: 32768 writeBufferHighWaterMark: 65536 authentication: { authenticator: com.orientechnologies.tinkerpop.server.auth.OGremlinServerAuthenticator } ssl: { enabled: false} ```
fenriquez1 commented 1 year ago

Following example from https://github.com/apache/tinkerpop/tree/master/gremlin-python/src/main/python

Raises error:

Received error message '{'requestId': '6078897c-5a20-47a9-9e6d-0e6d10a055e5', 'status': {'code': 599, 'message': 'Error during serialization: Serializer for type com.orientechnologies.orient.core.id.ORecordId not found', 'attributes': {'stackTrace': 'org.apache.tinkerpop.gremlin.driver.ser.SerializationException: java.io.IOException: Serializer for type com.orientechnologies.orient.core.id.ORecordId not found\n\tat org.apache.tinkerpop.gremlin.driver.ser.binary.ResponseMessageSerializer.writeValue(ResponseMessageSerializer.java:86)\n\tat org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1.serializeResponseAsBinary(GraphBinaryMessageSerializerV1.java:150)\n\tat org.apache.tinkerpop.gremlin.server.op.AbstractOpProcessor.makeFrame(AbstractOpProcessor.java:291)\n\tat org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor.handleIterator(TraversalOpProcessor.java:373)\n\tat org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor.lambda$iterateBytecodeTraversal$0(TraversalOpProcessor.java:222)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:750)\nCaused by: java.io.IOException: Serializer for type com.orientechnologies.orient.core.id.ORecordId not found\n\tat org.apache.tinkerpop.gremlin.structure.io.binary.TypeSerializerRegistry.validateInstance(TypeSerializerRegistry.java:411)\n\tat org.apache.tinkerpop.gremlin.structure.io.binary.TypeSerializerRegistry.getSerializer(TypeSerializerRegistry.java:380)\n\tat org.apache.tinkerpop.gremlin.structure.io.binary.GraphBinaryWriter.write(GraphBinaryWriter.java:90)\n\tat org.apache.tinkerpop.gremlin.structure.io.binary.types.MapSerializer.writeValue(MapSerializer.java:54)\n\tat org.apache.tinkerpop.gremlin.structure.io.binary.types.MapSerializer.writeValue(MapSerializer.java:31)\n\tat org.apache.tinkerpop.gremlin.structure.io.binary.types.SimpleTypeSerializer.writeValue(SimpleTypeSerializer.java:91)\n\tat org.apache.tinkerpop.gremlin.structure.io.binary.types.SimpleTypeSerializer.write(SimpleTypeSerializer.java:73)\n\tat org.apache.tinkerpop.gremlin.structure.io.binary.GraphBinaryWriter.write(GraphBinaryWriter.java:112)\n\tat org.apache.tinkerpop.gremlin.structure.io.binary.types.TraverserSerializer.writeValue(TraverserSerializer.java:49)\n\tat org.apache.tinkerpop.gremlin.structure.io.binary.types.TraverserSerializer.writeValue(TraverserSerializer.java:33)\n\tat org.apache.tinkerpop.gremlin.structure.io.binary.types.SimpleTypeSerializer.writeValue(SimpleTypeSerializer.java:91)\n\tat org.apache.tinkerpop.gremlin.structure.io.binary.types.SimpleTypeSerializer.write(SimpleTypeSerializer.java:73)\n\tat org.apache.tinkerpop.gremlin.structure.io.binary.GraphBinaryWriter.write(GraphBinaryWriter.java:112)\n\tat org.apache.tinkerpop.gremlin.structure.io.binary.types.CollectionSerializer.writeValue(CollectionSerializer.java:52)\n\tat org.apache.tinkerpop.gremlin.structure.io.binary.types.ListSerializer.writeValue(ListSerializer.java:44)\n\tat org.apache.tinkerpop.gremlin.structure.io.binary.types.ListSerializer.writeValue(ListSerializer.java:29)\n\tat org.apache.tinkerpop.gremlin.structure.io.binary.types.SimpleTypeSerializer.writeValue(SimpleTypeSerializer.java:91)\n\tat org.apache.tinkerpop.gremlin.structure.io.binary.types.SimpleTypeSerializer.write(SimpleTypeSerializer.java:73)\n\tat org.apache.tinkerpop.gremlin.structure.io.binary.GraphBinaryWriter.write(GraphBinaryWriter.java:112)\n\tat org.apache.tinkerpop.gremlin.driver.ser.binary.ResponseMessageSerializer.writeValue(ResponseMessageSerializer.java:84)\n\t... 10 more\n', 'exceptions': ['org.apache.tinkerpop.gremlin.driver.ser.SerializationException', 'java.io.IOException']}}, 'result': {'meta': {}, 'data': None}}'

With results dictionary '{'6078897c-5a20-47a9-9e6d-0e6d10a055e5': <gremlin_python.driver.resultset.ResultSet object at 0x7ff059285d20>}'
Traceback (most recent call last):
  File "/workspace/bloomberg/wfsigsvc/graph_db/orient_db/orient_db_reader.py", line 9, in <module>
    main()
  File "/workspace/bloomberg/wfsigsvc/graph_db/orient_db/orient_db_reader.py", line 6, in main
    print(g.V().has('person', 'name', 'John').element_map().to_list())
  File "/opt/bb/lib/python3.10/site-packages/gremlin_python/process/traversal.py", line 65, in to_list
    return list(iter(self))
  File "/opt/bb/lib/python3.10/site-packages/gremlin_python/process/traversal.py", line 48, in __next__
    self.traversal_strategies.apply_strategies(self)
  File "/opt/bb/lib/python3.10/site-packages/gremlin_python/process/traversal.py", line 694, in apply_strategies
    traversal_strategy.apply(traversal)
  File "/opt/bb/lib/python3.10/site-packages/gremlin_python/driver/remote_connection.py", line 78, in apply
    remote_traversal = self.remote_connection.submit(traversal.bytecode)
  File "/opt/bb/lib/python3.10/site-packages/gremlin_python/driver/driver_remote_connection.py", line 105, in submit
    results = result_set.all().result()
  File "/opt/bb/lib/python3.10/concurrent/futures/_base.py", line 458, in result
    return self.__get_result()
  File "/opt/bb/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/opt/bb/lib/python3.10/site-packages/gremlin_python/driver/resultset.py", line 90, in cb
    f.result()
  File "/opt/bb/lib/python3.10/concurrent/futures/_base.py", line 451, in result
    return self.__get_result()
  File "/opt/bb/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/opt/bb/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/opt/bb/lib/python3.10/site-packages/gremlin_python/driver/connection.py", line 90, in _receive
    status_code = self._protocol.data_received(data, self._results)
  File "/opt/bb/lib/python3.10/site-packages/gremlin_python/driver/protocol.py", line 121, in data_received
    return self.data_received(data, results_dict)
  File "/opt/bb/lib/python3.10/site-packages/gremlin_python/driver/protocol.py", line 138, in data_received
    raise GremlinServerError(message['status'])
gremlin_python.driver.protocol.GremlinServerError: 599: Error during serialization: Serializer for type com.orientechnologies.orient.core.id.ORecordId not found
tglman commented 4 months ago

Hi,

Could you try again with 3.2.32, this case may have been fixed.

Regards

nuzirwan commented 3 months ago

im trying to query with golang driver v3

dat, err := g.V().HasLabel("Person", "name", "Jon").Next() but it returns Error occurred during operation gremlinServerWSProtocol.responseHandler(): 'E0502: error in read loop, error message '{code:87 message:Error during serialization: Serializer for type com.orientechnologies.orient.core.id.ORecordId not found attributes:map[exceptions:[org.apache.tinkerpop.gremlin.util.ser.SerializationException java.io.IOException] stackTrace:org.apache.tinkerpop.gremlin.util.ser.SerializationException: java.io.IOException: Serializer for type com.orientechnologies.orient.core.id.ORecordId not found

stack error at org.apache.tinkerpop.gremlin.util.ser.binary.ResponseMessageSerializer.writeValue(ResponseMessageSerializer.java:86) at org.apache.tinkerpop.gremlin.util.ser.GraphBinaryMessageSerializerV1.serializeResponseAsBinary(GraphBinaryMessageSerializerV1.java:155) at org.apache.tinkerpop.gremlin.server.op.AbstractOpProcessor.makeFrame(AbstractOpProcessor.java:289) at org.apache.tinkerpop.gremlin.server.op.session.SessionOpProcessor.handleIterator(SessionOpProcessor.java:685) at org.apache.tinkerpop.gremlin.server.op.session.SessionOpProcessor.lambda$iterateBytecodeTraversal$5(SessionOpProcessor.java:419) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:750) Caused by: java.io.IOException: Serializer for type com.orientechnologies.orient.core.id.ORecordId not found at org.apache.tinkerpop.gremlin.structure.io.binary.TypeSerializerRegistry.validateInstance(TypeSerializerRegistry.java:458) at org.apache.tinkerpop.gremlin.structure.io.binary.TypeSerializerRegistry.getSerializer(TypeSerializerRegistry.java:427) at org.apache.tinkerpop.gremlin.structure.io.binary.GraphBinaryWriter.write(GraphBinaryWriter.java:90) at org.apache.tinkerpop.gremlin.structure.io.binary.types.VertexSerializer.writeValue(VertexSerializer.java:61) at org.apache.tinkerpop.gremlin.structure.io.binary.types.VertexSerializer.writeValue(VertexSerializer.java:37) at org.apache.tinkerpop.gremlin.structure.io.binary.types.SimpleTypeSerializer.writeValue(SimpleTypeSerializer.java:91) at org.apache.tinkerpop.gremlin.structure.io.binary.types.SimpleTypeSerializer.write(SimpleTypeSerializer.java:73) at org.apache.tinkerpop.gremlin.structure.io.binary.GraphBinaryWriter.write(GraphBinaryWriter.java:112) at org.apache.tinkerpop.gremlin.structure.io.binary.types.TraverserSerializer.writeValue(TraverserSerializer.java:49) at org.apache.tinkerpop.gremlin.structure.io.binary.types.TraverserSerializer.writeValue(TraverserSerializer.java:33) at org.apache.tinkerpop.gremlin.structure.io.binary.types.SimpleTypeSerializer.writeValue(SimpleTypeSerializer.java:91) at org.apache.tinkerpop.gremlin.structure.io.binary.types.SimpleTypeSerializer.write(SimpleTypeSerializer.java:73) at org.apache.tinkerpop.gremlin.structure.io.binary.GraphBinaryWriter.write(GraphBinaryWriter.java:112) at org.apache.tinkerpop.gremlin.structure.io.binary.types.CollectionSerializer.writeValue(CollectionSerializer.java:52) at org.apache.tinkerpop.gremlin.structure.io.binary.types.ListSerializer.writeValue(ListSerializer.java:44) at org.apache.tinkerpop.gremlin.structure.io.binary.types.ListSerializer.writeValue(ListSerializer.java:29) at org.apache.tinkerpop.gremlin.structure.io.binary.types.SimpleTypeSerializer.writeValue(SimpleTypeSerializer.java:91) at org.apache.tinkerpop.gremlin.structure.io.binary.types.SimpleTypeSerializer.write(SimpleTypeSerializer.java:73) at org.apache.tinkerpop.gremlin.structure.io.binary.GraphBinaryWriter.write(GraphBinaryWriter.java:112) at org.apache.tinkerpop.gremlin.util.ser.binary.ResponseMessageSerializer.writeValue(ResponseMessageSerializer.java:84) ... 10 more ]}'. statusCode: 87'

OrientDB version : 3.2.32 Docker Image : orientdb:3.2.32-tp3

tglman commented 3 months ago

Hi,

I think this depends on what serializer is used by the client, are you aware of which one is it?

Regards

nuzirwan commented 3 months ago

Hi,

I think this depends on what serializer is used by the client, are you aware of which one is it?

Regards

hi , thanks for the response im using go lib from tinkerpop repo https://github.com/apache/tinkerpop/tree/gremlin-go/v3.7.2/gremlin-go/driver

or do you have recommendation lib in go?