<ul dir="auto">
<li>
<p dir="auto">Neo4j version: 4.4.12-enterprise</p>
</li>
<li>
<p dir="auto">Operating system: ubuntu 22.04 Docker Mode</p>
</li>
<li>
<p dir="auto"><strong>Steps to reproduce</strong><br>
bin/neo4j-admin import --skip-duplicate-nodes --database=test  --nodes=a=import/20779588711874560/a_node_header.csv,import/20779588711874560/[0-9]<em>_a_node.csv --relationships=transfer=import/20779588711874560/transfer_relationship_header.csv,import/20779588711874560/[0-9]</em>_transfer_relationship.csv</p>
</li>
</ul>
<p dir="auto"><a href="https://github.com/neo4j/neo4j/files/9876896/jstack.txt">jstack.txt</a></p>
<p dir="auto"><a href="https://github.com/neo4j/neo4j/files/9876914/console.txt">console.txt</a></p>
<p dir="auto">I figure out that the neo4j server is doing unstopped sort job in idmapper prepare step.<br>
Some idea about too many nodes? There are about 2 billion lines of node in my import csv, contains duplicated nodes.<br>
Should I manual remove duplicated nodes to speed up import.</p>
<p dir="auto">When running the following query we receive a <code class="notranslate">key not found:   UNNAMED60</code> error (<code class="notranslate">Neo.DatabaseError.General.UnknownError</code>):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="MATCH (s:NODE)&lt;-[:IS_VERSION_OF]-(sv:NODE_VERSION), 
        p = (s)-[*0..]-&gt;(:`NODE`)
  WHERE (s.id IN ['42a8c128-f575-488f-a914-ba18157ae124']) 
  AND (NOT(sv.until &lt; 20180101 OR sv.from &gt; 20181231)) 
  AND (ALL(r IN relationships(p) WHERE NOT(r.until &lt; 20180101 OR r.from &gt; 20181231)))
  AND ALL(x IN nodes(p) WHERE single(y IN nodes(p) WHERE y = x))
RETURN p"><pre class="notranslate"><code class="notranslate">MATCH (s:NODE)&lt;-[:IS_VERSION_OF]-(sv:NODE_VERSION), 
        p = (s)-[*0..]-&gt;(:`NODE`)
  WHERE (s.id IN ['42a8c128-f575-488f-a914-ba18157ae124']) 
  AND (NOT(sv.until &lt; 20180101 OR sv.from &gt; 20181231)) 
  AND (ALL(r IN relationships(p) WHERE NOT(r.until &lt; 20180101 OR r.from &gt; 20181231)))
  AND ALL(x IN nodes(p) WHERE single(y IN nodes(p) WHERE y = x))
RETURN p
</code></pre></div>
<p dir="auto">The following query however works as expected:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="MATCH (s:NODE)&lt;-[:IS_VERSION_OF]-(sv:NODE_VERSION), 
        p = (s)-[*0..]-&gt;(:`NODE`)
  WHERE (s.id IN ['42a8c128-f575-488f-a914-ba18157ae124']) 
  AND (NOT(sv.until &lt; 20180101 OR sv.from &gt; 20181231)) 
  AND (ALL(r IN relationships(p) WHERE NOT(r.until &lt; 20180101 OR r.from &gt; 20181231)))
WITH p
  WHERE ALL(x IN nodes(p) WHERE single(y IN nodes(p) WHERE y = x))
RETURN p"><pre class="notranslate"><code class="notranslate">MATCH (s:NODE)&lt;-[:IS_VERSION_OF]-(sv:NODE_VERSION), 
        p = (s)-[*0..]-&gt;(:`NODE`)
  WHERE (s.id IN ['42a8c128-f575-488f-a914-ba18157ae124']) 
  AND (NOT(sv.until &lt; 20180101 OR sv.from &gt; 20181231)) 
  AND (ALL(r IN relationships(p) WHERE NOT(r.until &lt; 20180101 OR r.from &gt; 20181231)))
WITH p
  WHERE ALL(x IN nodes(p) WHERE single(y IN nodes(p) WHERE y = x))
