How do I enable dynamic graphs while using the latest docker image `janusgraph/janusgraph:latest`?
With the following configuration settings and using the default
g
alias I can work with gremlin/JanusGraph no problem:
I've tried a variety of different configurations (from what I saw on docs, github, with prefixes like janusgraph.
gremlin.
, gremlinserver.
) for around 4 hours and I haven't once been able to avoid this exception when using an alias that is not g
.
gremlinpy.exception.GremlinServerError: 499: The traversal source [project_ee46f177ab874d539dab0fb87311ef4f] for alias [g] is not configured on the server.
How do I add support for dynamic graphs in a docker-compose file with these settings?49 Replies
Seems to actually be a bug: https://github.com/JanusGraph/janusgraph/issues/1322
GitHub
add a key named "ConfigurationManagementGraph" to the "graphs" prop...
Please help to have a look, thanks! I've configured ConfigurationManagementGraph!But it still reported an error。 config: my code is: ` @test public void graphConfigurationShouldBeWhatWeExpectWh...
Lol, I'm pretty sure I've iterated through nearly every possible configuration combination
The issue you're describing in the linked issue sounds to me like a problem of configuring the Docker image, not one of ConfigurationManagementGraph.
Can you as a first step please verify that JanusGraph is actually using the YAML config file you mounted in?
You can do that by starting the image with the arguments
janusgraph show-config
as described here: https://github.com/JanusGraph/janusgraph-docker#generate-configGitHub
GitHub - JanusGraph/janusgraph-docker: JanusGraph Docker images
JanusGraph Docker images. Contribute to JanusGraph/janusgraph-docker development by creating an account on GitHub.
In general, it is definitely possible to use ConfigurationManagementGraph to dynamically create graphs and that can also be done with the Docker image. We're doing that at my company.
So, if you're just getting started with JanusGraph, don't feel discouraged 🙂
I noticed that you're commenting in different old issues with your problems. Please don't do that as it makes it difficult to keep track of the original issue if we're starting to discuss the specifics of your problem in the same issue
Sorry about commenting in multiple issues, I saw so many and didnt want to neccesarily create one but maybe that wouldve been best. https://groups.google.com/g/janusgraph-users/c/1sR33Ez60MM
I see stuff like this and it looks like its possible and Ive since moved on from the question titled here where I can seemingly create graphs but accessing the traversal isnt possible. More details were mentioned here: https://github.com/JanusGraph/janusgraph/issues/883
GitHub
Bind dynamically created graphs to the gremlin executor's global bi...
Full discussion of why this is important and a general plan of attack can be found in this TinkerPop issue, and it turns out we can host the solution purely at the JanusGraph level without directly...
In the linked issue, you posted a stack trace which shows that you're trying to access the traversal source
project_f2aff4ebab684dd0a49afba88d3fcf7d
. I assume you have created a graph with the name project_f2aff4ebab684dd0a49afba88d3fcf7d
, right?
In that case, the traversal source should be named project_f2aff4ebab684dd0a49afba88d3fcf7d_traversal
as described here: https://docs.janusgraph.org/operations/dynamic-graphs/#dynamic-graph-and-traversal-bindings
The form is always: <graph.graphname>_traversal
I tried with _traversal as well and that fails. Let me get the logs. And yes I see the create call in scylla from gremlin/janus or whatever
Graphs are created with this snippet
When I POST/create the graph I see scylla and janus logs:
OK, you need to distinguish between a graph and a graph traversal source.
ConfiguredGraphFactory
creates and configures graphs, but your application executes traversals on a graph traversal source.
This means that _traversal
is not necesary when interacting with the ConfiguredGraphFactory
. So, please try ConfiguredGraphFactory.open('<graph.graphname>
) without the _traversal
part
If that doesn't work, then please check that the graph was actually created by executing ConfiguredGraphFactory.getGraphNames()
which gives you a list of all created graphs. This should include the graph you're trying to openI updated the call to
ConfiguredGraphFactory.open('project_{project_uuid}');[]
and still running into issues
Currently trying to run ConfiguredGraphFactory.getGraphNames()
but I get a ResultSet in python which I cant do much with. Just need to figure out how to connect bin/gremlin.sh
correctly as that throws org.janusgraph.graphdb.management.utils.ConfigurationManagementGraphNotEnabledException: Please add a key named "ConfigurationManagementGraph" to the "graphs" property in your YAML file and restart the server to be able to use the functionality of the ConfigurationManagementGraph class.
despite the property existingWhen are you getting that exception?
ConfiguredGraphFactory.open('project_{project_uuid}');[]
The []
means that you don't want to get anything back which doesn't make much sense if you actually want to get the graph names
I would really execute this from the Gremlin Console instead of from Python as Python brings in even more complexity to this. So, let's try to debug first why the Gremlin Console isn't working for youI get that exception from jumping into the container, opening
bin/gremlin.sh
, and running ConfiguredGraphFactory.getGraphNames()
But you don't see the exception when starting the server?
Theres no seemingly no serializer that works for that hence the
;[]
no, not from pythonPlease execute
janusgraph show-config
when starting the server as this looks like the server config is wrong
I mean in the logs of the server directlyok, Ive also mounted the configs manually btw
and properties
which might appear wrong but if you notice I reference
janusgraph-dynamic.properties
in the server config and that looks like:
Are you also using the graph named
graph
which is not using the ConfiguredGraphFactory
? Because if not, then you could try removing that from the YAML to reduce some complexityNo that can be removed
so that top snippet now looks like:
And you could try whether
/etc/opt/janusgraph/janusgraph-dynamic.properties
was successfully mounted by executing cat /etc/opt/janusgraph/janusgraph-dynamic.properties
in the running docker containerIts mounted, I tried that before but ill test again, one moment
(I don't see any obvious problem with your config so I'm trying to rule out some things that could go wrong here)
Yeah its mounted and it matches what I want
Oh, you could also rename
graph.graphname
in /etc/opt/janusgraph/janusgraph-dynamic.properties
to ConfigurationManagementGraph
instead of project
. I'm not sure whether that actually needs to be exactly this name :/Tried that earlier too but I will try again :P
hmm, I see. I'm starting to get out of ideas here I'm afraid. If nothing helps, I always go back to the most basic setup possible, try to get that to work and then change the setup step by step to what I actually want to see where it starts failing.
So, I would actually download the zip archive, extract that and then start JanusGraph Server with a built-in config file. Afterwards, maybe try moving it to ConfiguredGraphFactory by abiding to what is described in the docs and see whether you get it working. I would do all of that without Docker and only introduce Docker if you get it working on bare metal
Trying to run
ConfiguredGraphFactory.getGraphNames()
after removing volumes and restarting my container with graph.graphname=ConfigurationManagementGraph
results in the same issue org.janusgraph.graphdb.management.utils.ConfigurationManagementGraphNotEnabledException
. Ive actually already cloned the Janus repo and have built the zip archive so I guess I could just try running that without docker yeah
Should I file an issue if it doesn't work with the most basic config on bare metal? :PAnother thing to keep in mind when trying to reproduce this / debugging it: Always delete all data stored by JanusGraph in its backends as it stores its config there. So changing the config might be ignored otherwise
Yeah Ive been doing that as well, confused me at first thought before I realized that needed to be done lol
Yes sure, if you have a minimal setup that is basically just the distribution from JanusGraph with config from the docs and that isn't working, then you can submit an issue
👋🏻 Hey! Catching up with that issue. Isn't there any other error in JanusGraph server logs?
Trying to run ConfiguredGraphFactory.getGraphNames() after removing volumes and restarting my container with graph.graphname=ConfigurationManagementGraph results in the same issueOh, is the issue happening on remote connection? Does the server start fine?
Server appears to start fine and I dont notice anything alarming from the DEBUG logs, I just woke up today and Ill be trying to set up Janus on bare metal soon but so far everything Ive tried has been from inside a docker container running on an updated Debian 11 system. Most things attempted have been through a gremlin python client and that appears to be able to create graphs dynamically however Im not able to access the traversal because it doesnt want to bind to somewhere I can access it. The issue you quoted of
ConfiguredGraphFactory.getGraphNames()
this command seems to work fine when running through the python client but theres no way to actually view the returned output as its a ResultSet
object from gremlin python that doesn't implement a lot of useful methods. When I jump into the server through docker compose exec janus bash
and then run bin/gremlin.sh
and proceed to run ConfiguredGraphFactory.getGraphNames()
then I run into the error of org.janusgraph.graphdb.management.utils.ConfigurationManagementGraphNotEnabledException
Heres the output from the startup logs in docker. You'll notice
14:33:34 safelyRenameFile [ERRO] Failed copying from /tmp/temp591981868 to /etc/opt/janusgraph/janusgraph-server.yaml
but I don't believe thats related to the issue and I mounted them read only as a sanity check because I no longer trust anything interacting with my config due to the other errors I was running intoTried running on bare metal and
org.janusgraph.graphdb.management.utils.ConfigurationManagementGraphNotEnabledException
still occurs when running:
I will push a repo where this can be reproduced on a Debian 11 system in a few minutes. Here are the error logs from running locally (NOT running in docker except for the elasticsearch and ScyllaDB container):Repo can be found here: https://github.com/jerlendds/janus-dynamicgraphs-bug
GitHub
GitHub - jerlendds/janus-dynamicgraphs-bug: Dynamic Graphs in Janus...
Dynamic Graphs in JanusGraph do not work when following the docs. This bug occurs on both docker and bare metal - GitHub - jerlendds/janus-dynamicgraphs-bug: Dynamic Graphs in JanusGraph do not wor...
I've been trying to hook up the project to the vscode debugger but I keep running into issues. How do you guys debug this project?
edit: got it working! turns out it was vscode being weird
Thanks. Can you confirm those errors are not an issue?
They should not be an issue. Ive run this on bare metal as well and the same error of
org.janusgraph.graphdb.management.utils.ConfigurationManagementGraphNotEnabledException
occurs
This repo reproduces the bug if you're running on a debian 11 system: https://github.com/jerlendds/janus-dynamicgraphs-bug. What systems are you able to get this functionality working on?I've tried your script locally (thanks for that!).
One think I noted is that your README file is missing one step:
- A local JanusGraph server is started
- A local gremlin console is started but is not connected to the server
When opening the gremlin console, here is what I did
Ok, thats good to know. I was missing that, thank you. so I presume my python client in docker connects correctly then as I see the ScyllaDB record created but Im unable to access the traversal in that environment later on (e.g. after waiting 20s) which seems strange
We're still not at a point where we could open a graph traversal and use it to make requests.
This command
only creates a "template configuration".
Yes I know you need to run ConfiguredGraphFactory.create or
.open
after setting up a config depending on how you do itYes. After this is done, I think gremlin python could be used.
Just like gremlin console, it will forward commands to the JanusGraph server, so if the traversal can be used in the gremlin console, it's likely to work from gremlin python as well.
I will try again, maybe I missed something earlier, but im fairly certain this doesn't work at least with the python client on my system for some reason
Just to be safe, I'd suggest using
ConfiguredGraphFactory.createConfiguration
instead of ConfiguredGraphFactory.createTemplateConfiguration
, at least until you get it working.Yeah Im giving up for now. Fairly certain Im doing everything correctly but Ill look into it a bit more when I have time later