Trying to run a local version for a test, what is the correct serializer?

Windows machine, local host. I can't find the Running this, https://github.com/bricaud/gremlin-server but updated the version to apache-tinkerpop-gremlin-server-3.7.0 I had issue with the serializers: section of the gremlin-conf.yaml so I commented out to see if the defaults would work. The docker image loads fine, but then I can't seem to connect to it. My simple test:
print('Number of nodes {}, number of edges {}.'.format(g.V().count().next(),g.E().count().next()))
print('Number of nodes {}, number of edges {}.'.format(g.V().count().next(),g.E().count().next()))
My error:
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected
So I'm trying to find out what serializer goes there, but all of my variants are failing. Anyone know what the correct serializer is?
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1 , config: { serializeResultToString: true }} # application/vnd.gremlin-v3.0+gryo-stringd
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1 , config: { serializeResultToString: true }} # application/vnd.gremlin-v3.0+gryo-stringd
[WARN] o.a.t.g.s.AbstractChannelizer - Could not find configured serializer class - org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1 - it will not be available
[ERROR] o.a.t.g.s.AbstractChannelizer - No serializers were successfully configured - server will not start.
[WARN] o.a.t.g.s.AbstractChannelizer - Could not find configured serializer class - org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1 - it will not be available
[ERROR] o.a.t.g.s.AbstractChannelizer - No serializers were successfully configured - server will not start.
GitHub
GitHub - bricaud/gremlin-server: A Docker container with a gremlin ...
A Docker container with a gremlin server. Contribute to bricaud/gremlin-server development by creating an account on GitHub.
M
ManabuBeach233d ago
Hi @billmanh Serializer choice is often the target graph implementation dependent. Please let us know which server you are going to connect to.
B
billmanh233d ago
Yeah, I'm creating a server (hosting), then I want to connect to it. I'm just looking for the right ioserializer that's current per my gremlin version.
S
spmallette232d ago
it's not really relevant to your question i suppose but Is there any reason you are using that docker container? we do have an official image that we maintain that you wouldn't have to update: https://tinkerpop.apache.org/docs/current/reference/#gremlin-server-docker-image if you prefer that one, it should just work without having to mess around with the serializers. docker
B
billmanh232d ago
I think my reasoning for not doing that was that I wouldn't be able to customize the security or configuration if it was a pre-baked image. I'll want to be able to edit the config process. Using the pre-baked container, can I build it with my own config file? However, I did try that container and got a new error RuntimeError: Event loop is closed when running that image. Any idea? The server gave out a longer error [WARN] c.c.m.CsvReporter - Error writing to org.apache.tinkerpop.gremlin.server.GremlinServer.user-agent.Python/3.8 aiohttp/3.7.4 java.io.IOException: No such file or directory @spmallette , is it possible to see the repo that generates that dockerfile? If I could see the buildfile and config then I might be able to answer my own question. I'll bet it's just written right there.
S
spmallette232d ago
GitHub
tinkerpop/gremlin-server/Dockerfile at master · apache/tinkerpop
Apache TinkerPop - a graph computing framework. Contribute to apache/tinkerpop development by creating an account on GitHub.
S
spmallette232d ago
in what context did you get that error? "event loop closed" sounds like a python error, so i guess you saw that on the client side trying to connect?
B
billmanh232d ago
Yeah, my validation is just running a script with the python line: graph = Graph() g = graph.traversal().withRemote(DriverRemoteConnection('ws://localhost:8182/gremlin','g')) print('Number of nodes {}, number of edges {}.'.format(g.V().count().next(),g.E().count().next()))
S
spmallette232d ago
i guess the server error isnt too relevant. just a metrics reporting issue. that said we shouldnt have that happening. we should fix that. @
B
billmanh232d ago
Looking at the dockerfile, I see that the config looks like a buildtime configuration. Can you tell me which config it runs to get the correct serializes? CONF_FILE=$1
S
spmallette232d ago
not sure why you test would fail offhand. perhaps its worth a test on our end
S
spmallette232d ago
i think it just runs the default config file if you dont specify one: https://github.com/apache/tinkerpop/blob/master/gremlin-server/conf/gremlin-server.yaml
GitHub
tinkerpop/gremlin-server/conf/gremlin-server.yaml at master · apach...
Apache TinkerPop - a graph computing framework. Contribute to apache/tinkerpop development by creating an account on GitHub.
S
spmallette231d ago
@colegreer @kennh couple of issues here regarding docker - (1) the csv metrics reporter probaly shouldn't throw that warning - i dont think it even needs to be configured for the docker image (2) a potential issue with python connecting in 3.7.0 - worth a quick check?
B
billmanh231d ago
Interestingly, was able to get the serializers settings from that, however still unable to connect. File "C:\Users\william.harding\anaconda3\envs\exoplanets\lib\site-packages\aiohttp\streams.py", line 604, in read await self._waiter aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x000001FD10DE6430> Sounds like a client issue, but is there an issue with how I'm connecting? aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected this is a windows/linux issue regarding handling async is that right?
S
spmallette231d ago
i've tested the official 3.7.0 Gremlin Server Docker image with the 3.7.0 gremlinpython package and i'm not finding any problems connecting:
>>> g = traversal().with_remote(DriverRemoteConnection('ws://localhost:8182/gremlin','g'))
>>> g.V().count().next()
0
>>> g.addV('person').property('name','bill').iterate()
[['addV', 'person'], ['property', 'name', 'bill'], ['none']]
>>> g.addV('person').property('name','bill').toList()
[v[2]]
>>> g.V().count().next()
2
>>> g.V().toList()
[v[0], v[2]]
>>> g = traversal().with_remote(DriverRemoteConnection('ws://localhost:8182/gremlin','g'))
>>> g.V().count().next()
0
>>> g.addV('person').property('name','bill').iterate()
[['addV', 'person'], ['property', 'name', 'bill'], ['none']]
>>> g.addV('person').property('name','bill').toList()
[v[2]]
>>> g.V().count().next()
2
>>> g.V().toList()
[v[0], v[2]]
that's with Python 3.8.10
B
billmanh231d ago
Is that on Windows? Yeah, I'm still getting the: ~\anaconda3\lib\site-packages\aiohttp\streams.py in read(self) 614 self._waiter = self._loop.create_future() 615 try: --> 616 await self._waiter 617 except (asyncio.CancelledError, asyncio.TimeoutError): 618 self._waiter = None ServerDisconnectedError: Server disconnected But that could be an issue with my cleint, not the server.
C
ColeGreer231d ago
@billmanh I'm not sure this is related to your issue here but I wanted to point out that in 3.7.0, the serializers were migrated from a gremlin.driver.ser package to gremlin.util.ser. Therefore the serializer in the config in your original question should be changed to org.apache.tinkerpop.gremlin.util.ser.GraphBinaryMessageSerializerV1
B
billmanh231d ago
Yup! That is exactly what I was origionally looking for. I was able to get that from looking at the docker buildfile, but thanks for confirming. I'm able to build now. Now if I can just get the client issue (which isn't my OG issue) @colegreer , if the server sends a "GraphBinaryMessageSerializerV1" and I'm using bytecode, then the differences between the platforms shouldn't matter, right? I should be able to conenct on a windows machine. Is there annother step that I'm missing? Perhaps the async loop thing?
C
ColeGreer231d ago
Platform differences shouldn't matter here. I'm wondering if that server metrics error is somehow related to the server disconnecting. I believe I can reproduce that metrics error to confirm this.
B
billmanh231d ago
Yes, I was able to do this as well:
No description
B
billmanh231d ago
Windows. So I'm unblocked. Thanks for your help. However, @spmallette If I wanted to modify the credentials of the pre-baked container, how would I do that? Don't you have to build it in order to place the secruity file?
S
spmallette230d ago
sorry - i forgot to come back to this after not knowing the answer immediately. @triggan do you happen to know how to do what's asked above?
B
billmanh230d ago
I suppose there might be some way to take the pre-baked container, source that in a new build file and copy your config files to it. That should work. I haven't started working on that thought. However, I think that's the pattern I'm going to try.
T
triggan230d ago
You can create your own Dockerfile that uses the TinkerPop-provided Gremlin Server image as a base and then customize it from there. Here's an example that I use to create a Gremlin Server container that behaves more like Neptune. I use RUN sed commands to modify the gremlin-server.yaml file.
FROM tinkerpop/gremlin-server:latest

# Add support for both websockets and http requests
RUN sed -i "s|^channelizer:.*|channelizer: org.apache.tinkerpop.gremlin.server.channel.WsAndHttpChannelizer|" ./conf/gremlin-server.yaml

# Allow for string based IDs
RUN sed -i "s|^gremlin.tinkergraph.vertexIdManager=.*|gremlin.tinkergraph.vertexIdManager=ANY|" ./conf/tinkergraph-empty.properties

# Remove ReferenceElementStrategy for use with graph-explorer - return all properties
RUN sed -i "s|^globals << \[g.*|globals << [g : traversal().withEmbedded(graph).withStrategies()]|" ./scripts/empty-sample.groovy

# Increase thread stack to 2m
ENV JAVA_OPTIONS="-Xss2m -Xms512m -Xmx4096m"
FROM tinkerpop/gremlin-server:latest

# Add support for both websockets and http requests
RUN sed -i "s|^channelizer:.*|channelizer: org.apache.tinkerpop.gremlin.server.channel.WsAndHttpChannelizer|" ./conf/gremlin-server.yaml

# Allow for string based IDs
RUN sed -i "s|^gremlin.tinkergraph.vertexIdManager=.*|gremlin.tinkergraph.vertexIdManager=ANY|" ./conf/tinkergraph-empty.properties

