Skip to content
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

Document version limitations #6

Closed
freeeve opened this issue Nov 20, 2012 · 10 comments
Closed

Document version limitations #6

freeeve opened this issue Nov 20, 2012 · 10 comments

Comments

@freeeve
Copy link
Member

freeeve commented Nov 20, 2012

as in... versions of neo4j

@stephanf
Copy link

Within a scala play app I had:

val req = Cypher("start n=node(*) return n.name")

which would return ca. 10.000 nodes, calling

val stream = req()

caused:
play.core.ActionInvoker$$anonfun$receive$1$$anon$1: Execution exception [[RuntimeException: error:dispatch.StatusCode: Unexpected response status: 400]]
at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:134) [play_2.9.1.jar:2.0.4]
at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:115) [play_2.9.1.jar:2.0.4]
at akka.actor.Actor$class.apply(Actor.scala:318) [akka-actor.jar:2.0.2]
at play.core.ActionInvoker.apply(Invoker.scala:113) [play_2.9.1.jar:2.0.4]
at akka.actor.ActorCell.invoke(ActorCell.scala:626) [akka-actor.jar:2.0.2]
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:197) [akka-actor.jar:2.0.2]
Caused by: java.lang.RuntimeException: error:dispatch.StatusCode: Unexpected response status: 400
at org.anormcypher.Neo4jREST$.sendQuery(Neo4jREST.scala:26) ~[classes/:na]
at org.anormcypher.CypherStatement.apply(AnormCypher.scala:313) ~[classes/:na]
at controllers.Application$$anonfun$index$1.apply(Application.scala:19) ~[classes/:na]
at controllers.Application$$anonfun$index$1.apply(Application.scala:9) ~[classes/:na]
at play.api.mvc.Action$$anonfun$apply$4.apply(Action.scala:204) ~[play_2.9.1.jar:2.0.4]
at play.api.mvc.Action$$anonfun$apply$4.apply(Action.scala:204) ~[play_2.9.1.jar:2.0.4]

Just getting a single node worked like a charm.

@freeeve
Copy link
Member Author

freeeve commented Dec 19, 2012

Thanks Stephan, I'm planning to revamp the error handling so you can actually see what the response from the service is, instead of just 400. Can you run your query with curl? I think the server is actually choking on it.

On Dec 19, 2012, at 4:30 AM, Stephan Froede notifications@github.com wrote:

Within a scala play app I had:

val req = Cypher("start n=node(*) return n.name")

which would return ca. 10.000 nodes, calling

val stream = req()

caused:
play.core.ActionInvoker$$anonfun$receive$1$$anon$1: Execution exception [[RuntimeException: error:dispatch.StatusCode: Unexpected response status: 400]]
at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:134) [play_2.9.1.jar:2.0.4]
at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:115) [play_2.9.1.jar:2.0.4]
at akka.actor.Actor$class.apply(Actor.scala:318) [akka-actor.jar:2.0.2]
at play.core.ActionInvoker.apply(Invoker.scala:113) [play_2.9.1.jar:2.0.4]
at akka.actor.ActorCell.invoke(ActorCell.scala:626) [akka-actor.jar:2.0.2]
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:197) [akka-actor.jar:2.0.2]
Caused by: java.lang.RuntimeException: error:dispatch.StatusCode: Unexpected response status: 400
at org.anormcypher.Neo4jREST$.sendQuery(Neo4jREST.scala:26) ~[classes/:na]
at org.anormcypher.CypherStatement.apply(AnormCypher.scala:313) ~[classes/:na]
at controllers.Application$$anonfun$index$1.apply(Application.scala:19) ~[classes/:na]
at controllers.Application$$anonfun$index$1.apply(Application.scala:9) ~[classes/:na]
at play.api.mvc.Action$$anonfun$apply$4.apply(Action.scala:204) ~[play_2.9.1.jar:2.0.4]
at play.api.mvc.Action$$anonfun$apply$4.apply(Action.scala:204) ~[play_2.9.1.jar:2.0.4]

Just getting a single node worked like a charm.


Reply to this email directly or view it on GitHub.

@stephanf
Copy link

Hi Wes,

curl?I have no clue how to use cypher queries from curl.

However, the cypher query is working from the data browser and a more complex version of it:

start f=node:user_profiles(name="Group")
match f-[user_weight:car_item]->car_item-[car_weight:describes_car]->car
where
(
(car_item.mappingtype="Absolut" and user_weight.weight=car_weight.weight)
OR
(car_item.mappingtype="Norm" and abs(user_weight.weight-car_weight.weight)<=1)
)
with car, count(car_item) as matches, sum(abs(user_weight.weight-car_weight.weight)) as delta
where matches>3 and delta>0 and delta<3
with car, matches, delta
order by delta, car.preis_eur asc
limit 55
return car.name, car.preis_eur, delta, matches

// response <500 ms in average

I filled Neo4J with the batch-importer

I also ran into problems trying to use ExecutionEngine with Java, I have some doubts regarding the REST API it behaves not as expected with cypher queries.

I will try an embedded approach.

Regards,
Stephan

@freeeve
Copy link
Member Author

freeeve commented Dec 19, 2012

Are you using 1.9?

@stephanf
Copy link

Yep.

Is that causing this problems!?

@freeeve
Copy link
Member Author

freeeve commented Dec 19, 2012

No, but your query wouldn't even run in 1.8.x--which could have been causing the 400 error (that's why I asked). I think it's actually a timeout issue when the data is pretty big. There was some discussion on the google group about a similar error with the PHP REST driver.

@stephanf
Copy link

Hmm, the data from the request are not so big just 55 rows with 4 columns, my impression was that the query itself is causing the problem not the data delivered.

As I tried REST with Java, I had heap space problems (with 220 cells), the problem occured somewhere in REST Api, it looked like a loop that went out of control (it crashed always with an array operation).

Since AnormCypher is more or less using the same underlying REST Apis, I think it could be the same problem (that is only guessing by intuition).

@freeeve
Copy link
Member Author

freeeve commented Dec 19, 2012

I need to make the 400 error give the body of the response through AnormCypher's exception, because it will usually tell you exactly where it doesn't like your query. I have an open issue for that (when I was using it myself recently, that was my main pain point)--I'll try to fix it this weekend.

@freeeve
Copy link
Member Author

freeeve commented Dec 19, 2012

To test your query in CURL you can just run (replace your query--you might want to use single quotes instead of double, to avoid needing to escape them:

curl -X POST -H Accept:application/json -H Content-Type:application/json -v http://localhost:7474/db/data/cypher -d '{"query":"start n=node(*) return n;", "params":{}}'

@stephanf
Copy link

The Curl statement worked, it needed under 1 sec to print all 9378 nodes in the terminal.

It would surly help a lot if AnormCypher would give more details, I tried it myself but I was not able to get more informations.

I am using Neo4J as an embedded db (in play!) at the moment (as I was not able to connect via REST), but it looks very pragmatic resp. ugly, using REST would probably allow for a much more scalable and flexible architecture - and more elegant as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants