Gremlin Server "no gremlin script supplied".

1,354 views
Skip to first unread message

Collin Scangarella

unread,
Apr 28, 2016, 2:23:12 PM4/28/16
to Gremlin-users
Hey all - I'm having some difficulty with gremlin server. It was working fine on one machine but I recently spun up another and I can't seem to get it configured correctly on the new machine (I'm using ansible so the setup should be identical).

While the default example query works just fine:
[bash ~]$ curl "http://localhost:8182/?gremlin=100-1"
{"requestId":"9eb68183-cccc-4ef4-b1a6-c76297e43cd0","status":{"message":"","code":200,"attributes":{}},"result":{"data":[99],"meta":{}}}

I'm getting the same error for every query that refers to g:
[bash ~]$ curl "http://localhost:8182/?gremlin=g.V().has('uuid', 'test').count()"
{"message":"no gremlin script supplied"}

or graph:
[bash ~]$ curl "http://localhost:8182/?gremlin=graph.traversal().V().has('uuid', 'test').count()"
{"message":"no gremlin script supplied"}

My gremlin-server.yaml is pretty much stock, with the changes
channelizer: org.apache.tinkerpop.gremlin.server.channel.HttpChannelizer
graphs: {
  graph: conf/titan.properties}
plugins:
  - aurelius.titan
  - company.plugin

and here's my titan.properties
gremlin.graph=com.thinkaurelius.titan.core.TitanFactory
storage.backend=cassandra
storage.hostname=ips...
index.search.backend=elasticsearch
index.search.elasticsearch.interface=TRANSPORT_CLIENT
index.search.hostname=ip

company.plugin is a pretty simple plugin, it just brings in some imports, adds a couple bindings for graph and g, and creates some shortcut functions.

Any idea what I'm doing wrong here? I'm at a total loss because the setup was done identically for two different machines, only one of which works.

Collin

Stephen Mallette

unread,
Apr 28, 2016, 7:14:20 PM4/28/16
to Gremlin-users
Can't think of a single reason why this would happen to you.  If you truly have identical configuration between the servers, I can't really think of a reason why you would have this problem on one instance but not in the other.  The error message you are getting is indicative of the server not being able to parse out the "gremlin" query parameter, but it looks like your curl statements are in order offhand.  Normally people make a typo in those, but i'm thinking yours look legit. Did you try doing a POST as opposed to a GET. Not sure if that would make a difference but it's something else you could try.

--
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/485103ec-1811-4b8a-92df-64be129426da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Stephen Mallette

unread,
Apr 28, 2016, 7:15:59 PM4/28/16
to Gremlin-users
btw - i could help but notice the "company.plugin" in your config. Can you share anything about what that plugin does for you?

Collin Scangarella

unread,
Apr 29, 2016, 12:37:44 AM4/29/16
to Gremlin-users
Of course. 

Here's a snippet of the pluginTo method - it's nothing too fancy.

Set<String> imports = new HashSet<String>() {{
    add(IMPORT_SPACE + MyClass.class.getPackage().getName() + DOT_STAR);
    ...
}};
pluginAcceptor.addImports(imports);
Graph graph = TitanFactory.open("conf/titan.properties");
pluginAcceptor.addBinding("graph", graph);
pluginAcceptor.addBinding("g", graph.traversal());
try {
    pluginAcceptor.eval("user={string -> g.V().has('username', string)}");
    ...
} catch (ScriptException e) {
    throw new PluginInitializationException(e);
}


And yeah, I tried POST as well. Same issue; I'm totally scratching my head on this one.

Collin Scangarella

unread,
Apr 29, 2016, 11:11:42 AM4/29/16
to Gremlin-users
Oddly enough some queries related to g are working:


It obviously takes forever - so I interrupted before seeing the response.

Stephen Mallette

unread,
Apr 29, 2016, 11:14:41 AM4/29/16
to Gremlin-users
Can you show examples that work with "g" and some that don't? and you can confirm that all of the ones that fail, work properly on one gremlin server setup but not the other?


Collin Scangarella

unread,
Apr 29, 2016, 11:27:13 AM4/29/16
to Gremlin-users
Yeah - It looks like anything with quotes is failing.

I was able to duplicate the issue on a new server which is running cassandra locally and popped a small amount of dummy data in it.

{valid response}
[bash ~]$ curl "http://localhost:8182/?gremlin=g.V().valueMap()"
{valid response}
[bash ~]$ curl "http://localhost:8182/?gremlin=g.V().out().count()"
{valid response}
[bash ~]$ curl "http://localhost:8182/?gremlin=g.V().has('uuid', 'test').out().count()"

{"message":"no gremlin script supplied"}

Collin Scangarella

unread,
Apr 29, 2016, 11:38:32 AM4/29/16
to Gremlin-users
I just downloaded a fresh version of titan and only changed the following in gremlin-server.yaml:

channelizer: org.apache.tinkerpop.gremlin.server.channel.HttpChannelizer
graphs: {
  graph: conf/titan.properties}

with a titan.properties:

gremlin.graph=com.thinkaurelius.titan.core.TitanFactory
storage.backend=cassandra
storage.hostname=localhost
schema.default=none

and I'm still getting the same "no gremlin script supplied" for any traversals using quotes. 

Jason Plurad

unread,
Apr 29, 2016, 12:10:03 PM4/29/16
to Gremlin-users
What does curl -v "http://localhost:8182/?gremlin=g.V().has('uuid', 'test').out().count() show?

Just a hunch, you might need to set the Accept and Content-Type headers on the request.

-- Jason

Collin Scangarella

unread,
Apr 29, 2016, 12:50:41 PM4/29/16
to Gremlin-users
Sure Jason. It returns this:

*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8182 (#0)
> GET /?gremlin=g.V().has('uuid', 'test').out().count() HTTP/1.1
> Host: localhost:8182
> User-Agent: curl/7.43.0
> Accept: */*
>
< HTTP/1.1 400 Bad Request
< Content-Type: application/json
* no chunk, no close, no size. Assume close to signal end
<
* Closing connection 0
{"message":"no gremlin script supplied"}

I'm also using python's goblin as an OGM; it is running into the same issue. I don't think it's a problem with the way that I'm making the requests.

Collin Scangarella

unread,
Apr 29, 2016, 3:27:30 PM4/29/16
to Gremlin-users
I went into HttpGremlinEndpointHandler::channelRead to do some remote debugging and found something odd - 

It looks like the message that this method is receiving is malformed, here's the toString'ed msg parameter:

HttpObjectAggregator$AggregatedFullHttpRequest(decodeResult: failure(java.lang.IllegalArgumentException: invalid version format: 'TEST') HTTP/1.1), version: HTTP/1.0, content: EmptyByteBufBE)
GET /bad-request HTTP/1.0

How is this method being called? I couldn't seem to find any method usages and I'm not very familiar with netty.

Stephen Mallette

unread,
Apr 29, 2016, 3:46:16 PM4/29/16
to Gremlin-users
fwiw i just tried this locally on a vanilla gremlin server and it worked fine:

{"requestId":"ef28e7f9-aae3-40c3-909d-fac7a1e592da","status":{"message":"","code":200,"attributes":{}},"result":{"data":[{"id":1,"label":"person","type":"vertex","properties":{"name":[{"id":0,"value":"marko"}],"age":[{"id":2,"value":29}]}}],"meta":{}}}

{"requestId":"1e3fae63-8828-4f21-8f91-6947ce65a1f4","status":{"message":"","code":200,"attributes":{}},"result":{"data":[{"id":1,"label":"person","type":"vertex","properties":{"name":[{"id":0,"value":"marko"}],"age":[{"id":2,"value":29}]}}],"meta":{}}}

I really can't think of where this is going wrong for you.....


Jason Plurad

unread,
Apr 29, 2016, 6:17:26 PM4/29/16
to Gremlin-users
The problem is that there's a space in there between "uuid" and "test". That's causing your GET request url get messed up.

Going with POST is a more forgiving choice.

-- Jason
Reply all
Reply to author
Forward
0 new messages