Unable to complete transaction : Neo.DatabaseError.Database.Unknown

Hi All,

Recently we did a migration from Neo4j 5.10.0 to 5.23.0. When running a certain delete query within call in transactions i'm encountering an error like below. But this occurs randomly. Below is the screenshot of the same

Neo4j Version Details
Version : 5.23.0
Edition : Community

Count of relationships based on the query.

Count of relationships without the relationship name in query

Below is the log from debug.log file while running the query.

2024-11-22 06:57:07.950+0000 ERROR [o.n.b.f.StateMachineImpl] Client triggered an unexpected error [Neo.DatabaseError.Database.Unknown]: Unable to complete transaction., reference 8879a20f-047e-4290-8ffe-60283d4585a7.
2024-11-22 06:57:07.950+0000 ERROR [o.n.b.f.StateMachineImpl] Client triggered an unexpected error [Neo.DatabaseError.Database.Unknown]: Unable to complete transaction., reference 8879a20f-047e-4290-8ffe-60283d4585a7.
org.neo4j.bolt.protocol.common.fsm.error.TransactionStateTransitionException: Unable to complete transaction.
	at org.neo4j.bolt.protocol.common.fsm.transition.ready.CreateAutocommitStatementStateTransition.process(CreateAutocommitStatementStateTransition.java:84) ~[neo4j-bolt-5.23.0.jar:5.23.0]
	at org.neo4j.bolt.protocol.common.fsm.transition.ready.CreateAutocommitStatementStateTransition.process(CreateAutocommitStatementStateTransition.java:44) ~[neo4j-bolt-5.23.0.jar:5.23.0]
	at org.neo4j.bolt.fsm.state.MultiTransitionState.process(MultiTransitionState.java:53) ~[neo4j-bolt-5.23.0.jar:5.23.0]
	at org.neo4j.bolt.fsm.StateMachineImpl.process(StateMachineImpl.java:151) ~[neo4j-bolt-5.23.0.jar:5.23.0]
	at org.neo4j.bolt.protocol.common.connector.connection.AtomicSchedulingConnection.lambda$submit$4(AtomicSchedulingConnection.java:122) ~[neo4j-bolt-5.23.0.jar:5.23.0]
	at org.neo4j.bolt.protocol.common.connector.connection.AtomicSchedulingConnection.executeJob(AtomicSchedulingConnection.java:341) ~[neo4j-bolt-5.23.0.jar:5.23.0]
	at org.neo4j.bolt.protocol.common.connector.connection.AtomicSchedulingConnection.doExecuteJobs(AtomicSchedulingConnection.java:274) ~[neo4j-bolt-5.23.0.jar:5.23.0]
	at org.neo4j.bolt.protocol.common.connector.connection.AtomicSchedulingConnection.executeJobs(AtomicSchedulingConnection.java:215) ~[neo4j-bolt-5.23.0.jar:5.23.0]
	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:833) [?:?]
Caused by: org.neo4j.bolt.tx.error.statement.StatementExecutionException: Unable to complete transaction.
	at org.neo4j.bolt.tx.TransactionImpl.run(TransactionImpl.java:143) ~[neo4j-bolt-5.23.0.jar:5.23.0]
	at org.neo4j.bolt.protocol.common.fsm.transition.ready.CreateAutocommitStatementStateTransition.process(CreateAutocommitStatementStateTransition.java:79) ~[neo4j-bolt-5.23.0.jar:5.23.0]
	... 12 more
Caused by: org.neo4j.kernel.impl.query.QueryExecutionKernelException: Unable to complete transaction.
	at org.neo4j.bolt.tx.statement.StatementQuerySubscriber.assertSuccess(StatementQuerySubscriber.java:89) ~[neo4j-bolt-5.23.0.jar:5.23.0]
	at org.neo4j.bolt.tx.TransactionImpl.run(TransactionImpl.java:140) ~[neo4j-bolt-5.23.0.jar:5.23.0]
	at org.neo4j.bolt.protocol.common.fsm.transition.ready.CreateAutocommitStatementStateTransition.process(CreateAutocommitStatementStateTransition.java:79) ~[neo4j-bolt-5.23.0.jar:5.23.0]
	... 12 more
