Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Unexpected "scala.MatchError" exception in 2.0.1 - NOT A BUG, Maybe an enhancement #2062

Closed
MatAtBread opened this Issue Feb 27, 2014 · 2 comments

Comments

Projects
None yet
2 participants

UPDATE:
This is programming error in my client (passing a Map where a literal was expected by neo4j). There's no fix needed within neo4j, except maybe a more helpful error message?


Using neo4j embedded 2.0.1 I'm seeing a matchError exception I've not seen with 2.0.0.

The offending query is:

match (u:User)-[:EXAMINED]->(v:Interest {uiid:{uiid}})-[:EXAMINATION]->(o:Offer)<-[:OFFERED]-(p:Product) 
set v.purchaseExits=coalesce(v.purchaseExits,[])+{when} 
set o.numPurchaseExits=coalesce(o.numPurchaseExits,0)+1 
return v,p,u

NB: Related to my earlier issue (now closed) concerning scala.MatchError (#2026)?

Error: Error running instance method
scala.MatchError: Map(product -> {tags=[Ljava.lang.Object;@7279acf3, imgs=[Ljava.lang.Object;@1249c03c, desc=Mattel Hot Wheels 2001 1:64 Scale Blue Mini Cooper Die Cast Car #158, asin=B000JLE7JA, resolved=1.384244815625E12, upid=AmazonPAC:B000JLE7JA, ids=[Ljava.lang.Object;@27ebac85, urls=[Ljava.lang.Object;@618b643c}, imgs -> [Ljava.lang.Object;@661d12c, uiid -> Hu9QeIJl1ezRhjhHH6022PrPyFQ, offer -> {numPurchaseExits=0, numComments=0, uoid=0TrgDcw6, numViews=2, when=1.385744877273E12, img=http://ecx.images-amazon.com/images/I/510xajlU9YL.jpg, numLikes=0, type=2, msg=Check out my new Mattel Hot Wheels 2001 1:64 Scale Blue Mini Cooper Die Cast Car #158 :)}, user -> {photos=[Ljava.lang.Object;@7feba2f9, networks=[Ljava.lang.Object;@4718cb0b, fingerprint=weJsYKg8HzQ, cohort=0, name=Dev Swoon}) (of class scala.collection.convert.Wrappers$JMapWrapper)
    at org.neo4j.cypher.internal.helpers.CastSupport$.getConverter(CastSupport.scala:90)
    at org.neo4j.cypher.internal.compiler.v2_0.mutation.GraphElementPropertyFunctions$class.transformTraversableToArray(GraphElementPropertyFunctions.scala:103)
    at org.neo4j.cypher.internal.compiler.v2_0.mutation.GraphElementPropertyFunctions$class.makeValueNeoSafe(GraphElementPropertyFunctions.scala:90)
    at org.neo4j.cypher.internal.compiler.v2_0.executionplan.builders.EntityProducerFactory.makeValueNeoSafe(EntityProducerFactory.scala:30)
    at org.neo4j.cypher.internal.compiler.v2_0.executionplan.builders.EntityProducerFactory$$anonfun$7$$anonfun$applyOrElse$9.apply(EntityProducerFactory.scala:132)
    at org.neo4j.cypher.internal.compiler.v2_0.executionplan.builders.EntityProducerFactory$$anonfun$7$$anonfun$applyOrElse$9.apply(EntityProducerFactory.scala:130)
    at org.neo4j.cypher.internal.compiler.v2_0.executionplan.builders.EntityProducerFactory$$anon$1.apply(EntityProducerFactory.scala:35)
    at org.neo4j.cypher.internal.compiler.v2_0.executionplan.builders.EntityProducerFactory$$anon$1.apply(EntityProducerFactory.scala:34)
    at org.neo4j.cypher.internal.compiler.v2_0.pipes.matching.MonoDirectionalTraversalMatcher.findMatchingPaths(MonodirectionalTraversalMatcher.scala:46)
    at org.neo4j.cypher.internal.compiler.v2_0.pipes.TraversalMatchPipe$$anonfun$internalCreateResults$1.apply(TraversalMatchPipe.scala:34)
    at org.neo4j.cypher.internal.compiler.v2_0.pipes.TraversalMatchPipe$$anonfun$internalCreateResults$1.apply(TraversalMatchPipe.scala:31)
    at scala.collection.Iterator$$anon$13.hasNext(Iterator.scala:371)
    at scala.collection.Iterator$$anon$14.hasNext(Iterator.scala:388)
    at scala.collection.Iterator$$anon$13.hasNext(Iterator.scala:371)
    at scala.collection.Iterator$$anon$14.hasNext(Iterator.scala:388)
    at scala.collection.Iterator$class.foreach(Iterator.scala:727)
    at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
    at scala.collection.generic.Growable$class.$plus$plus$eq(Growable.scala:48)
    at scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:176)
    at scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:45)
    at scala.collection.TraversableOnce$class.to(TraversableOnce.scala:273)
    at scala.collection.AbstractIterator.to(Iterator.scala:1157)
    at scala.collection.TraversableOnce$class.toList(TraversableOnce.scala:257)
    at scala.collection.AbstractIterator.toList(Iterator.scala:1157)
    at org.neo4j.cypher.internal.compiler.v2_0.pipes.EagerPipe.internalCreateResults(EagerPipe.scala:31)
    at org.neo4j.cypher.internal.compiler.v2_0.pipes.PipeWithSource.createResults(Pipe.scala:71)
    at org.neo4j.cypher.internal.compiler.v2_0.pipes.PipeWithSource.createResults(Pipe.scala:68)
    at org.neo4j.cypher.internal.compiler.v2_0.pipes.PipeWithSource.createResults(Pipe.scala:68)
    at org.neo4j.cypher.internal.compiler.v2_0.executionplan.ExecutionPlanBuilder.org$neo4j$cypher$internal$compiler$v2_0$executionplan$ExecutionPlanBuilder$$prepareStateAndResult(ExecutionPlanBuilder.scala:149)
    at org.neo4j.cypher.internal.compiler.v2_0.executionplan.ExecutionPlanBuilder$$anonfun$3.apply(ExecutionPlanBuilder.scala:136)
    at org.neo4j.cypher.internal.compiler.v2_0.executionplan.ExecutionPlanBuilder$$anonfun$3.apply(ExecutionPlanBuilder.scala:135)
    at org.neo4j.cypher.internal.compiler.v2_0.executionplan.ExecutionPlanBuilder$$anon$6.execute(ExecutionPlanBuilder.scala:50)
    at org.neo4j.cypher.internal.ExecutionPlanWrapperForV2_0.execute(CypherCompiler.scala:93)
    at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:61)
    at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:65)
    at org.neo4j.cypher.javacompat.ExecutionEngine.execute(ExecutionEngine.java:78)
    at Neo4jWrapper.cypher(Neo4jWrapper.java:239)
    at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
Error
    at GraphDatabase.cypher (/home/matt/node_modules/swoon-neo4j/lib/GraphDatabase.js:302:18)
    at ApiPublisher.callRemoteApi (/home/matt/node_modules/ApiPublisher/ApiPublisher.js:139:20)
    at Object.handle (/home/matt/node_modules/ApiPublisher/ApiPublisher.js:165:12)
    at next (/home/matt/node_modules/connect/lib/proto.js:193:15)
    at Object.clientSession [as handle] (/home/matt/git/swoonsrv/lib/clientSession.js:58:3)
    at next (/home/matt/node_modules/connect/lib/proto.js:193:15)
    at multipart (/home/matt/node_modules/connect/lib/middleware/multipart.js:93:27)
    at /home/matt/node_modules/connect/lib/middleware/bodyParser.js:64:9
    at urlencoded (/home/matt/node_modules/connect/lib/middleware/urlencoded.js:38:27)
    at /home/matt/node_modules/connect/lib/middleware/bodyParser.js:62:7
        at ErrorHandler.handleError (/home/matt/node_modules/swoon-neo4j/lib/Tools.js:15:3)
Contributor

cleishm commented Feb 27, 2014

Was the map provided as the param "when" ?

Nope, the {uiid} I think. I don't know if you saw the update in my original post, but this is not a neo bug, it was me being an idiot. The only thing that might have helped was a more informative exception message. Feel free to close this one if you have real bugs to fix!

@MatAtBread MatAtBread closed this Jun 30, 2014

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