DozerDB / dozerdb-core

DozerDB Plugin Core Project
GNU General Public License v3.0
27 stars 4 forks source link

Creation / Deletion of DBs via python client seems to break Dozer #32

Open Johnno1011 opened 15 hours ago

Johnno1011 commented 15 hours ago

Hi guys! Great that I was able to get dozer up and running! Unfortunately I think perhaps the recent feature allowing dropping of databases might still be unstable. I'll share my findings here.

docker-compose.yml

services:
  dozer-neo4j:
    image: graphstack/dozerdb:5.25.1
    container_name: neo4j-test
    restart: always
    ports:
      - 7700:7474
      - 7701:7687
    volumes:
      - ./plugins:/plugins
      - neo4j_data:/data
    environment:
      - NEO4J_AUTH=neo4j/neo4j
      - NEO4J_apoc_export_file_enabled=true
      - NEO4J_apoc_import_file_enabled=true
      - NEO4J_apoc_import_file_use__neo4j__config=true
      - NEO4J_dbms_security_procedures_unrestricted=apoc.*, db.*, gds.*, dozer.*
      - NEO4J_dbms_security_procedures_allowlist=apoc.*, db.*, apoc.meta.data(), gds.*, dozer.*

volumes:
  neo4j_data:

In /plugins I inserted open-gds-2.8.0-alpha01.jar mentioned here and apoc-5.15.1-core.jar from here.

Now, from the web interface of Neo4j, I'm able to create multiple databases with CREATE DATABASE and delete them as I please with DROP DATABASE.

Using the python client (5.26.0 - Neo4j Bolt driver for Python). I can sometimes create a database as shown below, but this does not work robustly, if I keep adding new ones eventually something goes wrong.

from neo4j import GraphDatabase

params = {"databaseName": "pikachu"}
query = "CREATE DATABASE $databaseName"
database = None

with GraphDatabase.driver(
    services["graph_store_url"], auth=("neo4j", "neo4j")
) as driver:
    with driver.session(database=database) as session:
        result = session.run(query, parameters=params)  # type: ignore
        print([r.data() for r in result])

When trying to then do anything using these databases (for example add new data with new properties using MATCH statements), I get the following error from the python client:

image

After this happens, the frontend UI appears to show the container is a bit fragged and the container logs of course complain that it cannot perform the next operation since the DB doesn't exist and got corrupted in some way (I have to destroy and reinitialise the container and DB volume). image image

I hope this is enough information to get a discussion going around this topic and reproduction of what I'm experiencing. Please let me know if there's anything else you need. Thanks !

Johnno1011 commented 14 hours ago

Think this is also related. If I run the command where the placeholder for the DB name is '$name', it works fine! But then if I change this placeholder name from name to anything else it seems to trigger this break! Odd, but the error message ERROR Client triggered an unexpected error [Neo.DatabaseError.Statement.ExecutionFailed]: No such property, 'name'., is definitely the best signal of the underlying problem. The other lead is that using placeholders in the cypher command causes this too. IE: CREATE DATABASE test works as expected, but CREATE DATABASE $databaseName and passing the db name in the parameters argument of .run() triggers the problem. Thanks.