RETURN p
</code></pre></div>
<p dir="auto">Note the <code class="notranslate">WITH</code> clause between the path match and the <em>node-duplication</em> condition.</p>
<p dir="auto"><strong>Neo4j Version:</strong> 3.3.4-enterprise<br>
<strong>Operating System:</strong> Mac OS X using official Neo4j docker image<br>
<strong>API:</strong> Neo4j browser / cypher shell</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">FOREACH (id IN range(0,100) | CREATE (:NODE {id:id}))</code></li>
<li><code class="notranslate">MATCH (n1:NODE),(n2:NODE)    WITH n1,n2 LIMIT 500 WHERE rand() &lt; 0.1  CREATE (n1)-[:X {a: 1}]-&gt;(n2)</code></li>
<li><code class="notranslate">MATCH (s:NODE), p = (s)-[*0..]-&gt;(:</code>NODE<code class="notranslate">)   WHERE (s.id IN [1])    AND (ALL(r IN relationships(p) WHERE NOT(r.a &lt; 1 OR r.a &gt; 1)))   AND ALL(x IN nodes(p) WHERE single(y IN nodes(p) WHERE y = x)) RETURN p</code> does not work</li>
<li><code class="notranslate">MATCH (s:NODE), p = (s)-[*0..]-&gt;(:</code>NODE<code class="notranslate">)   WHERE (s.id IN [1])    AND (ALL(r IN relationships(p) WHERE NOT(r.a &lt; 1 OR r.a &gt; 1))) WITH p     WHERE ALL(x IN nodes(p) WHERE single(y IN nodes(p) WHERE y = x)) RETURN p</code> does work</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-04-25 13:47:12.575+0000 ERROR [o.n.b.v.r.ErrorReporter] Client triggered an unexpected error [UnknownError]: key not found:   UNNAMED60, reference 889fa316-bcff-4c22-bf89-b7a75795010e.
2018-04-25 13:47:12.575+0000 ERROR [o.n.b.v.r.ErrorReporter] Client triggered an unexpected error [UnknownError]: key not found:   UNNAMED60, reference 889fa316-bcff-4c22-bf89-b7a75795010e. key not found:   UNNAMED60
java.util.NoSuchElementException: key not found:   UNNAMED60
	at scala.collection.MapLike$class.default(MapLike.scala:228)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.MapExecutionContext.default(ExecutionContext.scala:56)
	at scala.collection.MapLike$class.apply(MapLike.scala:141)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.MapExecutionContext.apply(ExecutionContext.scala:56)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.commands.expressions.ProjectedPath$multiOutgoingRelationshipProjector.apply(ProjectedPath.scala:63)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.commands.expressions.ProjectedPath$multiOutgoingRelationshipProjector.apply(ProjectedPath.scala:61)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.commands.expressions.ProjectedPath$singleNodeProjector.apply(ProjectedPath.scala:37)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.commands.expressions.ProjectedPath$singleNodeProjector.apply(ProjectedPath.scala:35)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.commands.expressions.ProjectedPath.apply(ProjectedPath.scala:83)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.commands.expressions.NullInNullOutExpression.apply(NullInNullOutExpression.scala:30)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.commands.InList.isMatch(InList.scala:43)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.commands.predicates.Predicate.isTrue(Predicate.scala:41)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.CommunityPipeBuilder$$anonfun$asCommand$1$1$$anonfun$apply$5.apply(CommunityPipeBuilder.scala:316)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.CommunityPipeBuilder$$anonfun$asCommand$1$1$$anonfun$apply$5.apply(CommunityPipeBuilder.scala:314)
	at scala.collection.Iterator$class.forall(Iterator.scala:903)
	at scala.collection.AbstractIterator.forall(Iterator.scala:1334)
	at scala.collection.IterableLike$class.forall(IterableLike.scala:75)
	at scala.collection.AbstractIterable.forall(Iterable.scala:54)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.CommunityPipeBuilder$$anonfun$asCommand$1$1.apply(CommunityPipeBuilder.scala:314)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.CommunityPipeBuilder$$anonfun$asCommand$1$1.apply(CommunityPipeBuilder.scala:313)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.CommunityPipeBuilder$$anon$1.filterNode(CommunityPipeBuilder.scala:329)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.pipes.VarLengthExpandPipe$$anon$1.next(VarLengthExpandPipe.scala:65)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.pipes.VarLengthExpandPipe$$anon$1.next(VarLengthExpandPipe.scala:62)
	at scala.collection.Iterator$$anon$14.hasNext(Iterator.scala:535)
	at scala.collection.Iterator$$anon$12.hasNext(Iterator.scala:439)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.profiler.ProfilingIterator.hasNext(Profiler.scala:184)
	at scala.collection.Iterator$$anon$13.hasNext(Iterator.scala:462)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.profiler.ProfilingIterator.hasNext(Profiler.scala:184)
	at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:409)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.profiler.ProfilingIterator.hasNext(Profiler.scala:184)
	at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:409)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.profiler.ProfilingIterator.hasNext(Profiler.scala:184)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.ClosingIterator.hasNext(ResultIterator.scala:58)
	at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:409)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.helpers.RuntimeJavaValueConverter$feedIteratorToVisitable.accept(RuntimeJavaValueConverter.scala:53)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.PipeExecutionResult.accept(PipeExecutionResult.scala:112)
	at org.neo4j.cypher.internal.compatibility.ClosingExecutionResult$$anonfun$accept$2.apply$mcV$sp(ClosingExecutionResult.scala:175)
	at org.neo4j.cypher.internal.compatibility.ClosingExecutionResult$$anonfun$accept$2.apply(ClosingExecutionResult.scala:174)
	at org.neo4j.cypher.internal.compatibility.ClosingExecutionResult$$anonfun$accept$2.apply(ClosingExecutionResult.scala:174)
	at org.neo4j.cypher.internal.compatibility.v3_3.exceptionHandler$runSafely$.apply(exceptionHandler.scala:90)
	at org.neo4j.cypher.internal.compatibility.ClosingExecutionResult.accept(ClosingExecutionResult.scala:174)
	at org.neo4j.bolt.v1.runtime.CypherAdapterStream.accept(CypherAdapterStream.java:76)
	at org.neo4j.bolt.v1.messaging.BoltMessageRouter$ResultHandler.onRecords(BoltMessageRouter.java:146)
	at org.neo4j.bolt.v1.runtime.BoltStateMachine$State$3.lambda$pullAll$0(BoltStateMachine.java:462)
	at org.neo4j.bolt.v1.runtime.TransactionStateMachine$State$1.streamResult(TransactionStateMachine.java:272)
	at org.neo4j.bolt.v1.runtime.TransactionStateMachine.streamResult(TransactionStateMachine.java:105)
	at org.neo4j.bolt.v1.runtime.BoltStateMachine$State$3.pullAll(BoltStateMachine.java:461)
	at org.neo4j.bolt.v1.runtime.BoltStateMachine.pullAll(BoltStateMachine.java:236)
	at org.neo4j.bolt.v1.messaging.BoltMessageRouter.lambda$onPullAll$6(BoltMessageRouter.java:114)
	at org.neo4j.bolt.v1.runtime.concurrent.RunnableBoltWorker.execute(RunnableBoltWorker.java:152)
	at org.neo4j.bolt.v1.runtime.concurrent.RunnableBoltWorker.executeBatch(RunnableBoltWorker.java:145)
	at org.neo4j.bolt.v1.runtime.concurrent.RunnableBoltWorker.run(RunnableBoltWorker.java:110)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	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)
	at org.neo4j.helpers.NamedThreadFactory$2.run(NamedThreadFactory.java:109)"><pre class="notranslate"><code class="notranslate">2018-04-25 13:47:12.575+0000 ERROR [o.n.b.v.r.ErrorReporter] Client triggered an unexpected error [UnknownError]: key not found:   UNNAMED60, reference 889fa316-bcff-4c22-bf89-b7a75795010e.