# Remove ReferenceElementStrategy for use with graph-explorer - return all properties
RUN sed -i "s|^globals << \[g.*|globals << [g : traversal().withEmbedded(graph).withStrategies()]|" ./scripts/empty-sample.groovy

# Increase thread stack to 2m
ENV JAVA_OPTIONS="-Xss2m -Xms512m -Xmx4096m"
B
billmanh229d ago
Hey thanks for that @triggan . Not my origional question but it's a solid bonus.
Want results from more Discord servers?
Add your server
More Posts
adding edges to multiple vertices at onceHey all. Working with tinkerpop on Cosmos Gremlin DB which is horrific. Wondering is there anyway aDoes .math() always return a Double?I have the following query, how can I get the result as a Long instead of a Double? In context, I wTrying to update a property value based on another propertyI have a query that looks something like the following g.V('9999').hasLabel('someLabel').propertiesCasting issue with Gremlin JavaI wrote the following query and I can't get it to compile, tried a ton of casting but it just isn't valueMap and MultivaluesI was going to use the recipe from @KelvinL 's book to return lists only when the property has multiAWS Neptune bulk load notificationsI wonder if anyone has knowledge of a way to receive a notification event(s) for bulk loading. RightVertexProgram filter graph before terminationI have a VertexProgram that operates on vertices of type A and B. B vertices are "below" A verticesStraightforward way to render a force directed graph svg/pngI was wondering if there is a "simple" way in java for me to take a GraphTraversal and render a forcCan't do explain() traversal step using Gremlin-Python ..Hi I just started messing around in gremlin-python this week, so likely to be doing something wrong Gremlin Query for amount of time and return all results?Is there a way to make gremlin keep running until time elapses then return the results? I have a queHow do I make a ssl connection using only ARN from neptune (AWS)I have a simple connection in my project using remotecon = DriverRemoteConnection(neptune_url) But Can gremlin-server be started via its Java packageI'm considering exposing the G.V() Playground graphs, which runs on TinkerGraph, to the network via Getting Property Out of a Variable in Python Gremlin QueryI've been working on attempting to find a performance way to route from point A to point B. Right nThe Cascading Coalescing - Create a V then Create an E in One ShotI have been struggling with this and perhaps I can ask some expert on how to approach this type of iToolsetHi all, Im in a bit of a dilemma. Want to start using a graphdb for a new application however ik stGremlin query has strange behavior with range() and limit()Hey everyone, I have a Neptune database and use gremlin to query it. I have user vertices that coulUser-Agent Metric Not Exposed in Gremlin Server - Need Help TroubleshootingHey everyone, I've been working with Gremlin and noticed that we can pass the User-Agent in requestsGremlin Syntax HighlighterI want to implement an Gremlin Synthax highlighter (displayed in HTML) via javascript/typescript. Honeo4j-gremlin plugin supportHi team, I'm currently using tinkerpop-server 3.6.4 docker image with the neo4j-gremlin plugin for Is it possible to apply `by` modulator to not last step?I have `TheCrew` graph. I'm trying to get 2 properties and unfold values only for second one, query