opsmill / infrahub

Infrahub - A new approach to Infrastructure Management
https://opsmill.com/
GNU Affero General Public License v3.0
212 stars 18 forks source link

bug: Infrahub crashes when using neo4j 5.21 #3869

Open fatih-acar opened 4 months ago

fatih-acar commented 4 months ago

Component

API Server / GraphQL

Infrahub version

develop, latest

Current Behavior

Infrahub crashes at startup when using neo4j 5.21 with the following error:

neo4j.exceptions.DatabaseError: {code: Neo.DatabaseError.General.UnknownError} {message: key not found: VariableSlotKey(  n@5)}

Expected Behavior

Infrahub should run successfully

Steps to Reproduce

Upgrade neo4j to 5.21

Additional Information

It seems there's an issue with the node_list_get_info query. According to the neo4j debug logs, there's an issue during the planner and I managed to isolate the issue to the following part of the query

OPTIONAL MATCH profile_path = (n)-[:IS_RELATED]->(profile_r:Relationship)<-[:IS_RELATED]-(profile:Node)-[:IS_PART_OF]->(:Root)
        WHERE profile_r.name = "node__profile"
        AND profile.namespace = "Profile"

The neo4j debug logs:

2024-07-19 10:35:54.280+0000 ERROR [o.n.b.f.StateMachineImpl] Client triggered an unexpected error [Neo.DatabaseError.General.UnknownError]: key not found: VariableSlotKey(  n@5), reference 4dece2cb-c4fd-4a60-8240-ec6772f00786.
2024-07-19 10:35:54.286+0000 ERROR [o.n.b.f.StateMachineImpl] Client triggered an unexpected error [Neo.DatabaseError.General.UnknownError]: key not found: VariableSlotKey(  n@5), reference 4dece2cb-c4fd-4a60-8240-ec6772f00786.
org.neo4j.bolt.protocol.common.fsm.error.TransactionStateTransitionException: key not found: VariableSlotKey(  n@5)
    at org.neo4j.bolt.protocol.common.fsm.transition.ready.CreateAutocommitStatementStateTransition.process(CreateAutocommitStatementStateTransition.java:84) ~[neo4j-bolt-5.21.2.jar:5.21.2]
    at org.neo4j.bolt.protocol.common.fsm.transition.ready.CreateAutocommitStatementStateTransition.process(CreateAutocommitStatementStateTransition.java:44) ~[neo4j-bolt-5.21.2.jar:5.21.2]
    at org.neo4j.bolt.fsm.state.MultiTransitionState.process(MultiTransitionState.java:53) ~[neo4j-bolt-5.21.2.jar:5.21.2]
    at org.neo4j.bolt.fsm.StateMachineImpl.process(StateMachineImpl.java:151) ~[neo4j-bolt-5.21.2.jar:5.21.2]
    at org.neo4j.bolt.protocol.common.connector.connection.AtomicSchedulingConnection.lambda$submit$4(AtomicSchedulingConnection.java:122) ~[neo4j-bolt-5.21.2.jar:5.21.2]
    at org.neo4j.bolt.protocol.common.connector.connection.AtomicSchedulingConnection.executeJob(AtomicSchedulingConnection.java:341) ~[neo4j-bolt-5.21.2.jar:5.21.2]
    at org.neo4j.bolt.protocol.common.connector.connection.AtomicSchedulingConnection.doExecuteJobs(AtomicSchedulingConnection.java:274) ~[neo4j-bolt-5.21.2.jar:5.21.2]
    at org.neo4j.bolt.protocol.common.connector.connection.AtomicSchedulingConnection.executeJobs(AtomicSchedulingConnection.java:215) ~[neo4j-bolt-5.21.2.jar:5.21.2]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
    at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
    at java.lang.Thread.run(Thread.java:840) [?:?]
Caused by: org.neo4j.bolt.tx.error.statement.StatementExecutionException: key not found: VariableSlotKey(  n@5)
    at org.neo4j.bolt.tx.TransactionImpl.run(TransactionImpl.java:143) ~[neo4j-bolt-5.21.2.jar:5.21.2]
    at org.neo4j.bolt.protocol.common.fsm.transition.ready.CreateAutocommitStatementStateTransition.process(CreateAutocommitStatementStateTransition.java:79) ~[neo4j-bolt-5.21.2.jar:5.21.2]
    ... 12 more