2018-04-25 13:47:12.575+0000 ERROR [o.n.b.v.r.ErrorReporter] Client triggered an unexpected error [UnknownError]: key not found:   UNNAMED60, reference 889fa316-bcff-4c22-bf89-b7a75795010e. key not found:   UNNAMED60
java.util.NoSuchElementException: key not found:   UNNAMED60
	at scala.collection.MapLike$class.default(MapLike.scala:228)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.MapExecutionContext.default(ExecutionContext.scala:56)
	at scala.collection.MapLike$class.apply(MapLike.scala:141)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.MapExecutionContext.apply(ExecutionContext.scala:56)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.commands.expressions.ProjectedPath$multiOutgoingRelationshipProjector.apply(ProjectedPath.scala:63)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.commands.expressions.ProjectedPath$multiOutgoingRelationshipProjector.apply(ProjectedPath.scala:61)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.commands.expressions.ProjectedPath$singleNodeProjector.apply(ProjectedPath.scala:37)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.commands.expressions.ProjectedPath$singleNodeProjector.apply(ProjectedPath.scala:35)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.commands.expressions.ProjectedPath.apply(ProjectedPath.scala:83)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.commands.expressions.NullInNullOutExpression.apply(NullInNullOutExpression.scala:30)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.commands.InList.isMatch(InList.scala:43)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.commands.predicates.Predicate.isTrue(Predicate.scala:41)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.CommunityPipeBuilder$$anonfun$asCommand$1$1$$anonfun$apply$5.apply(CommunityPipeBuilder.scala:316)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.CommunityPipeBuilder$$anonfun$asCommand$1$1$$anonfun$apply$5.apply(CommunityPipeBuilder.scala:314)
	at scala.collection.Iterator$class.forall(Iterator.scala:903)
	at scala.collection.AbstractIterator.forall(Iterator.scala:1334)
	at scala.collection.IterableLike$class.forall(IterableLike.scala:75)
	at scala.collection.AbstractIterable.forall(Iterable.scala:54)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.CommunityPipeBuilder$$anonfun$asCommand$1$1.apply(CommunityPipeBuilder.scala:314)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.CommunityPipeBuilder$$anonfun$asCommand$1$1.apply(CommunityPipeBuilder.scala:313)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.CommunityPipeBuilder$$anon$1.filterNode(CommunityPipeBuilder.scala:329)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.pipes.VarLengthExpandPipe$$anon$1.next(VarLengthExpandPipe.scala:65)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.pipes.VarLengthExpandPipe$$anon$1.next(VarLengthExpandPipe.scala:62)
	at scala.collection.Iterator$$anon$14.hasNext(Iterator.scala:535)
	at scala.collection.Iterator$$anon$12.hasNext(Iterator.scala:439)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.profiler.ProfilingIterator.hasNext(Profiler.scala:184)
	at scala.collection.Iterator$$anon$13.hasNext(Iterator.scala:462)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.profiler.ProfilingIterator.hasNext(Profiler.scala:184)
	at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:409)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.profiler.ProfilingIterator.hasNext(Profiler.scala:184)
	at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:409)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.profiler.ProfilingIterator.hasNext(Profiler.scala:184)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.ClosingIterator.hasNext(ResultIterator.scala:58)
	at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:409)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.helpers.RuntimeJavaValueConverter$feedIteratorToVisitable.accept(RuntimeJavaValueConverter.scala:53)
	at org.neo4j.cypher.internal.compatibility.v3_3.runtime.PipeExecutionResult.accept(PipeExecutionResult.scala:112)
	at org.neo4j.cypher.internal.compatibility.ClosingExecutionResult$$anonfun$accept$2.apply$mcV$sp(ClosingExecutionResult.scala:175)
	at org.neo4j.cypher.internal.compatibility.ClosingExecutionResult$$anonfun$accept$2.apply(ClosingExecutionResult.scala:174)
	at org.neo4j.cypher.internal.compatibility.ClosingExecutionResult$$anonfun$accept$2.apply(ClosingExecutionResult.scala:174)
	at org.neo4j.cypher.internal.compatibility.v3_3.exceptionHandler$runSafely$.apply(exceptionHandler.scala:90)
	at org.neo4j.cypher.internal.compatibility.ClosingExecutionResult.accept(ClosingExecutionResult.scala:174)
	at org.neo4j.bolt.v1.runtime.CypherAdapterStream.accept(CypherAdapterStream.java:76)
	at org.neo4j.bolt.v1.messaging.BoltMessageRouter$ResultHandler.onRecords(BoltMessageRouter.java:146)
	at org.neo4j.bolt.v1.runtime.BoltStateMachine$State$3.lambda$pullAll$0(BoltStateMachine.java:462)
	at org.neo4j.bolt.v1.runtime.TransactionStateMachine$State$1.streamResult(TransactionStateMachine.java:272)
	at org.neo4j.bolt.v1.runtime.TransactionStateMachine.streamResult(TransactionStateMachine.java:105)
	at org.neo4j.bolt.v1.runtime.BoltStateMachine$State$3.pullAll(BoltStateMachine.java:461)
	at org.neo4j.bolt.v1.runtime.BoltStateMachine.pullAll(BoltStateMachine.java:236)
	at org.neo4j.bolt.v1.messaging.BoltMessageRouter.lambda$onPullAll$6(BoltMessageRouter.java:114)
	at org.neo4j.bolt.v1.runtime.concurrent.RunnableBoltWorker.execute(RunnableBoltWorker.java:152)
	at org.neo4j.bolt.v1.runtime.concurrent.RunnableBoltWorker.executeBatch(RunnableBoltWorker.java:145)
	at org.neo4j.bolt.v1.runtime.concurrent.RunnableBoltWorker.run(RunnableBoltWorker.java:110)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	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)
	at org.neo4j.helpers.NamedThreadFactory$2.run(NamedThreadFactory.java:109)
</code></pre></div>