Issue with triggers

I am trying to set the trigger as given in apoc triggers documentation

https://neo4j.com/docs/apoc/current/overview/apoc.trigger/apoc.trigger.install/

Getting this error :

Neo.ClientError.Procedure.ProcedureCallFailed

Failed to invoke procedure apoc.trigger.install: Caused by: java.lang.RuntimeException: No write operations are allowed directly on this database. Writes must pass through the leader. The role of this server is: FOLLOWER

i am running neo4j 5.20 as docker container, also installed apoc library.
In my neo4j browser , Cluster role is showing as "primary" ,

here's the command with which i am starting the container:

 docker run --rm --network host -e NEO4J_AUTH=none     -v $PWD/data:/data     -v $PWD/apoc.conf:/var/lib/neo4j/conf/apoc.conf     -v $PWD/plugins:/plugins     --name neo4j-apoc-new     -e NEO4J_apoc_export_file_enabled=true     -e NEO4J_apoc_import_file_enabled=true     -e NEO4J_apoc_import_file_use__neo4j__config=true     -e NEO4JLABS_PLUGINS=\[\"apoc\"\]     neo4j:5.20.0

i found this https://github.com/neo4j-contrib/neo4j-apoc-procedures/issues/3073

but could't figure out whats wrong with this .

@rahulranjan1680

from what client are you issueing the apco.trigger.install? Neo4j Browser? cypher-shell or some other? What is your Connect url: is it neo4j:// or bolt:// and I presume this is a cluster and you are running Neo4j Enterprise?

Yes, i am using "Neo4j Browser" as client. i tried both the connections "neo4j://" and "bolt://". I am running "neo4j community". I am not sure about the cluster. In neo4j browser at the end of database information section, i can see these values.

Cluster role:	primary
Version:	5.20.0
Edition:	Community
Name:	neo4j

please guide me if these's some configuration to do with clustering.

Thanks

I am able to add triggers now, but for setting the trigger i have to switch the db to "system", and then for read-write the db i have to switch back to "neo4j". Is it correct behaviour?

Yes it is.

2 Likes