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

Adding the plugin to an existing db with multi-labeled nodes #37

Closed
tomasonjo opened this issue Jul 6, 2017 · 2 comments
Closed

Adding the plugin to an existing db with multi-labeled nodes #37

tomasonjo opened this issue Jul 6, 2017 · 2 comments

Comments

@tomasonjo
Copy link
Contributor

I have tried to add the plugin to an existing database with multi labeled nodes. When using electron to investigate schema i get a 500 Internal Error back. I used neo4j CE 3.1.5. To reproduce the error you must first import the data and create a multi-labeled node with the two queries:

:play movies

MATCH (p:Person)-[:DIRECTED]-()
SET p:Director

Now that I have imported the data, I add the graphql plugin to Neo4j and restart. Made a test call with electron that returns internal 500 error:
screen shot 2017-07-06 at 00 03 08

console log:

2017-07-06 10:25:56.733+0000 INFO ======== Neo4j 3.1.5 ========
2017-07-06 10:25:57.196+0000 INFO Starting...
2017-07-06 10:25:59.073+0000 INFO Bolt enabled on 0.0.0.0:7687.
2017-07-06 10:26:09.091+0000 INFO Started.
2017-07-06 10:26:09.387+0000 INFO Mounted unmanaged extension [org.neo4j.graphql] at [/graphql]
2017-07-06 10:26:10.320+0000 WARN The following warnings have been detected with resource and/or provider classes:
WARNING: A sub-resource method, public final javax.ws.rs.core.Response org.neo4j.graphql.GraphQLResource.options(javax.ws.rs.core.HttpHeaders), with URI template, "/", is treated as a resource method
WARNING: A sub-resource method, public final javax.ws.rs.core.Response org.neo4j.graphql.GraphQLResource.executeOperation(java.lang.String), with URI template, "/", is treated as a resource method
WARNING: A sub-resource method, public final javax.ws.rs.core.Response org.neo4j.graphql.GraphQLResource.get(java.lang.String,java.lang.String), with URI template, "/", is treated as a resource method
2017-07-06 10:26:11.127+0000 INFO Remote interface available at http://localhost:7474/
{
__schema {
types {
name
kind
description
}
}
}
{}
2017-07-06 10:26:43.452+0000 ERROR The RuntimeException could not be mapped to a response, re-throwing to the HTTP container interfaceType can't be null
graphql.AssertException: interfaceType can't be null
at graphql.Assert.assertNotNull(Assert.java:10)
at graphql.schema.GraphQLObjectType$Builder.withInterface(GraphQLObjectType.java:153)
at org.neo4j.graphql.GraphQLSchemaBuilder.toGraphQLObjectType(GraphQLSchemaBuilder.kt:111)
at org.neo4j.graphql.GraphQLSchemaBuilder.graphQlTypes(GraphQLSchemaBuilder.kt:559)
at org.neo4j.graphql.GraphQLSchemaBuilder$Companion.buildSchema(GraphQLSchemaBuilder.kt:284)
at org.neo4j.graphql.GraphSchema.getGraphQL(GraphSchema.kt:19)
at org.neo4j.graphql.GraphQLResource.executeQuery(GraphQLResource.kt:67)
at org.neo4j.graphql.GraphQLResource.executeOperation(GraphQLResource.kt:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
at org.neo4j.server.rest.transactional.TransactionalRequestDispatcher.dispatch(TransactionalRequestDispatcher.java:147)
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
at org.neo4j.server.rest.dbms.AuthorizationEnabledFilter.doFilter(AuthorizationEnabledFilter.java:122)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.neo4j.server.rest.web.CollectUserAgentFilter.doFilter(CollectUserAgentFilter.java:69)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:497)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Thread.java:745)
2017-07-06 10:26:43.454+0000 WARN /graphql/ interfaceType can't be null
graphql.AssertException: interfaceType can't be null
at graphql.Assert.assertNotNull(Assert.java:10)
at graphql.schema.GraphQLObjectType$Builder.withInterface(GraphQLObjectType.java:153)
at org.neo4j.graphql.GraphQLSchemaBuilder.toGraphQLObjectType(GraphQLSchemaBuilder.kt:111)
at org.neo4j.graphql.GraphQLSchemaBuilder.graphQlTypes(GraphQLSchemaBuilder.kt:559)
at org.neo4j.graphql.GraphQLSchemaBuilder$Companion.buildSchema(GraphQLSchemaBuilder.kt:284)
at org.neo4j.graphql.GraphSchema.getGraphQL(GraphSchema.kt:19)
at org.neo4j.graphql.GraphQLResource.executeQuery(GraphQLResource.kt:67)
at org.neo4j.graphql.GraphQLResource.executeOperation(GraphQLResource.kt:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
at org.neo4j.server.rest.transactional.TransactionalRequestDispatcher.dispatch(TransactionalRequestDispatcher.java:147)
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
at org.neo4j.server.rest.dbms.AuthorizationEnabledFilter.doFilter(AuthorizationEnabledFilter.java:122)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.neo4j.server.rest.web.CollectUserAgentFilter.doFilter(CollectUserAgentFilter.java:69)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:497)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Thread.java:745)

If we remove label director it starts to work:

match (d:Director) remove d:Director

We can even add the multi label back and it will still work:

MATCH (p:Person)-[:DIRECTED]-()
SET p:Director

I guess it has to do with the way it loads up for the first time

@neurofoo
Copy link

neurofoo commented Jul 8, 2017

I'm getting a similar error. Using neo4j-ee 3.2.0 running as a causal cluster in Mesosphere DC/OS.

Compiled code into a .jar and placed in my plugins folder. Added the required directive to the neo4j.conf file.

On restarting the cluster, I get in my logs:

2017-07-07 21:23:42.317+0000 INFO  Mounted unmanaged extension [org.neo4j.graphql] at [/graphql]
2017-07-07 21:23:43.112+0000 WARN  The following warnings have been detected with resource and/or provider classes:
  WARNING: A sub-resource method, public final javax.ws.rs.core.Response org.neo4j.graphql.GraphQLResource.get(java.lang.String,java.lang.String), with URI template, "/", is treated as a resource method
  WARNING: A sub-resource method, public final javax.ws.rs.core.Response org.neo4j.graphql.GraphQLResource.options(javax.ws.rs.core.HttpHeaders), with URI template, "/", is treated as a resource method
  WARNING: A sub-resource method, public final javax.ws.rs.core.Response org.neo4j.graphql.GraphQLResource.executeOperation(java.lang.String), with URI template, "/", is treated as a resource method

I am able to execute graphql commands, e.g.,

WITH '{ Person (username:"test") { id } }' as query, {} as params
CALL graphql.execute(query,params) YIELD result
UNWIND result.Person as p
RETURN p.id

However, if I use the recommended electron graphiql app or just go to localhost:7474/graphql, I get a 500 error code. NB: localhost because I have a connection to the db ssh tunneled to my dev machine.

@linonetwo
Copy link

linonetwo commented Aug 24, 2017

This is probably caused by:

  1. Method should be GET, though I don't understand why neo4j-graphql use GET instead of POST
  2. there should be at least a {} in the Query Variable, or it will be an empty string, which is not a JSON

jexp added a commit to neo4j-contrib/neo4j-graphql that referenced this issue Sep 3, 2017
@jexp jexp closed this as completed in d91eb7d Sep 3, 2017
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

3 participants