-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Graph traversal object "g" initialization #21
Comments
This could be related to your setup. Would you mind sharing the gremlin server .yaml config file you're using? |
|
@spmallette I modified my empty-sample.groovy to match the one you provided and restarted with bin/titan.sh start, however gremlin still did not recognize "g". My gremlin-server.yaml (from a fresh build completed just 5 minutes ago) is:
|
Can you run |
0 [main] INFO org.apache.tinkerpop.gremlin.server.GremlinServer - 254 [main] INFO org.apache.tinkerpop.gremlin.server.GremlinServer - Configuring Gremlin Server from conf/gremlin-server/gremlin-server.yaml |
This is confusing because the original issue referred to Cassandra and Elasticsearch but this output indicates BerkeleyDB. Anyway,
I guess you ran this directly as @PommeVerte asked you to in which case i guess this would have started with berkeleydb as the default. when you start it this way is |
That's very odd, because the titan.sh script indicates that it is forking Cassandra and Elasticsearch on start, and I can see both of their TCP ports open as well (7000 and 9300 are both bound to java processes under netstat). Running both gremlin.sh as well as the example script from the gremlin-javascript README fail to access g. Gremlin reports a "no such property" error, and the example script only logs "All results fetched", sans data. Since the graph is loaded with the Graph of the Gods example graph, it should have returned something else instead of just ending the query. Additionally, I fixed the titan-berkelyje-server.properties reference and changed it to titan-cassandra-es.properties, which is what I have been using to create the "graph" object in gremlin. While gremlin again fails to recognize g, the example script threw this error: events.js:141 Error: Error: No such property: g for class: Script2 (Error 597) |
If memory serves me well the
It might've been added since I last checked but no harm in making sure it's there. You also say that it should load with the graph of the gods but how is this loaded? Maybe you can share that piece of info so we can rule out any issues on that end. This is a shot in the dark as usually the errors are different when this happens, but on the off chance. Can you check to see if you don't have two instances of titan running? This happens when you do At this point it might also be relevant for you to share your OS, java version and any other info that may be relevant in trying to reproduce this. |
Well - it's not too odd because you have this entry in your gremlin-server.yaml file:
which seems to be what's in the pre-packaged file as the default: So - you are using berkeleydb (despite the fact that cassandra/es are running with the script. That stinks. I'll fix that for next release.
that was the right thing to change. |
I just updated Titan as follows: using that config, my
@jpsamaroo can you please try to connect with the Gremlin Console in the fashion that I did above and validate that you achieve similar results? |
I added the script that @PommeVerte advised, and it did not do anything, nor did the :remote command that @spmallette offered. Also, I confirmed that after termination, no other processes were holding open port 8182. However, after running bin/titan.sh -v start, I noticed an error on gremlin-server initialization indicating that "conf/gremlin-server/titan-cassandra-es.properties" could not be found. This is interesting because titan-cassandra-es.properties is located normally in /conf, not in /conf/gremlin-server. So I stopped Titan, moved the file to where it expected, and bang, it started without error. From there on, I used the :remote command from @spmallette and was able to access the traversal object "g" with ":> g". I'm not sure where that error is coming from, but it was clearly during startup with bin/titan.sh start. |
That's probably because you have it set to |
So given that you can connect with |
@PommeVerte that is probably the case, however it confuses me as to why that is the case, because this build is fresh from the git repo. I imagine that needs to get fixed on the repo itself, because I made no such modifications to that file on my end. @spmallette good point, I ran the example script and it did just fine. I received about 12 vertices that I had loaded previously, and then an "All results fetched". Because this now seems to be resolved from the viewpoint of gremlin-javascript, I am going to close this issue. |
When using the client under node.js in session mode over the internet (forwarded through NAT), the gremlin client will not return stream results without creating the "g" graph traversal object before other queries. Specifically, for a cassandra and elasticsearch setup, I had to run:
client.stream('graph = TitanFactory.open('conf/titan-cassandra-es.properties');g = graph.traversal()');
After doing so, I was able to run queries as normal. It may just be my specific setup, however it seems logical that the server would have no idea what "g" is without it being defined beforehand. If this is indeed a bug, I would recommend adding the above query before all other queries are run.
The text was updated successfully, but these errors were encountered: