DataType error encountered for various commands with 3.6.1+ #87

120 views
Skip to first unread message

Teague Bick

unread,
Nov 18, 2023, 7:40:04 AM11/18/23
to Gremlin-users
I am using JanusGraph and see a break after 3.6.1 (seen in 3.7.0 as well).

3.6.0 works fine, but 3.6.1 and later run into the below issues.  Is there a better place to open

Stack trace:

```
(venv) ➜  entities git:(teague.bick/accupath) ✗ ./demo.py                      
Traceback (most recent call last):
  File "/Users/teague.bick/Workspace/experimental/entities/./demo.py", line 12, in <module>
    g.V().has_label("person").to_list()
  File "/Users/teague.bick/Workspace/experimental/entities/venv/lib/python3.9/site-packages/gremlin_python/process/traversal.py", line 65, in to_list
    return list(iter(self))
  File "/Users/teague.bick/Workspace/experimental/entities/venv/lib/python3.9/site-packages/gremlin_python/process/traversal.py", line 48, in __next__
    self.traversal_strategies.apply_strategies(self)
  File "/Users/teague.bick/Workspace/experimental/entities/venv/lib/python3.9/site-packages/gremlin_python/process/traversal.py", line 684, in apply_strategies
    traversal_strategy.apply(traversal)
  File "/Users/teague.bick/Workspace/experimental/entities/venv/lib/python3.9/site-packages/gremlin_python/driver/remote_connection.py", line 78, in apply
    remote_traversal = self.remote_connection.submit(traversal.bytecode)
  File "/Users/teague.bick/Workspace/experimental/entities/venv/lib/python3.9/site-packages/gremlin_python/driver/driver_remote_connection.py", line 105, in submit
    results = result_set.all().result()
  File "/Users/teague.bick/.pyenv/versions/3.9.17/lib/python3.9/concurrent/futures/_base.py", line 446, in result
    return self.__get_result()
  File "/Users/teague.bick/.pyenv/versions/3.9.17/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result
    raise self._exception
  File "/Users/teague.bick/Workspace/experimental/entities/venv/lib/python3.9/site-packages/gremlin_python/driver/resultset.py", line 90, in cb
    f.result()
  File "/Users/teague.bick/.pyenv/versions/3.9.17/lib/python3.9/concurrent/futures/_base.py", line 439, in result
    return self.__get_result()
  File "/Users/teague.bick/.pyenv/versions/3.9.17/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result
    raise self._exception
  File "/Users/teague.bick/.pyenv/versions/3.9.17/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/Users/teague.bick/Workspace/experimental/entities/venv/lib/python3.9/site-packages/gremlin_python/driver/connection.py", line 90, in _receive
    status_code = self._protocol.data_received(data, self._results)
  File "/Users/teague.bick/Workspace/experimental/entities/venv/lib/python3.9/site-packages/gremlin_python/driver/protocol.py", line 96, in data_received
    message = self._message_serializer.deserialize_message(message)
  File "/Users/teague.bick/Workspace/experimental/entities/venv/lib/python3.9/site-packages/gremlin_python/driver/serializer.py", line 280, in deserialize_message
    result = self._graphbinary_reader.to_object(b)
  File "/Users/teague.bick/Workspace/experimental/entities/venv/lib/python3.9/site-packages/gremlin_python/structure/io/graphbinaryV1.py", line 203, in to_object
    return self.deserializers[DataType(bt)].objectify(buff, self, nullable)
  File "/Users/teague.bick/Workspace/experimental/entities/venv/lib/python3.9/site-packages/gremlin_python/structure/io/graphbinaryV1.py", line 502, in objectify
    return cls.is_null(buff, reader, cls._read_list, nullable)
  File "/Users/teague.bick/Workspace/experimental/entities/venv/lib/python3.9/site-packages/gremlin_python/structure/io/graphbinaryV1.py", line 231, in is_null
    return None if nullable and buff.read(1)[0] == 0x01 else else_opt(buff, reader)
  File "/Users/teague.bick/Workspace/experimental/entities/venv/lib/python3.9/site-packages/gremlin_python/structure/io/graphbinaryV1.py", line 509, in _read_list
    the_list.append(r.read_object(b))
  File "/Users/teague.bick/Workspace/experimental/entities/venv/lib/python3.9/site-packages/gremlin_python/structure/io/graphbinaryV1.py", line 194, in read_object
    return self.to_object(b)
  File "/Users/teague.bick/Workspace/experimental/entities/venv/lib/python3.9/site-packages/gremlin_python/structure/io/graphbinaryV1.py", line 203, in to_object
    return self.deserializers[DataType(bt)].objectify(buff, self, nullable)
KeyError: <DataType.custom: 0>
```

Example Code:
```
#!/usr/bin/env python

from gremlin_python.process.anonymous_traversal import traversal
from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection
from gremlin_python.process.graph_traversal import __

g = traversal().with_remote(DriverRemoteConnection('ws://localhost:8182/gremlin', 'g'))

g.add_v('person').property('name', 'marko').iterate()
g.add_v('person').property('name', 'vadas').iterate()

g.V().has_label("person").to_list()   # This is the error line
```

Yang Xia

unread,
Nov 21, 2023, 2:42:34 PM11/21/23
to gremli...@googlegroups.com
Hi Teague,

I'm not entirely sure of the error that would have caused this on the Janus server side, but in terms of driver serialization related changes, 3.6.1 and above had a switch in default serializer from GraphSON to GraphBinary in gremlin python (see https://tinkerpop.apache.org/docs/current/upgrade/#_tinkerpop_3_6_1). 

I'd suggest try switching to GraphSon in your example code and see if it works, which I believe can be done via DRC (might need some tweaks when trying):

remote_conn = DriverRemoteConnection(gremlin_server_url, 'g',
                                     message_serializer=serializer.GraphSONSerializersV3d0())
g = traversal().with_remote(remote_conn)

Also please feel free to join the TinkerPop Discord channel (https://discord.gg/tinkerpop) if you haven't yet, folks are usually on to monitor questions and discussions.  

Cheers,

Yang

--
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-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/e6fbb474-ccd0-42c2-8883-953ba4a8c76bn%40googlegroups.com.

Teague Bick

unread,
Nov 23, 2023, 1:24:51 PM11/23/23
to Gremlin-users
That worked like a charm!

Using the serializer as a pointer, I was able to find a few issues in JanusGraph, where this appears to be a known (and maybe expected) issue - https://github.com/JanusGraph/janusgraph/issues/4127

Also, thank you for the discord, I'll join up!

Reply all
Reply to author
Forward
0 new messages