2

I am getting the valid response while made curl request :

bin/gremlin-server.bat conf/gremlin-server-rest-modern.yaml

curl "http://localhost:8182?gremlin=100-1"
curl "http://localhost:8182?gremlin=g.V()"

But via browser I am getting the below massage :

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

Also tried as below but no result:

http://localhost:8182/gremlin?script=g.V()
http://localhost:8182/graphs/tinkergraph/tp/gremlin?script=g.traversal().V()
http://localhost:8182/graphs/tinkergraph/tp/gremlin?script=g.V()

Any suggestion on what is the valid way of passing script via browser.

Stacey Morgan
  • 202
  • 1
  • 7

4 Answers4

2

I'm not sure this is a "bug" exactly, but Gremlin Server didn't respect very complex ACCEPT headers. For example, when I try to resolve one of your first two URLs in Chrome, I get:

{
  message: "no serializer for requested Accept header: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
}

By default, Gremlin Server doesn't support that ACCEPT. If the browser had requested application/json or simply *.* it would work. Note that *.* is present with quality 0.8, but Gremlin Server wasn't parsing the header that way to determine that. As a result, it couldn't find the serializer to properly deal with that.

There is no workaround for the browser that I know of. I've created an issue to get this fixed:

https://issues.apache.org/jira/browse/TINKERPOP3-752

stephen mallette
  • 45,298
  • 5
  • 67
  • 135
1

I've also seen this error when I have forgotten to start cassandra before starting gremlin-server.

ninjax
  • 9
  • 2
1

My problem was due to the presence of spaces in the request.

This worked;

curl http://localhost:8182/?gremlin="g.V().has('name','foody')"

but this didn't;

curl http://localhost:8182/?gremlin="g.V().has('name', 'foody')"

Try removing them from yours and they should work.

Brian F
  • 1,620
  • 1
  • 19
  • 23
0

I found the answer thanks to your question, so I will pitch for the right answer for @stacey-morgan: You queried on the CLI:

curl "http://localhost:8182?gremlin=100-1"

Then you may have queried (as it is not clear from your question)

http://localhost:8182/gremlin?script=100-1

Or the others you have done, just as I was doing:

http://localhost:8182/gremlin?script=g.V()

You would get the error message. The correct way of doing it just paste the content of the "" from the curl command. So

http://localhost:8182?gremlin=100-1

Then similarly for your other queries:

http://localhost:8182/?gremlin=g.V()
http://localhost:8182/?gremlin=g.traversal().V()

Note: trailing slash should be there though it works without it on my FF. That is HTTP.

Using: Ubuntu & Titan1.0.0-hadoop1.

Community
  • 1
  • 1
Hiwa
  • 587
  • 6
  • 21