Skip to content

Instantly share code, notes, and snippets.

@maggit
Last active August 29, 2015 14:03
Show Gist options
  • Save maggit/28d190488616477a960e to your computer and use it in GitHub Desktop.
Save maggit/28d190488616477a960e to your computer and use it in GitHub Desktop.
#Fresh instalation on Ubuntu Neo 2.1.2
commands = [[:create_node, {:name=>"bob"}]]
neo = Neography::Rest.new
batch_results = neo.batch *commands #returns Neography::NeographyError: Neography::NeographyError
#Gemfile
#remote: git://github.com/maxdemarzi/neography.git
#revision: f1306a6f6c9d1eddc2ffe71156d13e53cc9b044e
#specs:
#neography (1.5.2)
#excon (>= 0.33.0)
#json (>= 1.7.7)
#multi_json (>= 1.3.2)
#os (>= 0.9.6)
2014-07-14 17:25:22.540+0000 WARN [o.n.s.r.w.StreamingBatchOperations]:
java.lang.NullPointerException: null
at org.eclipse.jetty.server.Request.getHttpChannelState(Request.java:407) ~[jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:98) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.neo4j.server.web.Jetty9WebServer.invokeDirectly(Jetty9WebServer.java:339) ~[neo4j-server-2.1.2.jar:2.1.2]
at org.neo4j.server.rest.web.StreamingBatchOperations.invoke(StreamingBatchOperations.java:69) [neo4j-server-2.1.2.jar:2.1.2]
at org.neo4j.server.rest.batch.BatchOperations.performRequest(BatchOperations.java:201) [neo4j-server-2.1.2.jar:2.1.2]
at org.neo4j.server.rest.batch.BatchOperations.parseAndPerform(BatchOperations.java:171) [neo4j-server-2.1.2.jar:2.1.2]
at org.neo4j.server.rest.web.StreamingBatchOperations.readAndExecuteOperations(StreamingBatchOperations.java:57) [neo4j-server-2.1.2.jar:2.1.2]
at org.neo4j.server.rest.web.BatchOperationService$1.write(BatchOperationService.java:98) [neo4j-server-2.1.2.jar:2.1.2]
at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:71) [jersey-core-1.9.jar:1.9]
at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:57) [jersey-core-1.9.jar:1.9]
at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:306) [jersey-server-1.9.jar:1.9]
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1437) [jersey-server-1.9.jar:1.9]
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349) [jersey-server-1.9.jar:1.9]
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339) [jersey-server-1.9.jar:1.9]
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416) [jersey-server-1.9.jar:1.9]
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537) [jersey-server-1.9.jar:1.9]
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699) [jersey-server-1.9.jar:1.9]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) [javax.servlet-3.0.0.v201112011016.jar:na]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:698) [jetty-servlet-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1506) [jetty-servlet-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.neo4j.server.extension.auth.AuthenticationFilter.doFilter(AuthenticationFilter.java:57) [authentication-extension-2.0.2-1.0-SNAPSHOT.jar:2.0.2-1.0-SNAPSHOT]
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1477) [jetty-servlet-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:503) [jetty-servlet-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:211) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1096) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:432) [jetty-servlet-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:175) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1030) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:92) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.Server.handle(Server.java:445) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:268) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:229) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.run(AbstractConnection.java:358) [jetty-io-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:601) [jetty-util-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:532) [jetty-util-9.0.5.v20130815.jar:9.0.5.v20130815]
at java.lang.Thread.run(Thread.java:744) [na:1.7.0_55]
2014-07-14 17:25:22.541+0000 WARN [o.n.s.r.w.BatchOperationService]: Error executing batch request
org.neo4j.server.rest.domain.BatchOperationFailedException: null
at org.neo4j.server.rest.web.StreamingBatchOperations.invoke(StreamingBatchOperations.java:73) ~[neo4j-server-2.1.2.jar:2.1.2]
at org.neo4j.server.rest.batch.BatchOperations.performRequest(BatchOperations.java:201) ~[neo4j-server-2.1.2.jar:2.1.2]
at org.neo4j.server.rest.batch.BatchOperations.parseAndPerform(BatchOperations.java:171) ~[neo4j-server-2.1.2.jar:2.1.2]
at org.neo4j.server.rest.web.StreamingBatchOperations.readAndExecuteOperations(StreamingBatchOperations.java:57) ~[neo4j-server-2.1.2.jar:2.1.2]
at org.neo4j.server.rest.web.BatchOperationService$1.write(BatchOperationService.java:98) ~[neo4j-server-2.1.2.jar:2.1.2]
at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:71) [jersey-core-1.9.jar:1.9]
at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:57) [jersey-core-1.9.jar:1.9]
at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:306) [jersey-server-1.9.jar:1.9]
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1437) [jersey-server-1.9.jar:1.9]
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349) [jersey-server-1.9.jar:1.9]
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339) [jersey-server-1.9.jar:1.9]
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416) [jersey-server-1.9.jar:1.9]
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537) [jersey-server-1.9.jar:1.9]
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699) [jersey-server-1.9.jar:1.9]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) [javax.servlet-3.0.0.v201112011016.jar:na]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:698) [jetty-servlet-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1506) [jetty-servlet-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.neo4j.server.extension.auth.AuthenticationFilter.doFilter(AuthenticationFilter.java:57) [authentication-extension-2.0.2-1.0-SNAPSHOT.jar:2.0.2-1.0-SNAPSHOT]
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1477) [jetty-servlet-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:503) [jetty-servlet-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:211) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1096) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:432) [jetty-servlet-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:175) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1030) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:92) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.Server.handle(Server.java:445) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:268) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:229) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.run(AbstractConnection.java:358) [jetty-io-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:601) [jetty-util-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:532) [jetty-util-9.0.5.v20130815.jar:9.0.5.v20130815]
at java.lang.Thread.run(Thread.java:744) [na:1.7.0_55]
Caused by: java.lang.NullPointerException: null
at org.eclipse.jetty.server.Request.getHttpChannelState(Request.java:407) ~[jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:98) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.neo4j.server.web.Jetty9WebServer.invokeDirectly(Jetty9WebServer.java:339) ~[neo4j-server-2.1.2.jar:2.1.2]
at org.neo4j.server.rest.web.StreamingBatchOperations.invoke(StreamingBatchOperations.java:69) ~[neo4j-server-2.1.2.jar:2.1.2]
... 36 common frames omitted
E, [2014-07-14T17:25:22.546088 #2637] ERROR -- : {:body=>"", :headers=>{"Content-Type"=>"application/json; charset=UTF-8", "Access-Control-Allow-Origin"=>"*", "Connection"=>"close", "Server"=>"Jetty(9.0.5.v20130815)"}, :status=>200, :remote_ip=>"serverip", :local_port=>55984, :local_address=>"serverip"} error: [{"id"=>0, "from"=>"/node", "body"=>{"extensions"=>{}, "outgoing_relationships"=>"http://serverip:7474/db/data/node/7/relationships/out", "labels"=>"http://serverip:7474/db/data/node/7/labels", "all_typed_relationships"=>"http://serverip:7474/db/data/node/7/relationships/all/{-list|&|types}", "traverse"=>"http://serverip:7474/db/data/node/7/traverse/{returnType}", "self"=>"http://serverip/db/data/node/7", "property"=>"http://serverip:7474/db/data/node/7/properties/{key}", "properties"=>"http://server:7474/db/data/node/7/properties", "outgoing_typed_relationships"=>"http://serverip:7474/db/data/node/7/relationships/out/{-list|&|types}", "incoming_relationships"=>"http://serverip:7474/db/data/node/7/relationships/in", "create_relationship"=>"http://serverip:7474/db/data/node/7/relationships", "paged_traverse"=>"http://serverip:7474/db/data/node/7/paged/traverse/{returnType}{?pageSize,leaseTime}", "all_relationships"=>"http://serverip:7474/db/data/node/7/relationships/all", "incoming_typed_relationships"=>"http://serverip:7474/db/data/node/7/relationships/in/{-list|&|types}", "data"=>{"name"=>"bob"}}, "status"=>500}]
@maxdemarzi
Copy link

Can you try:

@neo.batch [:create_node, {"name" => "bob"}]
@neo.batch [:create_node, {name:"bob"}]

@neo.batch *[[:create_node, {"name" => "bob"}]]
@neo.batch *[[:create_node, {name:"bob"}]}

@maggit
Copy link
Author

maggit commented Jul 14, 2014

@maxdemarzi: I tried the 4 different ways and I get the same thing. Exact same error in messages.log "2014-07-14 18:54:39.426+0000 WARN [o.n.s.r.w.StreamingBatchOperations]:
java.lang.NullPointerException: null"

@area
Copy link

area commented May 22, 2015

Did you get to the bottom of this? I'm currently looking at an almost identical stack trace and I've got nothing... I'm using Neo4j from Nodejs on OSX though...

@thefooj
Copy link

thefooj commented Jun 18, 2015

I was running into similar issues, running neo4j-2.2.2. I was getting similar stack traces with a batch post.

I'm also on OSX (Yosemite) as I'm currently in dev mode

I noticed that at the top of the stack trace was an issue related to the RequestLogHandler in Jetty:

 at org.eclipse.jetty.server.Request.getHttpChannelState(Request.java:407) ~[jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
  at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:98) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]

I disabled HTTP logging in conf/neo4j-server.properties:

# HTTP logging is disabled. HTTP logging can be enabled by setting this
# property to 'true'.
org.neo4j.server.http.log.enabled=false

and the stack traces stopped and my batch import started working. I'm not a Java person (anymore) so I'm not going to dive into tracing where the Neo4j/Jetty/logging breakdown was happening. My suspicion is that it's a matter of a logger being specified that doesn't exist or is not properly configured to understand the HTTP channel...

Regardless, this fix removes the HTTP logging, but those aren't that helpful anyway.

@lutovich
Copy link

Hello gentleman,

Sorry, it took us long time to fix the issue.
It should be fixed by neo4j/neo4j#5049 and released with neo4j 2.2.4.
Validation of the fix would be extremely appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment