<p dir="auto">I receive a <code class="notranslate">Neo.DatabaseError.General.UnknownError</code> 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.</p>
<p dir="auto">Also <a href="https://neo4j-users.slack.com/archives/C08J1EZCH/p1525878783000619" rel="nofollow">mentioned</a> in the Neo4j-users slack.</p>
<p dir="auto">As background--I had a problem creating an index on <code class="notranslate">:action_attribute(val)</code> because of the (4096 char?) text length limit. I worked around this by specifying the default index provider, then recreating the index.</p>
<p dir="auto"><code class="notranslate">dbms.index.default_schema_provider=lucene+native-1.0</code></p>
<p dir="auto">But perhaps this left the database somehow confused about this index--which is used in the query?</p>
<p dir="auto"><strong>Neo4j Version:</strong> Neo4j/3.4.0-rc01<br>
<strong>Operating System:</strong> Windows Server 2012 R2</p>
<h3 dir="auto">Steps to reproduce</h3>
<p dir="auto">I receive the error when I run this command:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="match (p:part)

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

with aa, p 
skip 212945 limit 1
MERGE (aa)-[:IS_PART_NUMBER]-&gt;(p)"><pre class="notranslate"><code class="notranslate">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]-&gt;(p)
</code></pre></div>
<p dir="auto">However, this command (note -1 decrement) works.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="match (p:part)

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

with aa, p 
skip 212944 limit 1
MERGE (aa)-[:IS_PART_NUMBER]-&gt;(p)"><pre class="notranslate"><code class="notranslate">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]-&gt;(p)
</code></pre></div>
<p dir="auto">Nothing seems particularly special about the aa or p nodes at position 212945. Here is the response pasted from tne Neo4j browser:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[
  {
    &quot;keys&quot;: [
      &quot;aa&quot;,
      &quot;aa_rel&quot;,
      &quot;p&quot;,
      &quot;p_rel&quot;
    ],
    &quot;length&quot;: 4,
    &quot;_fields&quot;: [
      {
        &quot;identity&quot;: {
          &quot;low&quot;: 244617450,
          &quot;high&quot;: 0
        },
        &quot;labels&quot;: [
          &quot;action_attribute&quot;
        ],
        &quot;properties&quot;: {
          &quot;val&quot;: &quot;9329k44&quot;,
          &quot;name&quot;: &quot;part_number_txt&quot;,
          &quot;id&quot;: &quot;part_number_txt__9329k44&quot;
        }
      },
      {
        &quot;identity&quot;: {
          &quot;low&quot;: 1546876839,
          &quot;high&quot;: 0
        },
        &quot;start&quot;: {
          &quot;low&quot;: 244617450,
          &quot;high&quot;: 0
        },
        &quot;end&quot;: {
          &quot;low&quot;: 2914466,
          &quot;high&quot;: 0
        },
        &quot;type&quot;: &quot;IS_PART_NUMBER&quot;,
        &quot;properties&quot;: {}
      },
      {
        &quot;identity&quot;: {
          &quot;low&quot;: 2914466,
          &quot;high&quot;: 0
        },
        &quot;labels&quot;: [
          &quot;part&quot;
        ],
        &quot;properties&quot;: {
          &quot;id&quot;: &quot;9329k44&quot;
        }
      },
      {
        &quot;identity&quot;: {
          &quot;low&quot;: 1546876839,
          &quot;high&quot;: 0
        },
        &quot;start&quot;: {
          &quot;low&quot;: 244617450,
          &quot;high&quot;: 0
        },
        &quot;end&quot;: {
          &quot;low&quot;: 2914466,
          &quot;high&quot;: 0
        },
        &quot;type&quot;: &quot;IS_PART_NUMBER&quot;,
        &quot;properties&quot;: {}
      }
    ],
    &quot;_fieldLookup&quot;: {
      &quot;aa&quot;: 0,
      &quot;aa_rel&quot;: 1,
      &quot;p&quot;: 2,
      &quot;p_rel&quot;: 3
    }
  }
]"><pre class="notranslate"><code class="notranslate">[
  {
    "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
    }
  }
]
</code></pre></div>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">Successful <code class="notranslate">MERGE</code>.</p>
<h3 dir="auto">Actual behavior</h3>
<p dir="auto"><code class="notranslate">Neo.DatabaseError.General.UnknownError</code><br>
with the following stack trace in debug.log:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="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)"><pre class="notranslate"><code class="notranslate">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)
</code></pre></div>
<p dir="auto">Given the following unique constraint</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="CREATE CONSTRAINT ON (x:NODE) ASSERT x.id IS UNIQUE"><pre class="notranslate"><code class="notranslate">CREATE CONSTRAINT ON (x:NODE) ASSERT x.id IS UNIQUE
</code></pre></div>
<p dir="auto">running the following query fails with a <code class="notranslate">Neo.DatabaseError.General.UnknownError</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="CREATE (group:GROUP)
WITH group
MATCH (node:NODE)
WHERE node.id = null
CREATE (group)-[:IS_MANAGED_AT]-&gt;(node)"><pre class="notranslate"><code class="notranslate">CREATE (group:GROUP)
WITH group
MATCH (node:NODE)
WHERE node.id = null
CREATE (group)-[:IS_MANAGED_AT]-&gt;(node)
</code></pre></div>
<p dir="auto"><strong>Neo4j Version:</strong> 3.4.0-enterprise<br>
<strong>Operating System:</strong> Mac OS X using official Neo4j docker image<br>
<strong>API:</strong> Neo4j browser / cypher shell</p>
<p dir="auto">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 <code class="notranslate">WHERE node.id = null</code> will never match but in our use case the <code class="notranslate">IS_MANAGED_AT</code> is optional and the <code class="notranslate">null</code> is in fact a parameter which might be <code class="notranslate">NULL</code> under some circumstances (in these case no relationship shall be created - same as if a given id does not match any <code class="notranslate">NODE</code> at all).</p>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">Query should work.</p>
<h3 dir="auto">Actual behavior</h3>
<p dir="auto">Query results in an error.</p>
<h3 dir="auto">Steps to reproduce</h3>
<ol dir="auto">
<li>start empty Neo4j instance</li>
<li><code class="notranslate">CREATE CONSTRAINT ON (x:NODE) ASSERT x.id IS UNIQUE</code></li>
<li><code class="notranslate">CREATE (group:GROUP) WITH group MATCH (node:NODE) WHERE node.id = null CREATE (group)-[:IS_MANAGED_AT]-&gt;(node)</code></li>
</ol>
<p dir="auto">This is the debug log output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="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)"><pre class="notranslate"><code class="notranslate">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)
</code></pre></div>