Caused by: org.neo4j.graphdb.TransactionFailureException: Unable to complete transaction.
	at org.neo4j.kernel.impl.coreapi.DefaultTransactionExceptionMapper.mapException(DefaultTransactionExceptionMapper.java:52) ~[neo4j-kernel-5.23.0.jar:5.23.0]
	at org.neo4j.kernel.impl.coreapi.TransactionImpl.safeTerminalOperation(TransactionImpl.java:342) ~[neo4j-kernel-5.23.0.jar:5.23.0]
	at org.neo4j.kernel.impl.coreapi.TransactionImpl.commit(TransactionImpl.java:175) ~[neo4j-kernel-5.23.0.jar:5.23.0]
	at org.neo4j.kernel.impl.query.Neo4jTransactionalContext.commitOperation(Neo4jTransactionalContext.java:218) ~[neo4j-kernel-5.23.0.jar:5.23.0]
	at org.neo4j.kernel.impl.query.Neo4jTransactionalContext.safeTxOperation(Neo4jTransactionalContext.java:226) ~[neo4j-kernel-5.23.0.jar:5.23.0]
	at org.neo4j.kernel.impl.query.Neo4jTransactionalContext.commit(Neo4jTransactionalContext.java:214) ~[neo4j-kernel-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.SingleThreadedTransactionalContextWrapper.commitTransaction(TransactionalContextWrapper.scala:91) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.DelegatingQueryTransactionalContext.commitTransaction(DelegatingQueryContext.scala:801) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.TransactionPipeWrapper.createInnerResultsInNewTransaction(TransactionPipeWrapper.scala:154) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.TransactionPipeWrapper.createInnerResultsInNewTransaction$(TransactionPipeWrapper.scala:113) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.OnErrorFailTxPipe.createInnerResultsInNewTransaction(TransactionPipeWrapper.scala:219) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.OnErrorFailTxPipe.processBatch(TransactionPipeWrapper.scala:229) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.TransactionPipeWrapper.consume(TransactionPipeWrapper.scala:66) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.TransactionPipeWrapper.consume$(TransactionPipeWrapper.scala:65) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.OnErrorFailTxPipe.consume(TransactionPipeWrapper.scala:219) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.AbstractTransactionForeachPipe.$anonfun$internalCreateResults$1(TransactionForeachPipe.scala:57) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.ClosingIterator$$anon$2.nextCur(ClosingIterator.scala:149) ~[neo4j-cypher-runtime-util-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.ClosingIterator$$anon$2.innerHasNext(ClosingIterator.scala:155) ~[neo4j-cypher-runtime-util-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.ClosingIterator.hasNext(ClosingIterator.scala:135) ~[neo4j-cypher-runtime-util-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.EmptyResultPipe.internalCreateResults(EmptyResultPipe.scala:32) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.PipeWithSource.computeDecoratedResult(Pipe.scala:92) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.PipeWithSource.createResults(Pipe.scala:81) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.PipeWithSource.computeDecoratedResult(Pipe.scala:91) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.PipeWithSource.createResults(Pipe.scala:81) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.PipeExecutionResult.$anonfun$request$1(PipeExecutionResult.scala:77) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.TransactionCommittedCounterIterator$.$anonfun$wrap$1(TransactionCommittedCounterIterator.scala:43) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.TransactionCommittedCounterIterator$.executeWithHandling(TransactionCommittedCounterIterator.scala:50) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.TransactionCommittedCounterIterator$.wrap(TransactionCommittedCounterIterator.scala:45) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.PipeExecutionResult.request(PipeExecutionResult.scala:77) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.result.StandardInternalExecutionResult.request(StandardInternalExecutionResult.scala:106) ~[neo4j-cypher-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.result.StandardInternalExecutionResult.initiate(StandardInternalExecutionResult.scala:55) ~[neo4j-cypher-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.result.ClosingExecutionResult.$anonfun$initiate$1(ClosingExecutionResult.scala:63) ~[neo4j-cypher-5.23.0.jar:5.23.0]
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18) ~[scala-library-2.13.11.jar:?]
	at org.neo4j.cypher.internal.result.ClosingExecutionResult.safely(ClosingExecutionResult.scala:110) ~[neo4j-cypher-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.result.ClosingExecutionResult.initiate(ClosingExecutionResult.scala:63) ~[neo4j-cypher-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.result.ClosingExecutionResult$.wrapAndInitiate(ClosingExecutionResult.scala:210) ~[neo4j-cypher-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.CypherCurrentCompiler$CypherExecutableQuery.innerExecute(CypherCurrentCompiler.scala:562) ~[neo4j-cypher-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.CypherCurrentCompiler$CypherExecutableQuery.execute(CypherCurrentCompiler.scala:474) ~[neo4j-cypher-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.ExecutionEngine.doExecute(ExecutionEngine.scala:265) ~[neo4j-cypher-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.ExecutionEngine.$anonfun$executeSubquery$1(ExecutionEngine.scala:196) ~[neo4j-cypher-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.ExecutionEngine.closing(ExecutionEngine.scala:202) ~[neo4j-cypher-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.ExecutionEngine.executeSubquery(ExecutionEngine.scala:176) ~[neo4j-cypher-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.ExecutionEngine.execute(ExecutionEngine.scala:109) ~[neo4j-cypher-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.javacompat.ExecutionEngine.executeQuery(ExecutionEngine.java:150) ~[neo4j-cypher-5.23.0.jar:5.23.0]
	at org.neo4j.router.impl.transaction.database.LocalDatabaseTransaction.lambda$executeQuery$1(LocalDatabaseTransaction.java:141) ~[neo4j-query-router-5.23.0.jar:5.23.0]
	at org.neo4j.router.impl.transaction.database.LocalDatabaseTransaction.translateLocalError(LocalDatabaseTransaction.java:162) ~[neo4j-query-router-5.23.0.jar:5.23.0]
	at org.neo4j.router.impl.transaction.database.LocalDatabaseTransaction.executeQuery(LocalDatabaseTransaction.java:133) ~[neo4j-query-router-5.23.0.jar:5.23.0]
	at org.neo4j.router.impl.QueryRouterImpl.executeQuery(QueryRouterImpl.java:278) ~[neo4j-query-router-5.23.0.jar:5.23.0]
	at org.neo4j.router.impl.bolt.QueryRouterBoltSpi$Transaction.executeQuery(QueryRouterBoltSpi.java:161) ~[neo4j-query-router-5.23.0.jar:5.23.0]
	at org.neo4j.bolt.tx.TransactionImpl.run(TransactionImpl.java:136) ~[neo4j-bolt-5.23.0.jar:5.23.0]
	at org.neo4j.bolt.protocol.common.fsm.transition.ready.CreateAutocommitStatementStateTransition.process(CreateAutocommitStatementStateTransition.java:79) ~[neo4j-bolt-5.23.0.jar:5.23.0]
	... 12 more
Caused by: java.lang.NullPointerException: Cannot invoke "org.neo4j.internal.recordstorage.RecordAccess$RecordProxy.getKey()" because "group" is null
	at org.neo4j.internal.recordstorage.NodeContext$DenseContext.setGroup(NodeContext.java:185) ~[neo4j-record-storage-engine-5.23.0.jar:5.23.0]
	at org.neo4j.internal.recordstorage.NodeContext$DenseContext.getOrLoadGroup(NodeContext.java:175) ~[neo4j-record-storage-engine-5.23.0.jar:5.23.0]
	at org.neo4j.internal.recordstorage.RelationshipModifier.lambda$acquireMostOfTheNodeAndGroupsLocks$2(RelationshipModifier.java:254) ~[neo4j-record-storage-engine-5.23.0.jar:5.23.0]
	at org.neo4j.kernel.impl.api.state.RelationshipChangesForNode.visitIdsSplit(RelationshipChangesForNode.java:252) ~[neo4j-kernel-5.23.0.jar:5.23.0]
	at org.neo4j.kernel.impl.api.state.NodeStateImpl.visitRemovedIdsSplit(NodeStateImpl.java:314) ~[neo4j-kernel-5.23.0.jar:5.23.0]
	at org.neo4j.kernel.impl.api.state.StateNodeRelationshipIds.forEachDeletionSplitInterruptible(StateNodeRelationshipIds.java:88) ~[neo4j-kernel-5.23.0.jar:5.23.0]
	at org.neo4j.internal.recordstorage.RelationshipModifier.lambda$acquireMostOfTheNodeAndGroupsLocks$4(RelationshipModifier.java:252) ~[neo4j-record-storage-engine-5.23.0.jar:5.23.0]
	at org.neo4j.collection.trackable.HeapTrackingArrayList.forEach(HeapTrackingArrayList.java:474) ~[neo4j-collections-5.23.0.jar:5.23.0]
	at org.neo4j.kernel.impl.api.state.TxState$1.forEachSplit(TxState.java:190) ~[neo4j-kernel-5.23.0.jar:5.23.0]
	at org.neo4j.internal.recordstorage.RelationshipModifier.acquireMostOfTheNodeAndGroupsLocks(RelationshipModifier.java:134) ~[neo4j-record-storage-engine-5.23.0.jar:5.23.0]
	at org.neo4j.internal.recordstorage.RelationshipModifier.modifyRelationships(RelationshipModifier.java:111) ~[neo4j-record-storage-engine-5.23.0.jar:5.23.0]
	at org.neo4j.internal.recordstorage.TransactionRecordState.relModify(TransactionRecordState.java:347) ~[neo4j-record-storage-engine-5.23.0.jar:5.23.0]
	at org.neo4j.internal.recordstorage.TransactionToRecordStateVisitor.visitRelationshipModifications(TransactionToRecordStateVisitor.java:94) ~[neo4j-record-storage-engine-5.23.0.jar:5.23.0]
	at org.neo4j.storageengine.api.txstate.TxStateVisitor$Delegator.visitRelationshipModifications(TxStateVisitor.java:159) ~[neo4j-kernel-api-5.23.0.jar:5.23.0]
	at org.neo4j.storageengine.api.txstate.TransactionCountingStateVisitor.visitRelationshipModifications(TransactionCountingStateVisitor.java:119) ~[neo4j-storage-engine-util-5.23.0.jar:5.23.0]
	at org.neo4j.kernel.impl.api.state.TxState.accept(TxState.java:187) ~[neo4j-kernel-5.23.0.jar:5.23.0]
	at org.neo4j.internal.recordstorage.RecordStorageEngine.createCommands(RecordStorageEngine.java:481) ~[neo4j-record-storage-engine-5.23.0.jar:5.23.0]
	at org.neo4j.kernel.impl.api.KernelTransactionImplementation.extractCommands(KernelTransactionImplementation.java:1151) ~[neo4j-kernel-5.23.0.jar:5.23.0]
	at org.neo4j.kernel.impl.api.commit.DefaultCommitter.commit(DefaultCommitter.java:82) ~[neo4j-kernel-5.23.0.jar:5.23.0]
	at org.neo4j.kernel.impl.api.KernelTransactionImplementation.commitTransaction(KernelTransactionImplementation.java:1103) ~[neo4j-kernel-5.23.0.jar:5.23.0]
	at org.neo4j.kernel.impl.api.KernelTransactionImplementation.closeTransaction(KernelTransactionImplementation.java:991) ~[neo4j-kernel-5.23.0.jar:5.23.0]
	at org.neo4j.kernel.impl.api.KernelTransactionImplementation.commit(KernelTransactionImplementation.java:964) ~[neo4j-kernel-5.23.0.jar:5.23.0]
	at org.neo4j.kernel.impl.coreapi.TransactionImpl.lambda$commit$0(TransactionImpl.java:175) ~[neo4j-kernel-5.23.0.jar:5.23.0]
	at org.neo4j.kernel.impl.coreapi.TransactionImpl.safeTerminalOperation(TransactionImpl.java:327) ~[neo4j-kernel-5.23.0.jar:5.23.0]
	at org.neo4j.kernel.impl.coreapi.TransactionImpl.commit(TransactionImpl.java:175) ~[neo4j-kernel-5.23.0.jar:5.23.0]
	at org.neo4j.kernel.impl.query.Neo4jTransactionalContext.commitOperation(Neo4jTransactionalContext.java:218) ~[neo4j-kernel-5.23.0.jar:5.23.0]
	at org.neo4j.kernel.impl.query.Neo4jTransactionalContext.safeTxOperation(Neo4jTransactionalContext.java:226) ~[neo4j-kernel-5.23.0.jar:5.23.0]
	at org.neo4j.kernel.impl.query.Neo4jTransactionalContext.commit(Neo4jTransactionalContext.java:214) ~[neo4j-kernel-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.SingleThreadedTransactionalContextWrapper.commitTransaction(TransactionalContextWrapper.scala:91) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.DelegatingQueryTransactionalContext.commitTransaction(DelegatingQueryContext.scala:801) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.TransactionPipeWrapper.createInnerResultsInNewTransaction(TransactionPipeWrapper.scala:154) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.TransactionPipeWrapper.createInnerResultsInNewTransaction$(TransactionPipeWrapper.scala:113) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.OnErrorFailTxPipe.createInnerResultsInNewTransaction(TransactionPipeWrapper.scala:219) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.OnErrorFailTxPipe.processBatch(TransactionPipeWrapper.scala:229) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.TransactionPipeWrapper.consume(TransactionPipeWrapper.scala:66) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.TransactionPipeWrapper.consume$(TransactionPipeWrapper.scala:65) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.OnErrorFailTxPipe.consume(TransactionPipeWrapper.scala:219) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.AbstractTransactionForeachPipe.$anonfun$internalCreateResults$1(TransactionForeachPipe.scala:57) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.ClosingIterator$$anon$2.nextCur(ClosingIterator.scala:149) ~[neo4j-cypher-runtime-util-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.ClosingIterator$$anon$2.innerHasNext(ClosingIterator.scala:155) ~[neo4j-cypher-runtime-util-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.ClosingIterator.hasNext(ClosingIterator.scala:135) ~[neo4j-cypher-runtime-util-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.EmptyResultPipe.internalCreateResults(EmptyResultPipe.scala:32) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.PipeWithSource.computeDecoratedResult(Pipe.scala:92) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.PipeWithSource.createResults(Pipe.scala:81) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.PipeWithSource.computeDecoratedResult(Pipe.scala:91) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.PipeWithSource.createResults(Pipe.scala:81) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.PipeExecutionResult.$anonfun$request$1(PipeExecutionResult.scala:77) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.TransactionCommittedCounterIterator$.$anonfun$wrap$1(TransactionCommittedCounterIterator.scala:43) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.TransactionCommittedCounterIterator$.executeWithHandling(TransactionCommittedCounterIterator.scala:50) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.pipes.TransactionCommittedCounterIterator$.wrap(TransactionCommittedCounterIterator.scala:45) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.runtime.interpreted.PipeExecutionResult.request(PipeExecutionResult.scala:77) ~[neo4j-cypher-interpreted-runtime-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.result.StandardInternalExecutionResult.request(StandardInternalExecutionResult.scala:106) ~[neo4j-cypher-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.result.StandardInternalExecutionResult.initiate(StandardInternalExecutionResult.scala:55) ~[neo4j-cypher-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.result.ClosingExecutionResult.$anonfun$initiate$1(ClosingExecutionResult.scala:63) ~[neo4j-cypher-5.23.0.jar:5.23.0]
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18) ~[scala-library-2.13.11.jar:?]
	at org.neo4j.cypher.internal.result.ClosingExecutionResult.safely(ClosingExecutionResult.scala:110) ~[neo4j-cypher-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.result.ClosingExecutionResult.initiate(ClosingExecutionResult.scala:63) ~[neo4j-cypher-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.result.ClosingExecutionResult$.wrapAndInitiate(ClosingExecutionResult.scala:210) ~[neo4j-cypher-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.CypherCurrentCompiler$CypherExecutableQuery.innerExecute(CypherCurrentCompiler.scala:562) ~[neo4j-cypher-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.CypherCurrentCompiler$CypherExecutableQuery.execute(CypherCurrentCompiler.scala:474) ~[neo4j-cypher-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.ExecutionEngine.doExecute(ExecutionEngine.scala:265) ~[neo4j-cypher-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.ExecutionEngine.$anonfun$executeSubquery$1(ExecutionEngine.scala:196) ~[neo4j-cypher-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.ExecutionEngine.closing(ExecutionEngine.scala:202) ~[neo4j-cypher-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.ExecutionEngine.executeSubquery(ExecutionEngine.scala:176) ~[neo4j-cypher-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.ExecutionEngine.execute(ExecutionEngine.scala:109) ~[neo4j-cypher-5.23.0.jar:5.23.0]
	at org.neo4j.cypher.internal.javacompat.ExecutionEngine.executeQuery(ExecutionEngine.java:150) ~[neo4j-cypher-5.23.0.jar:5.23.0]
	at org.neo4j.router.impl.transaction.database.LocalDatabaseTransaction.lambda$executeQuery$1(LocalDatabaseTransaction.java:141) ~[neo4j-query-router-5.23.0.jar:5.23.0]
	at org.neo4j.router.impl.transaction.database.LocalDatabaseTransaction.translateLocalError(LocalDatabaseTransaction.java:162) ~[neo4j-query-router-5.23.0.jar:5.23.0]
	at org.neo4j.router.impl.transaction.database.LocalDatabaseTransaction.executeQuery(LocalDatabaseTransaction.java:133) ~[neo4j-query-router-5.23.0.jar:5.23.0]
	at org.neo4j.router.impl.QueryRouterImpl.executeQuery(QueryRouterImpl.java:278) ~[neo4j-query-router-5.23.0.jar:5.23.0]
	at org.neo4j.router.impl.bolt.QueryRouterBoltSpi$Transaction.executeQuery(QueryRouterBoltSpi.java:161) ~[neo4j-query-router-5.23.0.jar:5.23.0]
	at org.neo4j.bolt.tx.TransactionImpl.run(TransactionImpl.java:136) ~[neo4j-bolt-5.23.0.jar:5.23.0]
	at org.neo4j.bolt.protocol.common.fsm.transition.ready.CreateAutocommitStatementStateTransition.process(CreateAutocommitStatementStateTransition.java:79) ~[neo4j-bolt-5.23.0.jar:5.23.0]
	... 12 more

1 Like

I think you are using the call in transactions incorrectly. From my understanding, the match would produce N rows. Each single row will be sent to the call subquery, so there will be not batching.

I believe the correct way to use call in transactions is the following. In this query, all the rows are generated within the call subquery, and it batches the results and persists them in separate transactions of 1000 rows at a time.

Even so, I am not sure why your implementation is resulting in a null pointer exception. Here is the offending operation:

Caused by: java.lang.NullPointerException: Cannot invoke "org.neo4j.internal.recordstorage.RecordAccess$RecordProxy.getKey()" because "group" is null
:auto
call {
    MATCH (r:Roles)-[rel:hasAccessToExportAPI]->(s:ExportAPIDefinition)
    WHERE id(r)=$roleId and id(s) in $tabId0
    DELETE rel
} IN TRANSACTIONS of 1000 ROWS

NOTE: you do not need DETACH DELETE, as that is for deleting nodes that have, or may have, relationships. The operation deletes the node and the relationships. You can use DELETE when deleting a relationship.

I'm running the below query:
MATCH (p:Position {uid: "236e12fb-3cb5-436b-8d1c-5559e10abc80"})
SET p.title = "Engg",
p.description = "XYZX",
p.startMonthYear = date("2022-02-01"),
p.endMonthYear = date("2022-03-12")
RETURN p

For the first time when I run, get the error - "Neo.DatabaseError.Database.Unknown
Unable to complete transaction."
But runs fine in 2nd click. Then again get the same error if running again with new values on set condition.
What could be the possible?
This issue we are not observing on 4.4.20 version but when upgraded to 5.26.3, getting this issue.