Caused by: java.util.NoSuchElementException: key not found: VariableSlotKey(  n@5)
    at scala.collection.MapOps.default(Map.scala:274) ~[scala-library-2.13.11.jar:?]
    at scala.collection.MapOps.default$(Map.scala:273) ~[scala-library-2.13.11.jar:?]
    at scala.collection.AbstractMap.default(Map.scala:405) ~[scala-library-2.13.11.jar:?]
    at scala.collection.mutable.HashMap.apply(HashMap.scala:440) ~[scala-library-2.13.11.jar:?]
    at org.neo4j.cypher.internal.physicalplanning.SlotConfiguration.apply(SlotConfiguration.scala:181) ~[neo4j-cypher-physical-planning-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.physicalplanning.SlottedRewriter.org$neo4j$cypher$internal$physicalplanning$SlottedRewriter$$rewriteCachedProperies(SlottedRewriter.scala:542) ~[neo4j-cypher-physical-planning-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.physicalplanning.SlottedRewriter$$anonfun$5.applyOrElse(SlottedRewriter.scala:266) ~[neo4j-cypher-physical-planning-5.21.2.jar:5.21.2]
    at scala.PartialFunction$OrElse.apply(PartialFunction.scala:266) ~[scala-library-2.13.11.jar:?]
    at org.neo4j.cypher.internal.util.Rewritable$RewritableAny$.rewrite$extension(Rewritable.scala:161) ~[neo4j-util-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.util.topDown$TopDownRewriter.rec(Rewritable.scala:279) ~[neo4j-util-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.util.topDown$TopDownRewriter.apply(Rewritable.scala:250) ~[neo4j-util-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.util.Rewritable$RewritableAny$.rewrite$extension(Rewritable.scala:161) ~[neo4j-util-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.util.Rewritable$RewritableAny$.endoRewrite$extension(Rewritable.scala:170) ~[neo4j-util-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.physicalplanning.SlottedRewriter$$anonfun$1.applyOrElse(SlottedRewriter.scala:196) ~[neo4j-cypher-physical-planning-5.21.2.jar:5.21.2]
    at scala.PartialFunction$OrElse.apply(PartialFunction.scala:266) ~[scala-library-2.13.11.jar:?]
    at org.neo4j.cypher.internal.util.Rewritable$RewritableAny$.rewrite$extension(Rewritable.scala:161) ~[neo4j-util-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.util.topDown$TopDownRewriter.rec(Rewritable.scala:279) ~[neo4j-util-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.util.topDown$TopDownRewriter.apply(Rewritable.scala:250) ~[neo4j-util-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.util.Rewritable$RewritableAny$.rewrite$extension(Rewritable.scala:161) ~[neo4j-util-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.util.Rewritable$RewritableAny$.endoRewrite$extension(Rewritable.scala:170) ~[neo4j-util-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.physicalplanning.SlottedRewriter.apply(SlottedRewriter.scala:203) ~[neo4j-cypher-physical-planning-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.physicalplanning.PhysicalPlanner$.plan(PhysicalPlanner.scala:76) ~[neo4j-cypher-physical-planning-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.SlottedRuntime.compileToExecutable(SlottedRuntime.scala:82) ~[neo4j-cypher-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.SlottedRuntime.compileToExecutable$(SlottedRuntime.scala:76) ~[neo4j-cypher-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.EnterpriseSlottedRuntime$.compileToExecutable(EnterpriseSlottedRuntime.scala:17) ~[neo4j-enterprise-cypher-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.FallbackRuntime.compileToExecutable(CypherRuntime.scala:215) ~[neo4j-cypher-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.CypherCurrentCompiler.computeExecutionPlan(CypherCurrentCompiler.scala:244) ~[neo4j-cypher-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.CypherCurrentCompiler.$anonfun$compile$3(CypherCurrentCompiler.scala:173) ~[neo4j-cypher-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.cache.LFUCache.$anonfun$computeIfAbsent$1(LFUCache.scala:50) ~[neo4j-cypher-cache-5.21.2.jar:5.21.2]
    at com.github.benmanes.caffeine.cache.BoundedLocalCache.lambda$doComputeIfAbsent$14(BoundedLocalCache.java:2688) ~[caffeine-3.1.8.jar:3.1.8]
    at java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) ~[?:?]
    at com.github.benmanes.caffeine.cache.BoundedLocalCache.doComputeIfAbsent(BoundedLocalCache.java:2686) ~[caffeine-3.1.8.jar:3.1.8]
    at com.github.benmanes.caffeine.cache.BoundedLocalCache.computeIfAbsent(BoundedLocalCache.java:2669) ~[caffeine-3.1.8.jar:3.1.8]
    at com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:112) ~[caffeine-3.1.8.jar:3.1.8]
    at com.github.benmanes.caffeine.cache.LocalManualCache.get(LocalManualCache.java:62) ~[caffeine-3.1.8.jar:3.1.8]
    at org.neo4j.cypher.internal.cache.LFUCache.computeIfAbsent(LFUCache.scala:50) ~[neo4j-cypher-cache-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.cache.CypherQueryCaches$$anon$3.computeIfAbsent(CypherQueryCaches.scala:547) ~[neo4j-cypher-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.CypherCurrentCompiler.compile(CypherCurrentCompiler.scala:173) ~[neo4j-cypher-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.LibraryMasterCompiler.compile(MasterCompiler.scala:150) ~[neo4j-cypher-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.ExecutionEngine.$anonfun$compilerWithExpressionCodeGenOption$2(ExecutionEngine.scala:298) ~[neo4j-cypher-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.ExecutionEngine$$anon$1.compile(ExecutionEngine.scala:307) ~[neo4j-cypher-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.ExecutionEngine$$anon$1.compile(ExecutionEngine.scala:301) ~[neo4j-cypher-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.QueryCache.$anonfun$compileAndCache$1(QueryCache.scala:527) ~[neo4j-cypher-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.QueryCache.compileOrCompileWithExpressionCodeGenAndCache(QueryCache.scala:576) ~[neo4j-cypher-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.QueryCache.compileAndCache(QueryCache.scala:531) ~[neo4j-cypher-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.QueryCache.compile$1(QueryCache.scala:291) ~[neo4j-cypher-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.QueryCache.compileIfNeededWithCodeGen$1(QueryCache.scala:312) ~[neo4j-cypher-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.QueryCache.computeIfAbsentOrStale(QueryCache.scala:405) ~[neo4j-cypher-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.ExecutionEngine.getOrCompile(ExecutionEngine.scala:407) ~[neo4j-cypher-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.ExecutionEngine.doExecute(ExecutionEngine.scala:231) ~[neo4j-cypher-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.ExecutionEngine.$anonfun$executeSubquery$1(ExecutionEngine.scala:196) ~[neo4j-cypher-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.ExecutionEngine.closing(ExecutionEngine.scala:202) ~[neo4j-cypher-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.ExecutionEngine.executeSubquery(ExecutionEngine.scala:176) ~[neo4j-cypher-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.ExecutionEngine.execute(ExecutionEngine.scala:109) ~[neo4j-cypher-5.21.2.jar:5.21.2]
    at org.neo4j.cypher.internal.javacompat.ExecutionEngine.executeQuery(ExecutionEngine.java:150) ~[neo4j-cypher-5.21.2.jar:5.21.2]
    at org.neo4j.router.impl.transaction.database.LocalDatabaseTransaction.lambda$executeQuery$1(LocalDatabaseTransaction.java:141) ~[neo4j-query-router-5.21.2.jar:5.21.2]
    at org.neo4j.router.impl.transaction.database.LocalDatabaseTransaction.translateLocalError(LocalDatabaseTransaction.java:162) ~[neo4j-query-router-5.21.2.jar:5.21.2]
    at org.neo4j.router.impl.transaction.database.LocalDatabaseTransaction.executeQuery(LocalDatabaseTransaction.java:133) ~[neo4j-query-router-5.21.2.jar:5.21.2]
    at org.neo4j.router.impl.QueryRouterImpl.executeQuery(QueryRouterImpl.java:279) ~[neo4j-query-router-5.21.2.jar:5.21.2]
    at org.neo4j.router.impl.bolt.QueryRouterBoltSpi$Transaction.executeQuery(QueryRouterBoltSpi.java:161) ~[neo4j-query-router-5.21.2.jar:5.21.2]
    at org.neo4j.bolt.tx.TransactionImpl.run(TransactionImpl.java:136) ~[neo4j-bolt-5.21.2.jar:5.21.2]
    at org.neo4j.bolt.protocol.common.fsm.transition.ready.CreateAutocommitStatementStateTransition.process(CreateAutocommitStatementStateTransition.java:79) ~[neo4j-bolt-5.21.2.jar:5.21.2]
    ... 12 more
    Suppressed: org.neo4j.exceptions.InternalException: Failed with plan:
.produceResults(column("profile_uuids"), column("  n@7", "cacheN[  n@5.uuid]"), column("rb", "cacheRFromStore[  r@6.branch]", "cacheRFromStore[  r@6.to]", "cacheRFromStore[  r@6.from]", "cacheR[r1.from]"))
.limit(5000)
.aggregation(Seq("`  n@7` AS `  n@7`", "rb AS rb"), Seq("collect(cacheN[profile.uuid]) AS profile_uuids"))
.apply()
.|.optional("  n@7", "rb")
.|.cacheProperties("cacheNFromStore[profile.uuid]")
.|.filter("(all(`  r@16` IN relationships((`  n@7`)-[`  UNNAMED1`]->(profile_r)<-[`  UNNAMED2`]-(profile)-[`  UNNAMED3`]->(`  UNNAMED4`)) WHERE `  r@16`.status = $`  AUTOSTRING3`) AND all(`  r@11` IN relationships((`  n@7`)-[`  UNNAMED1`]->(profile_r)<-[`  UNNAMED2`]-(profile)-[`  UNNAMED3`]->(`  UNNAMED4`)) WHERE `  r@11`.from <= $time0) AND all(`  r@8` IN relationships((`  n@7`)-[`  UNNAMED1`]->(profile_r)<-[`  UNNAMED2`]-(profile)-[`  UNNAMED3`]->(`  UNNAMED4`)) WHERE `  r@8`.branch IN $branch0))", "(all(`  r@15` IN relationships((`  n@7`)-[`  UNNAMED1`]->(profile_r)<-[`  UNNAMED2`]-(profile)-[`  UNNAMED3`]->(`  UNNAMED4`)) WHERE cacheRFromStore[  r@15.to] IS NULL OR cacheRFromStore[  r@15.to] >= $time0) AND all(`  r@10` IN relationships((`  n@7`)-[`  UNNAMED1`]->(profile_r)<-[`  UNNAMED2`]-(profile)-[`  UNNAMED3`]->(`  UNNAMED4`)) WHERE `  r@10`.to IS NULL OR `  r@10`.branch IN $branch0) AND all(`  r@9` IN relationships((`  n@7`)-[`  UNNAMED1`]->(profile_r)<-[`  UNNAMED2`]-(profile)-[`  UNNAMED3`]->(`  UNNAMED4`)) WHERE `  r@9`.from <= $time0 OR `  r@9`.branch IN $branch0) AND all(`  r@14` IN relationships((`  n@7`)-[`  UNNAMED1`]->(profile_r)<-[`  UNNAMED2`]-(profile)-[`  UNNAMED3`]->(`  UNNAMED4`)) WHERE `  r@14`.from <= $time0 OR `  r@14`.to >= $time0) AND all(`  r@12` IN relationships((`  n@7`)-[`  UNNAMED1`]->(profile_r)<-[`  UNNAMED2`]-(profile)-[`  UNNAMED3`]->(`  UNNAMED4`)) WHERE `  r@12`.to IS NULL OR `  r@12`.from <= $time0) AND all(`  r@13` IN relationships((`  n@7`)-[`  UNNAMED1`]->(profile_r)<-[`  UNNAMED2`]-(profile)-[`  UNNAMED3`]->(`  UNNAMED4`)) WHERE `  r@13`.branch IN $branch0 OR `  r@13`.to >= $time0))", "`  UNNAMED4`:Root")
.|.expandAll("(profile)-[`  UNNAMED3`:IS_PART_OF]->(`  UNNAMED4`)")
.|.filter("NOT `  UNNAMED2` = `  UNNAMED1`", "profile.namespace = $`  AUTOSTRING2`", "profile:Node")
.|.expandAll("(profile_r)<-[`  UNNAMED2`:IS_RELATED]-(profile)")
.|.filter("profile_r.name = $`  AUTOSTRING1`", "profile_r:Relationship")
.|.expandAll("(`  n@7`)-[`  UNNAMED1`:IS_RELATED]->(profile_r)")
.|.argument("  n@7", "rb")
.filter("rb.status = $`  AUTOSTRING0`")
.projection("n1 AS `  n@7`", "r1 AS rb")
.projection("`  n@5` AS n1")
.apply()
.|.top(1, "`  r1.branch_level@65` DESC", "`  r1.from@66` DESC")
.|.projection("r1.branch_level AS `  r1.branch_level@65`", "cacheR[r1.from] AS `  r1.from@66`")
.|.projection("`  r@6` AS r1")
.|.filter("cacheRFromStore[  r@6.from] <= $time0", "cacheRFromStore[  r@6.branch] IN $branch0", "cacheRFromStore[  r@6.from] <= $time0 OR cacheRFromStore[  r@6.to] >= $time0", "((cacheRFromStore[  r@6.branch] IN $branch0 OR cacheRFromStore[  r@6.to] >= $time0) AND (cacheRFromStore[  r@6.from] <= $time0 OR cacheRFromStore[  r@6.branch] IN $branch0))", "((cacheRFromStore[  r@6.to] IS NULL OR cacheRFromStore[  r@6.to] >= $time0) AND (cacheRFromStore[  r@6.to] IS NULL OR cacheRFromStore[  r@6.from] <= $time0))", "cacheRFromStore[  r@6.to] IS NULL OR cacheRFromStore[  r@6.branch] IN $branch0")
.|.expandInto("(root)<-[`  r@6`:IS_PART_OF]-(`  n@5`)")
.|.filter("(root:Root AND `  n@5`:Node)")
.|.argument("root", "  n@5")
.filter("root:Root")
.expandAll("(`  n@5`)-[`  UNNAMED0`:IS_PART_OF]->(root)")
.nodeIndexOperator("  n@5:Node(uuid IN $ids)", indexOrder = IndexOrderNone, argumentIds = Set(), getValue = Map("uuid" -> GetValue), unique = false, indexType = IndexType.RANGE, supportPartitionedScan = false)
.build()
        at org.neo4j.cypher.internal.CypherCurrentCompiler.computeExecutionPlan(CypherCurrentCompiler.scala:252) ~[neo4j-cypher-5.21.2.jar:5.21.2]
        at org.neo4j.cypher.internal.CypherCurrentCompiler.$anonfun$compile$3(CypherCurrentCompiler.scala:173) ~[neo4j-cypher-5.21.2.jar:5.21.2]
        at org.neo4j.cypher.internal.cache.LFUCache.$anonfun$computeIfAbsent$1(LFUCache.scala:50) ~[neo4j-cypher-cache-5.21.2.jar:5.21.2]
        at com.github.benmanes.caffeine.cache.BoundedLocalCache.lambda$doComputeIfAbsent$14(BoundedLocalCache.java:2688) ~[caffeine-3.1.8.jar:3.1.8]
        at java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) ~[?:?]
        at com.github.benmanes.caffeine.cache.BoundedLocalCache.doComputeIfAbsent(BoundedLocalCache.java:2686) ~[caffeine-3.1.8.jar:3.1.8]
        at com.github.benmanes.caffeine.cache.BoundedLocalCache.computeIfAbsent(BoundedLocalCache.java:2669) ~[caffeine-3.1.8.jar:3.1.8]
        at com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:112) ~[caffeine-3.1.8.jar:3.1.8]
        at com.github.benmanes.caffeine.cache.LocalManualCache.get(LocalManualCache.java:62) ~[caffeine-3.1.8.jar:3.1.8]
        at org.neo4j.cypher.internal.cache.LFUCache.computeIfAbsent(LFUCache.scala:50) ~[neo4j-cypher-cache-5.21.2.jar:5.21.2]
        at org.neo4j.cypher.internal.cache.CypherQueryCaches$$anon$3.computeIfAbsent(CypherQueryCaches.scala:547) ~[neo4j-cypher-5.21.2.jar:5.21.2]
        at org.neo4j.cypher.internal.CypherCurrentCompiler.compile(CypherCurrentCompiler.scala:173) ~[neo4j-cypher-5.21.2.jar:5.21.2]
        at org.neo4j.cypher.internal.LibraryMasterCompiler.compile(MasterCompiler.scala:150) ~[neo4j-cypher-5.21.2.jar:5.21.2]
        at org.neo4j.cypher.internal.ExecutionEngine.$anonfun$compilerWithExpressionCodeGenOption$2(ExecutionEngine.scala:298) ~[neo4j-cypher-5.21.2.jar:5.21.2]
        at org.neo4j.cypher.internal.ExecutionEngine$$anon$1.compile(ExecutionEngine.scala:307) ~[neo4j-cypher-5.21.2.jar:5.21.2]
        at org.neo4j.cypher.internal.ExecutionEngine$$anon$1.compile(ExecutionEngine.scala:301) ~[neo4j-cypher-5.21.2.jar:5.21.2]
        at org.neo4j.cypher.internal.QueryCache.$anonfun$compileAndCache$1(QueryCache.scala:527) ~[neo4j-cypher-5.21.2.jar:5.21.2]
        at org.neo4j.cypher.internal.QueryCache.compileOrCompileWithExpressionCodeGenAndCache(QueryCache.scala:576) ~[neo4j-cypher-5.21.2.jar:5.21.2]
        at org.neo4j.cypher.internal.QueryCache.compileAndCache(QueryCache.scala:531) ~[neo4j-cypher-5.21.2.jar:5.21.2]
        at org.neo4j.cypher.internal.QueryCache.compile$1(QueryCache.scala:291) ~[neo4j-cypher-5.21.2.jar:5.21.2]
        at org.neo4j.cypher.internal.QueryCache.compileIfNeededWithCodeGen$1(QueryCache.scala:312) ~[neo4j-cypher-5.21.2.jar:5.21.2]
        at org.neo4j.cypher.internal.QueryCache.computeIfAbsentOrStale(QueryCache.scala:405) ~[neo4j-cypher-5.21.2.jar:5.21.2]
        at org.neo4j.cypher.internal.ExecutionEngine.getOrCompile(ExecutionEngine.scala:407) ~[neo4j-cypher-5.21.2.jar:5.21.2]
        at org.neo4j.cypher.internal.ExecutionEngine.doExecute(ExecutionEngine.scala:231) ~[neo4j-cypher-5.21.2.jar:5.21.2]
        at org.neo4j.cypher.internal.ExecutionEngine.$anonfun$executeSubquery$1(ExecutionEngine.scala:196) ~[neo4j-cypher-5.21.2.jar:5.21.2]
        at org.neo4j.cypher.internal.ExecutionEngine.closing(ExecutionEngine.scala:202) ~[neo4j-cypher-5.21.2.jar:5.21.2]
        at org.neo4j.cypher.internal.ExecutionEngine.executeSubquery(ExecutionEngine.scala:176) ~[neo4j-cypher-5.21.2.jar:5.21.2]
        at org.neo4j.cypher.internal.ExecutionEngine.execute(ExecutionEngine.scala:109) ~[neo4j-cypher-5.21.2.jar:5.21.2]
        at org.neo4j.cypher.internal.javacompat.ExecutionEngine.executeQuery(ExecutionEngine.java:150) ~[neo4j-cypher-5.21.2.jar:5.21.2]
        at org.neo4j.router.impl.transaction.database.LocalDatabaseTransaction.lambda$executeQuery$1(LocalDatabaseTransaction.java:141) ~[neo4j-query-router-5.21.2.jar:5.21.2]
        at org.neo4j.router.impl.transaction.database.LocalDatabaseTransaction.translateLocalError(LocalDatabaseTransaction.java:162) ~[neo4j-query-router-5.21.2.jar:5.21.2]
        at org.neo4j.router.impl.transaction.database.LocalDatabaseTransaction.executeQuery(LocalDatabaseTransaction.java:133) ~[neo4j-query-router-5.21.2.jar:5.21.2]
        at org.neo4j.router.impl.QueryRouterImpl.executeQuery(QueryRouterImpl.java:279) ~[neo4j-query-router-5.21.2.jar:5.21.2]
        at org.neo4j.router.impl.bolt.QueryRouterBoltSpi$Transaction.executeQuery(QueryRouterBoltSpi.java:161) ~[neo4j-query-router-5.21.2.jar:5.21.2]
        at org.neo4j.bolt.tx.TransactionImpl.run(TransactionImpl.java:136) ~[neo4j-bolt-5.21.2.jar:5.21.2]
        at org.neo4j.bolt.protocol.common.fsm.transition.ready.CreateAutocommitStatementStateTransition.process(CreateAutocommitStatementStateTransition.java:79) ~[neo4j-bolt-5.21.2.jar:5.21.2]
        at org.neo4j.bolt.protocol.common.fsm.transition.ready.CreateAutocommitStatementStateTransition.process(CreateAutocommitStatementStateTransition.java:44) ~[neo4j-bolt-5.21.2.jar:5.21.2]
        at org.neo4j.bolt.fsm.state.MultiTransitionState.process(MultiTransitionState.java:53) ~[neo4j-bolt-5.21.2.jar:5.21.2]
        at org.neo4j.bolt.fsm.StateMachineImpl.process(StateMachineImpl.java:151) ~[neo4j-bolt-5.21.2.jar:5.21.2]
        at org.neo4j.bolt.protocol.common.connector.connection.AtomicSchedulingConnection.lambda$submit$4(AtomicSchedulingConnection.java:122) ~[neo4j-bolt-5.21.2.jar:5.21.2]
        at org.neo4j.bolt.protocol.common.connector.connection.AtomicSchedulingConnection.executeJob(AtomicSchedulingConnection.java:341) ~[neo4j-bolt-5.21.2.jar:5.21.2]
        at org.neo4j.bolt.protocol.common.connector.connection.AtomicSchedulingConnection.doExecuteJobs(AtomicSchedulingConnection.java:274) ~[neo4j-bolt-5.21.2.jar:5.21.2]
        at org.neo4j.bolt.protocol.common.connector.connection.AtomicSchedulingConnection.executeJobs(AtomicSchedulingConnection.java:215) ~[neo4j-bolt-5.21.2.jar:5.21.2]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
        at java.lang.Thread.run(Thread.java:840) [?:?]
ajtmccarty commented 4 months ago

made a draft PR (#3880) that fixes the one query identified (although the fix would breaks the query for memgraph) CI tests indicate that are some other issues and I suspect these are bugs that neo4j will need to fix

for example

E       neo4j.exceptions.DatabaseError: {code: Neo.DatabaseError.Statement.ExecutionFailed} {message: class java.lang.String cannot be cast to class org.neo4j.values.AnyValue (java.lang.String is in module java.base of loader 'bootstrap'; org.neo4j.values.AnyValue is in unnamed module of loader 'app')}
exalate-issue-sync[bot] commented 1 month ago

[From lykinsbd]

[~accountid:712020:ef38868b-9437-4572-bec4-f7dbfb5cf726] to add documentation detailing current restrictions.

exalate-issue-sync[bot] commented 2 weeks ago

[From ajtmccarty]

trying to upgrade to neo4j 5.25.1 and still seeing the same error reported below

seems like latest neo4j doesn’t like the branch-specific WHERE conditional we use in quite a few of our cypher queries

for example

{noformat}MATCH (s:Node { uuid: $source_id }) MATCH (d:Node { uuid: $destination_id }) MATCH (s)-[r1:IS_RELATED]->(rl:Relationship { name: $name })-[r2:IS_RELATED]->(d) WHERE ((r1.branch IN $branch0 AND r1.from <= $time0 AND (r1.to IS NULL OR r1.to >= $time0)) OR (r1.branch IN $branch1 AND r1.from <= $time1 AND (r1.to IS NULL OR r1.to >= $time1))) AND ((r2.branch IN $branch0 AND r2.from <= $time0 AND (r2.to IS NULL OR r2.to >= $time0)) OR (r2.branch IN $branch1 AND r2.from <= $time1 AND (r2.to IS NULL OR r2.to >= $time1))) RETURN s,d,rl,r1,r2{noformat}

neo4j cannot handle this WHERE statement for some reason

it can handle this reduced where statement

{noformat}WHERE ((r1.branch IN $branch0 AND r1.from <= $time0 AND (r1.to IS NULL OR r1.to >= $time0)) OR (r1.branch IN $branch1)){noformat}

but once you add the next expression, it crashes

{noformat}WHERE ((r1.branch IN $branch0 AND r1.from <= $time0 AND (r1.to IS NULL OR r1.to >= $time0)) OR (r1.branch IN $branch1 AND r1.from <= $time1)){noformat}