I have a very broken node that makes some global query not working : ex
MATCH (g:Element) WHERE (g)--(:Type) return count(g) as cb
I receive the Error "Unable to load NODE with id 863321."
I ran consistency check on my DB with the command
java -cp '/usr/share/neo4j/lib/*' org.neo4j.consistency.ConsistencyCheckTool /var/lib/neo4j/data/databases/graph.db
And got this result
**ERROR: The source node is not in use.
Relationship[6290458,used=true,source=863321,target=546826,type=1,sCoun$
Inconsistent with: Node[863321,used=false,rel=6290458,prop=1077734,labe$**
ERROR: The node count does not correspond with the expected count.
CountsEntry[NodeKey[(:label=2)]: 265891]
Inconsistent with: 265892
ERROR: The node count does not correspond with the expected count.
CountsEntry[NodeKey[()]: 310316]
Inconsistent with: 310317
ERROR: The relationship count does not correspond with the expected count.
CountsEntry[RelationshipKey[(:label=2)-[:type=1]->()]: 263692]
Inconsistent with: 263691
ERROR: The relationship count does not correspond with the expected count.
CountsEntry[RelationshipKey[(:label=2)-->()]: 670545]
Inconsistent with: 670544
WARN : Inconsistencies found: ConsistencySummaryStatistics{
Number of errors: 5
Number of warnings: 0
Number of inconsistent RELATIONSHIP records: 1
Number of inconsistent COUNTS records: 4
Ok , fine, but when I try to get rid of either the not in use node
MATCH (n) WHERE id(n) = 863321 detach delete n)
it does not work
(no changes, no rows)
And when I try to delete the relationship hanging one arm in the air
MATCH ()-[r]-() WHERE id(r) = 6290458 detach delete r
or the other node
MATCH (n) WHERE id(n) = 546826 detach delete n
I have the same error :
Node[863321,used=false,rel=-1,prop=-1,labels=Inline(0x0:[]),light,secondaryUnitId=-1] not in use
What can I do to get rid of this bogus relationship ?
I already tryed to "rebuild schema" method deleting the shema folter and restarting. It does nothing.
Expected behavior: It should be able to delete the problematic relationship or the "not in use" node
Actual behavior: It refuse to
Thanks
You can copy the store using store-utils which will skip over broken nodes and rels.
Yes the procedure recommended by @ClosetSquirrel is probably your best bet. Your problem is an inconsistent store and you can't fix that by running normal cypher queries.
I use windows server, I tried Cygwin but nothing happened. it won't copy my old store to a new one.
Most helpful comment
You can copy the store using store-utils which will skip over broken nodes and rels.