Issue 1:
I receive a Neo.DatabaseError.General.UnknownError upon trying to MERGE two particular nodes. Nothing seems special about these nodes. I'll include as much info as I can below, but I doubt this will be particularly helpful. Feel free to contact me to get more info.

Also mentioned in the Neo4j-users slack.

As background--I had a problem creating an index on :action_attribute(val) because of the (4096 char?) text length limit. I worked around this by specifying the default index provider, then recreating the index.

dbms.index.default_schema_provider=lucene+native-1.0

But perhaps this left the database somehow confused about this index--which is used in the query?

Neo4j Version: Neo4j/3.4.0-rc01

Operating System: Windows Server 2012 R2

Steps to reproduce

I receive the error when I run this command:

match (p:part)

with p
match (aa:action_attribute {name:"part_number_txt", val: p.id})

with aa, p
skip 212945 limit 1
MERGE (aa)-[:IS_PART_NUMBER]->(p)

However, this command (note -1 decrement) works.

match (p:part)

with p
match (aa:action_attribute {name:"part_number_txt", val: p.id})

with aa, p
skip 212944 limit 1
MERGE (aa)-[:IS_PART_NUMBER]->(p)

Nothing seems particularly special about the aa or p nodes at position 212945. Here is the response pasted from tne Neo4j browser:

[
{
"keys": [
"aa",
"aa_rel",
"p",
"p_rel"
],
"length": 4,
"_fields": [
{
"identity": {
"low": 244617450,
"high": 0
},
"labels": [
"action_attribute"
],
"properties": {
"val": "9329k44",
"name": "part_number_txt",
"id": "part_number_txt__9329k44"
}
},
{
"identity": {
"low": 1546876839,
"high": 0
},
"start": {
"low": 244617450,
"high": 0
},
"end": {
"low": 2914466,
"high": 0
},
"type": "IS_PART_NUMBER",
"properties": {}
},
{
"identity": {
"low": 2914466,
"high": 0
},
"labels": [
"part"
],
"properties": {
"id": "9329k44"
}
},
{
"identity": {
"low": 1546876839,
"high": 0
},
"start": {
"low": 244617450,
"high": 0
},
"end": {
"low": 2914466,
"high": 0
},
"type": "IS_PART_NUMBER",
"properties": {}
}
],
"_fieldLookup": {
"aa": 0,
"aa_rel": 1,
"p": 2,
"p_rel": 3
}
}
]

Expected behavior

Successful MERGE.

Actual behavior

Neo.DatabaseError.General.UnknownError

with the following stack trace in debug.log:

2018-05-09 16:29:30.799+0000 ERROR [o.n.b.v.r.ErrorReporter] Client triggered an unexpected error [UnknownError]: null, reference 183ca74f-b273-4f80-8fbf-a216b31ed659.
java.lang.NullPointerException
at org.neo4j.kernel.api.impl.schema.ValueEncoding$6.encodeQuery(ValueEncoding.java:244)
at org.neo4j.kernel.api.impl.schema.LuceneDocumentStructure.newSeekQuery(LuceneDocumentStructure.java:110)
at org.neo4j.kernel.api.impl.schema.reader.SimpleIndexReader.toLuceneQuery(SimpleIndexReader.java:135)
at org.neo4j.kernel.api.impl.schema.reader.SimpleIndexReader.query(SimpleIndexReader.java:97)
at org.neo4j.kernel.impl.index.schema.fusion.FusionIndexReader.query(FusionIndexReader.java:91)
at org.neo4j.kernel.impl.newapi.Read.nodeIndexSeekWithFreshIndexReader(Read.java:207)
at org.neo4j.kernel.impl.newapi.Read.lockingNodeUniqueIndexSeek(Read.java:181)
at org.neo4j.cypher.internal.runtime.interpreted.TransactionBoundQueryContext.lockingUniqueIndexSeek(TransactionBoundQueryContext.scala:312)
at org.neo4j.cypher.internal.compatibility.v3_4.ExceptionTranslatingQueryContext$$anonfun$lockingUniqueIndexSeek$1.apply(ExceptionTranslatingQueryContext.scala:202)
at org.neo4j.cypher.internal.compatibility.v3_4.ExceptionTranslatingQueryContext$$anonfun$lockingUniqueIndexSeek$1.apply(ExceptionTranslatingQueryContext.scala:202)
at org.neo4j.cypher.internal.compatibility.v3_4.ExceptionTranslationSupport$class.translateException(ExceptionTranslationSupport.scala:33)
at org.neo4j.cypher.internal.compatibility.v3_4.ExceptionTranslatingQueryContext.translateException(ExceptionTranslatingQueryContext.scala:41)
at org.neo4j.cypher.internal.compatibility.v3_4.ExceptionTranslatingQueryContext.lockingUniqueIndexSeek(ExceptionTranslatingQueryContext.scala:202)
at org.neo4j.cypher.internal.runtime.interpreted.DelegatingQueryContext.lockingUniqueIndexSeek(DelegatingQueryContext.scala:163)
at org.neo4j.cypher.internal.runtime.interpreted.pipes.NodeIndexSeeker$$anonfun$indexSeek$2.apply(NodeIndexSeeker.scala:61)
at org.neo4j.cypher.internal.runtime.interpreted.pipes.NodeIndexSeeker$$anonfun$indexSeek$2.apply(NodeIndexSeeker.scala:61)
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241)
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:35)
at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:241)
at scala.collection.AbstractTraversable.flatMap(Traversable.scala:104)
at org.neo4j.cypher.internal.runtime.interpreted.pipes.NodeIndexSeeker$class.indexSeek(NodeIndexSeeker.scala:61)
at org.neo4j.cypher.internal.runtime.interpreted.pipes.NodeIndexSeekPipe.indexSeek(NodeIndexSeekPipe.scala:30)
at org.neo4j.cypher.internal.runtime.interpreted.pipes.NodeIndexSeekPipe.internalCreateResults(NodeIndexSeekPipe.scala:53)
at org.neo4j.cypher.internal.runtime.interpreted.pipes.Pipe$class.createResults(Pipe.scala:45)
at org.neo4j.cypher.internal.runtime.interpreted.pipes.NodeIndexSeekPipe.createResults(NodeIndexSeekPipe.scala:30)
at org.neo4j.cypher.internal.runtime.interpreted.pipes.ApplyPipe$$anonfun$internalCreateResults$1.apply(ApplyPipe.scala:32)
at org.neo4j.cypher.internal.runtime.interpreted.pipes.ApplyPipe$$anonfun$internalCreateResults$1.apply(ApplyPipe.scala:29)
at scala.collection.Iterator$$anon$12.nextCur(Iterator.scala:435)
at scala.collection.Iterator$$anon$12.hasNext(Iterator.scala:441)
at scala.collection.Iterator$class.isEmpty(Iterator.scala:331)
at scala.collection.AbstractIterator.isEmpty(Iterator.scala:1334)
at org.neo4j.cypher.internal.runtime.interpreted.pipes.LimitPipe.internalCreateResults(LimitPipe.scala:34)
at org.neo4j.cypher.internal.runtime.interpreted.pipes.PipeWithSource.createResults(Pipe.scala:76)
at org.neo4j.cypher.internal.runtime.interpreted.pipes.PipeWithSource.createResults(Pipe.scala:72)
at org.neo4j.cypher.internal.runtime.interpreted.pipes.PipeWithSource.createResults(Pipe.scala:72)
at org.neo4j.cypher.internal.runtime.interpreted.pipes.PipeWithSource.createResults(Pipe.scala:72)
at org.neo4j.cypher.internal.compatibility.v3_4.runtime.executionplan.BaseExecutionResultBuilderFactory$BaseExecutionWorkflowBuilder.createResults(DefaultExecutionResultBuilderFactory.scala:105)
at org.neo4j.cypher.internal.compatibility.v3_4.runtime.executionplan.BaseExecutionResultBuilderFactory$BaseExecutionWorkflowBuilder.build(DefaultExecutionResultBuilderFactory.scala:77)
at org.neo4j.cypher.internal.compatibility.v3_4.runtime.BuildInterpretedExecutionPlan$$anonfun$getExecutionPlanFunction$1.apply(BuildInterpretedExecutionPlan.scala:97)
at org.neo4j.cypher.internal.compatibility.v3_4.runtime.BuildInterpretedExecutionPlan$$anonfun$getExecutionPlanFunction$1.apply(BuildInterpretedExecutionPlan.scala:80)
at org.neo4j.cypher.internal.compatibility.v3_4.runtime.BuildInterpretedExecutionPlan$InterpretedExecutionPlan.run(BuildInterpretedExecutionPlan.scala:111)
at org.neo4j.cypher.internal.compatibility.LatestRuntimeVariablePlannerCompatibility$ExecutionPlanWrapper$$anonfun$run$1.apply(LatestRuntimeVariablePlannerCompatibility.scala:128)
at org.neo4j.cypher.internal.compatibility.LatestRuntimeVariablePlannerCompatibility$ExecutionPlanWrapper$$anonfun$run$1.apply(LatestRuntimeVariablePlannerCompatibility.scala:124)
at org.neo4j.cypher.exceptionHandler$runSafely$.apply(exceptionHandler.scala:89)
at org.neo4j.cypher.internal.compatibility.LatestRuntimeVariablePlannerCompatibility$ExecutionPlanWrapper.run(LatestRuntimeVariablePlannerCompatibility.scala:124)
at org.neo4j.cypher.internal.PreparedPlanExecution.execute(PreparedPlanExecution.scala:29)
at org.neo4j.cypher.internal.ExecutionEngine.execute(ExecutionEngine.scala:119)
at org.neo4j.cypher.internal.javacompat.ExecutionEngine.executeQuery(ExecutionEngine.java:61)
at org.neo4j.bolt.v1.runtime.TransactionStateMachineSPI$1.start(TransactionStateMachineSPI.java:144)
at org.neo4j.bolt.v1.runtime.TransactionStateMachine$State.startExecution(TransactionStateMachine.java:446)
at org.neo4j.bolt.v1.runtime.TransactionStateMachine$State$1.execute(TransactionStateMachine.java:259)
at org.neo4j.bolt.v1.runtime.TransactionStateMachine$State$1.run(TransactionStateMachine.java:240)
at org.neo4j.bolt.v1.runtime.TransactionStateMachine.run(TransactionStateMachine.java:81)
at org.neo4j.bolt.v1.runtime.BoltStateMachine$State$2.run(BoltStateMachine.java:456)
at org.neo4j.bolt.v1.runtime.BoltStateMachine.run(BoltStateMachine.java:222)
at org.neo4j.bolt.v1.messaging.BoltMessageRouter.lambda$onRun$3(BoltMessageRouter.java:93)
at org.neo4j.bolt.runtime.DefaultBoltConnection.processNextBatch(DefaultBoltConnection.java:193)
at org.neo4j.bolt.runtime.DefaultBoltConnection.processNextBatch(DefaultBoltConnection.java:143)
at org.neo4j.bolt.runtime.ExecutorBoltScheduler.executeBatch(ExecutorBoltScheduler.java:163)
at org.neo4j.bolt.runtime.ExecutorBoltScheduler.lambda$null$0(ExecutorBoltScheduler.java:145)
at java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Issue 2:
Given the following unique constraint

