cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger Issue - beginner question

kivo1669
Node Link

Hello,
can someone tell me what is wrong with this trigger:

CALL apoc.trigger.add('updateLabels',"UNWIND apoc.trigger.nodesByLabel($assignedLabels,'VEGETABLE') AS o
with o.node as og
MATCH (og)<-[:TRANSLATED]-(n:FOOD)
WHERE og:FOOD AND og:ENG
SET n:VEGETABLE", {phase:'before'})

After execution of "MATCH (n:FOOD:ENG) SET n:VEGETABLE RETURN n" I got this error:

Neo.ClientError.Transaction.TransactionHookFailed
Error executing triggers {updateLabels=Unable to complete transaction.}

Here are logs from neo4j.log:

2021-01-02 23:52:19.053+0000 WARN [neo4j] Error executing trigger updateLabels in phase before Unable to complete transaction.
org.neo4j.graphdb.TransactionFailureException: Unable to complete transaction.
at org.neo4j.fabric.executor.FabricLocalExecutor$LocalTransactionContext.transformTerminalOperationError(FabricLocalExecutor.java:229)
at org.neo4j.kernel.impl.coreapi.TransactionImpl.safeTerminalOperation(TransactionImpl.java:515)
at org.neo4j.kernel.impl.coreapi.TransactionImpl.rollback(TransactionImpl.java:148)
at org.neo4j.kernel.impl.query.Neo4jTransactionalContext.rollback(Neo4jTransactionalContext.java:141)
at org.neo4j.cypher.internal.ExecutionEngine.closing(ExecutionEngine.scala:187)
at org.neo4j.cypher.internal.ExecutionEngine.executeSubQuery(ExecutionEngine.scala:177)
at org.neo4j.cypher.internal.ExecutionEngine.execute(ExecutionEngine.scala:127)
at org.neo4j.cypher.internal.javacompat.ExecutionEngine.executeQuery(ExecutionEngine.java:122)
at org.neo4j.cypher.internal.javacompat.ExecutionEngine.executeQuery(ExecutionEngine.java:111)
at org.neo4j.kernel.impl.coreapi.TransactionImpl.execute(TransactionImpl.java:236)
at org.neo4j.kernel.impl.coreapi.TransactionImpl.execute(TransactionImpl.java:225)
at apoc.trigger.TriggerHandler.lambda$executeTriggers$8(TriggerHandler.java:263)
at java.base/java.util.concurrent.ConcurrentHashMap.forEach(ConcurrentHashMap.java:1603)
at apoc.trigger.TriggerHandler.executeTriggers(TriggerHandler.java:255)
at apoc.trigger.TriggerHandler.beforeCommit(TriggerHandler.java:186)
at apoc.trigger.TriggerHandler.beforeCommit(TriggerHandler.java:41)
at org.neo4j.kernel.internal.event.DatabaseTransactionEventListeners.beforeCommit(DatabaseTransactionEventListeners.java:72)
at org.neo4j.kernel.impl.api.KernelTransactionImplementation.commitTransaction(KernelTransactionImplementation.java:709)
at org.neo4j.kernel.impl.api.KernelTransactionImplementation.closeTransaction(KernelTransactionImplementation.java:635)
at org.neo4j.kernel.impl.api.KernelTransactionImplementation.commit(KernelTransactionImplementation.java:602)
at org.neo4j.kernel.impl.coreapi.TransactionImpl.safeTerminalOperation(TransactionImpl.java:510)
at org.neo4j.kernel.impl.coreapi.TransactionImpl.commit(TransactionImpl.java:142)
at org.neo4j.fabric.executor.FabricKernelTransaction.commit(FabricKernelTransaction.java:142)
at org.neo4j.fabric.executor.FabricLocalExecutor$KernelTxWrapper.doCommit(FabricLocalExecutor.java:261)
at reactor.core.publisher.MonoRunnable.call(MonoRunnable.java:73)
at reactor.core.publisher.MonoRunnable.call(MonoRunnable.java:32)
at reactor.core.publisher.FluxFlatMap.trySubscribeScalarMap(FluxFlatMap.java:126)
at reactor.core.publisher.MonoFlatMap.subscribeOrReturn(MonoFlatMap.java:53)
at reactor.core.publisher.Mono.subscribe(Mono.java:4203)
at reactor.core.publisher.FluxFlatMap$FlatMapMain.onNext(FluxFlatMap.java:418)
at reactor.core.publisher.FluxConcatArray$ConcatArraySubscriber.onNext(FluxConcatArray.java:176)
at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2317)
at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:2125)
at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onSubscribe(Operators.java:1999)
at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:54)
at reactor.core.publisher.Mono.subscribe(Mono.java:4218)
at reactor.core.publisher.FluxConcatArray$ConcatArraySubscriber.onComplete(FluxConcatArray.java:207)
at reactor.core.publisher.FluxConcatArray.subscribe(FluxConcatArray.java:80)
at reactor.core.publisher.Mono.subscribe(Mono.java:4218)
at reactor.core.publisher.Mono.block(Mono.java:1677)
at org.neo4j.fabric.transaction.FabricTransactionImpl.doOnChildren(FabricTransactionImpl.java:268)
at org.neo4j.fabric.transaction.FabricTransactionImpl.commit(FabricTransactionImpl.java:179)
at org.neo4j.fabric.bolt.BoltFabricDatabaseService$BoltTransactionImpl.commit(BoltFabricDatabaseService.java:129)
at org.neo4j.bolt.runtime.statemachine.impl.TransactionStateMachine$State.closeTransaction(TransactionStateMachine.java:410)
at org.neo4j.bolt.runtime.statemachine.impl.TransactionStateMachine$State$2.commitTransaction(TransactionStateMachine.java:362)
at org.neo4j.bolt.runtime.statemachine.impl.TransactionStateMachine.commitTransaction(TransactionStateMachine.java:103)
at org.neo4j.bolt.v4.runtime.InTransactionState.processCommitMessage(InTransactionState.java:94)
at org.neo4j.bolt.v4.runtime.InTransactionState.processUnsafe(InTransactionState.java:52)
at org.neo4j.bolt.v3.runtime.FailSafeBoltStateMachineState.process(FailSafeBoltStateMachineState.java:48)
at org.neo4j.bolt.runtime.statemachine.impl.AbstractBoltStateMachine.nextState(AbstractBoltStateMachine.java:143)
at org.neo4j.bolt.runtime.statemachine.impl.AbstractBoltStateMachine.process(AbstractBoltStateMachine.java:91)
at org.neo4j.bolt.messaging.BoltRequestMessageReader.lambda$doRead$1(BoltRequestMessageReader.java:90)
at org.neo4j.bolt.runtime.DefaultBoltConnection.lambda$enqueue$0(DefaultBoltConnection.java:148)
at org.neo4j.bolt.runtime.DefaultBoltConnection.processNextBatchInternal(DefaultBoltConnection.java:237)
at org.neo4j.bolt.runtime.DefaultBoltConnection.processNextBatch(DefaultBoltConnection.java:172)
at org.neo4j.bolt.runtime.DefaultBoltConnection.processNextBatch(DefaultBoltConnection.java:162)
at org.neo4j.bolt.runtime.scheduling.ExecutorBoltScheduler.executeBatch(ExecutorBoltScheduler.java:246)
at org.neo4j.bolt.runtime.scheduling.ExecutorBoltScheduler.lambda$scheduleBatchOrHandleError$3(ExecutorBoltScheduler.java:229)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1764)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.lang.IllegalStateException: This transaction is already being closed.
at org.neo4j.kernel.impl.api.KernelTransactionImplementation.assertTransactionNotClosing(KernelTransactionImplementation.java:570)
at org.neo4j.kernel.impl.api.KernelTransactionImplementation.closeTransaction(KernelTransactionImplementation.java:623)
at org.neo4j.kernel.impl.api.KernelTransactionImplementation.rollback(KernelTransactionImplementation.java:616)
at org.neo4j.kernel.impl.coreapi.TransactionImpl.safeTerminalOperation(TransactionImpl.java:510)
... 61 more

Thanks in advance

0 REPLIES 0