0

I'm creating nodes with CREATE command like the following:

CREATE (d:A { name:'one_string' })

when I run such a query, I get the following error message:

Node(12079) already exists with label `B` and property `name` = 'a_different_string'

As you see, I'm creating a node with a different label and property value and still get such an error. And, I don't really understand why running such a query should throw an error (note: I've defined a constraint on names of all types of Labels to be UNIQUE.)

One point is that, since I'm testing my graph building process multiple times, every time that I want to create nodes from the beginning, I first delete all the existing nodes using the following command:

MATCH (a:A) DELETE a

I'm wondering if this may cause the problem?

Edit: I'm running the queries in python using the neo4j python driver version 1.7.4 and when I run the exact command --from which I get an error-- in the neo4j desktop command-line I don't get any error.

Pedram
  • 2,421
  • 4
  • 31
  • 49
  • 1
    Which version of Neo4j? And is that CREATE the entirety of the query? Or only a snippet? – InverseFalcon Jul 02 '19 at 18:39
  • @InverseFalcon good question, please see the edit. And, the CREATE is the only command that I have in my query. – Pedram Jul 02 '19 at 18:47
  • You've given us the version of the python driver, could you give us the Neo4j version too? – InverseFalcon Jul 02 '19 at 21:23
  • @InverseFalcon the Desktop version I'm using is 1.2.1 and it tells me my Neo4j is 3.5.6 Enterprise, does this make sense? – Pedram Jul 02 '19 at 21:58
  • Thanks. Deleting nodes shouldn't have anything to do with this. This is a very odd situation, can you shut down the instance and use [the consistency checker](https://neo4j.com/docs/operations-manual/current/tools/consistency-checker/) to see if anything's off about your db? Also, do you have any logs from the client side, on the Cypher that it's attempting to send to the server? – InverseFalcon Jul 02 '19 at 23:38
  • @InverseFalcon this is the report after running the consistency checker: `WARN : Label index was not properly shutdown and rebuild is required. Label index: neostore.labelscanstore.db WARN : Index was not properly shutdown and rebuild is required. Index[ IndexRule[id=1, descriptor=Index( UNIQUE, :label[0](property[0]) ), provider={key=native$ WARN : Index was not properly shutdown and rebuild is required. Index[ IndexRule[id=8, descriptor=Index( UNIQUE, :label[1](property[0]) ), provider={key=native$` – Pedram Jul 03 '19 at 14:36
  • See this answer: https://stackoverflow.com/a/53445532/974731 – cybersam Jul 09 '19 at 23:57

0 Answers0