CREATE CONSTRAINT ON (x:NODE) ASSERT x.id IS UNIQUE

running the following query fails with a Neo.DatabaseError.General.UnknownError:

CREATE (group:GROUP)
WITH group
MATCH (node:NODE)
WHERE node.id = null
CREATE (group)-[:IS_MANAGED_AT]->(node)

Neo4j Version: 3.4.0-enterprise

Operating System: Mac OS X using official Neo4j docker image

API: Neo4j browser / cypher shell

The same query given the same precondition (unique constraint) works on Neo4j 3.3.5-enterprise. And yes, I know that this query might look nonsensical because the WHERE node.id = null will never match but in our use case the IS_MANAGED_AT is optional and the null is in fact a parameter which might be NULL under some circumstances (in these case no relationship shall be created - same as if a given id does not match any NODE at all).

Expected behavior

Query should work.

Actual behavior

Query results in an error.

Steps to reproduce

start empty Neo4j instance

CREATE CONSTRAINT ON (x:NODE) ASSERT x.id IS UNIQUE

CREATE (group:GROUP) WITH group MATCH (node:NODE) WHERE node.id = null CREATE (group)-[:IS_MANAGED_AT]->(node)

This is the debug log output:

2018-05-23 09:20:52.153+0000 ERROR [o.n.b.v.r.ErrorReporter] Client triggered an unexpected error [UnknownError]: null, reference 01158ab5-7eb6-4928-9877-5fd79ed0db96.
2018-05-23 09:20:52.153+0000 ERROR [o.n.b.v.r.ErrorReporter] Client triggered an unexpected error [UnknownError]: null, reference 01158ab5-7eb6-4928-9877-5fd79ed0db96.
java.lang.NullPointerException
at org.neo4j.kernel.api.impl.schema.ValueEncoding$6.encodeQuery(ValueEncoding.java:244)
at org.neo4j.kernel.api.impl.schema.LuceneDocumentStructure.newSeekQuery(LuceneDocumentStructure.java:110)
at org.neo4j.kernel.api.impl.schema.reader.SimpleIndexReader.toLuceneQuery(SimpleIndexReader.java:135)
at org.neo4j.kernel.api.impl.schema.reader.SimpleIndexReader.query(SimpleIndexReader.java:97)
at org.neo4j.kernel.impl.index.schema.fusion.FusionIndexReader.query(FusionIndexReader.java:91)
at org.neo4j.kernel.impl.newapi.Read.nodeIndexSeekWithFreshIndexReader(Read.java:207)
at org.neo4j.kernel.impl.newapi.Read.lockingNodeUniqueIndexSeek(Read.java:181)
at org.neo4j.cypher.internal.runtime.interpreted.TransactionBoundQueryContext.lockingUniqueIndexSeek(TransactionBoundQueryContext.scala:312)
at org.neo4j.cypher.internal.compatibility.v3_4.ExceptionTranslatingQueryContext$$anonfun$lockingUniqueIndexSeek$1.apply(ExceptionTranslatingQueryContext.scala:202)
at org.neo4j.cypher.internal.compatibility.v3_4.ExceptionTranslatingQueryContext$$anonfun$lockingUniqueIndexSeek$1.apply(ExceptionTranslatingQueryContext.scala:202)
at org.neo4j.cypher.internal.compatibility.v3_4.ExceptionTranslationSupport$class.translateException(ExceptionTranslationSupport.scala:33)
at org.neo4j.cypher.internal.compatibility.v3_4.ExceptionTranslatingQueryContext.translateException(ExceptionTranslatingQueryContext.scala:41)
at org.neo4j.cypher.internal.compatibility.v3_4.ExceptionTranslatingQueryContext.lockingUniqueIndexSeek(ExceptionTranslatingQueryContext.scala:202)
at org.neo4j.cypher.internal.runtime.interpreted.DelegatingQueryContext.lockingUniqueIndexSeek(DelegatingQueryContext.scala:163)
at org.neo4j.cypher.internal.runtime.interpreted.pipes.NodeIndexSeeker$$anonfun$indexSeek$2.apply(NodeIndexSeeker.scala:61)
at org.neo4j.cypher.internal.runtime.interpreted.pipes.NodeIndexSeeker$$anonfun$indexSeek$2.apply(NodeIndexSeeker.scala:61)
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241)
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:35)
at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:241)
at scala.collection.AbstractTraversable.flatMap(Traversable.scala:104)
at org.neo4j.cypher.internal.runtime.interpreted.pipes.NodeIndexSeeker$class.indexSeek(NodeIndexSeeker.scala:61)
at org.neo4j.cypher.internal.runtime.slotted.pipes.NodeIndexSeekSlottedPipe.indexSeek(NodeIndexSeekSlottedPipe.scala:36)
at org.neo4j.cypher.internal.runtime.slotted.pipes.NodeIndexSeekSlottedPipe.internalCreateResults(NodeIndexSeekSlottedPipe.scala:63)
at org.neo4j.cypher.internal.runtime.interpreted.pipes.Pipe$class.createResults(Pipe.scala:45)
at org.neo4j.cypher.internal.runtime.slotted.pipes.NodeIndexSeekSlottedPipe.createResults(NodeIndexSeekSlottedPipe.scala:36)
at org.neo4j.cypher.internal.runtime.slotted.pipes.ApplySlottedPipe$$anonfun$internalCreateResults$1.apply(ApplySlottedPipe.scala:36)
at org.neo4j.cypher.internal.runtime.slotted.pipes.ApplySlottedPipe$$anonfun$internalCreateResults$1.apply(ApplySlottedPipe.scala:34)
at scala.collection.Iterator$$anon$12.nextCur(Iterator.scala:435)
at scala.collection.Iterator$$anon$12.hasNext(Iterator.scala:441)
at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:409)
at org.neo4j.cypher.internal.runtime.interpreted.pipes.EmptyResultPipe.internalCreateResults(EmptyResultPipe.scala:28)
at org.neo4j.cypher.internal.runtime.interpreted.pipes.PipeWithSource.createResults(Pipe.scala:76)
at org.neo4j.cypher.internal.runtime.interpreted.pipes.PipeWithSource.createResults(Pipe.scala:72)
at org.neo4j.cypher.internal.compatibility.v3_4.runtime.executionplan.BaseExecutionResultBuilderFactory$BaseExecutionWorkflowBuilder.createResults(DefaultExecutionResultBuilderFactory.scala:105)
at org.neo4j.cypher.internal.compatibility.v3_4.runtime.executionplan.BaseExecutionResultBuilderFactory$BaseExecutionWorkflowBuilder.build(DefaultExecutionResultBuilderFactory.scala:77)
at org.neo4j.cypher.internal.compatibility.v3_4.runtime.BuildInterpretedExecutionPlan$$anonfun$getExecutionPlanFunction$1.apply(BuildInterpretedExecutionPlan.scala:97)
at org.neo4j.cypher.internal.compatibility.v3_4.runtime.BuildInterpretedExecutionPlan$$anonfun$getExecutionPlanFunction$1.apply(BuildInterpretedExecutionPlan.scala:80)
at org.neo4j.cypher.internal.BuildSlottedExecutionPlan$SlottedExecutionPlan.run(BuildSlottedExecutionPlan.scala:152)
at org.neo4j.cypher.internal.compatibility.LatestRuntimeVariablePlannerCompatibility$ExecutionPlanWrapper$$anonfun$run$1.apply(LatestRuntimeVariablePlannerCompatibility.scala:128)
at org.neo4j.cypher.internal.compatibility.LatestRuntimeVariablePlannerCompatibility$ExecutionPlanWrapper$$anonfun$run$1.apply(LatestRuntimeVariablePlannerCompatibility.scala:124)
at org.neo4j.cypher.exceptionHandler$runSafely$.apply(exceptionHandler.scala:89)
at org.neo4j.cypher.internal.compatibility.LatestRuntimeVariablePlannerCompatibility$ExecutionPlanWrapper.run(LatestRuntimeVariablePlannerCompatibility.scala:124)
at org.neo4j.cypher.internal.PreparedPlanExecution.execute(PreparedPlanExecution.scala:29)
at org.neo4j.cypher.internal.ExecutionEngine.execute(ExecutionEngine.scala:119)
at org.neo4j.cypher.internal.javacompat.ExecutionEngine.executeQuery(ExecutionEngine.java:61)
at org.neo4j.bolt.v1.runtime.TransactionStateMachineSPI$1.start(TransactionStateMachineSPI.java:144)
at org.neo4j.bolt.v1.runtime.TransactionStateMachine$State.startExecution(TransactionStateMachine.java:446)
at org.neo4j.bolt.v1.runtime.TransactionStateMachine$State$1.execute(TransactionStateMachine.java:259)
at org.neo4j.bolt.v1.runtime.TransactionStateMachine$State$1.run(TransactionStateMachine.java:240)
at org.neo4j.bolt.v1.runtime.TransactionStateMachine.run(TransactionStateMachine.java:81)
at org.neo4j.bolt.v1.runtime.BoltStateMachine$State$2.run(BoltStateMachine.java:456)
at org.neo4j.bolt.v1.runtime.BoltStateMachine.run(BoltStateMachine.java:222)
at org.neo4j.bolt.v1.messaging.BoltMessageRouter.lambda$onRun$3(BoltMessageRouter.java:93)
at org.neo4j.bolt.runtime.MetricsReportingBoltConnection.lambda$enqueue$0(MetricsReportingBoltConnection.java:69)
at org.neo4j.bolt.runtime.DefaultBoltConnection.processNextBatch(DefaultBoltConnection.java:193)
at org.neo4j.bolt.runtime.MetricsReportingBoltConnection.processNextBatch(MetricsReportingBoltConnection.java:87)
at org.neo4j.bolt.runtime.DefaultBoltConnection.processNextBatch(DefaultBoltConnection.java:143)
at org.neo4j.bolt.runtime.ExecutorBoltScheduler.executeBatch(ExecutorBoltScheduler.java:163)
at org.neo4j.bolt.runtime.ExecutorBoltScheduler.lambda$null$0(ExecutorBoltScheduler.java:145)
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)