cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Can't insert data into a Neo4 VM

LJRB
Graph Buddy

I have a Neo4j VM Enterprise created in Azure.

I tried to run a pipeline in Azure Devops, this pipeline only contains a python file to insert data into this VM.

I launched the pipeline but I have the following error:

neo4j.exceptions.ClientError: {code: Neo.ClientError.Statement.AccessMode} {message: Writing in read access mode not allowed. Attempted write to internal graph 0 (neo4j)}

Here is my python code:

from neo4j import GraphDatabase
import pandas as pd

uri = "bolt://20.43.62.37:7687"

userName = "neo4j"
password = "**********"

driver = GraphDatabase.driver(uri, auth=(userName,password))
session = driver.session()

def create_node(tx):
    tx.run("CREATE (c:Article) RETURN c")

session.read_transaction(create_node)

What can I do to insert data to this VM ? I don't know where I'm wrong

1 ACCEPTED SOLUTION

Hi

Have you tried :

session.write_transaction(create_node) ?

The transaction function overrides the default access mode.

Regards

Jonathan

View solution in original post

3 REPLIES 3

Hi

Have you tried :

session.write_transaction(create_node) ?

The transaction function overrides the default access mode.

Regards

Jonathan

Hello @jonathansholmes, I just tried it and it works. Thank you very much

You are welcome. Glad it worked out. Be well.