I deleted root=node(0) by accident, now what?

Showing 1-14 of 14 messages
I deleted root=node(0) by accident, now what? Mat Tyndall 6/5/12 4:35 PM
So I accidentally deleted node 0 while deleting relationships in the
data browser since it defaults to 0 instead of an adjacent node
(follow the arrow by default instead?).

Unfortunately, I used node 0 as the root in my code (node.js) to find
everything else. I could create a new root but then I'll have problems
syncing between local and online databases. I could use indexes
instead but that still creates annoying initialization problems. It
doesn't help that looking up nodes that don't exist is bad with
Cypher.

I know I can fix this, but it seems like a much bigger headache than
necessary since there is no way to create a new node(0) or undelete a
node.
Re: [Neo4j] I deleted root=node(0) by accident, now what? Michael Hunger 6/6/12 12:06 AM
You're right that's annoying.

I think it would make sense to have a confirmation dialog in webadmin when deleting node 0.

Can you raise a github issue for that?

Sorry for the extra work. How big is your db and can your recreate it, or export / import it into another db?

A simple way to do that is just to iterate over all nodes and relationships and recreate them and their properties.

If you need help for that I can provide you with a tool.

Michael
Re: [Neo4j] I deleted root=node(0) by accident, now what? TheOutlander 6/7/12 12:07 AM
Can this be an issue in Production where we could delete the root accidentally in code?? Wonder how many people have faced that problem.

-Nick
Re: [Neo4j] I deleted root=node(0) by accident, now what? Michael Hunger 6/7/12 12:15 AM
So far we haven't see that issue in production, only in development but it is better to be safe than sorry.

So can you please add two issues to github.com/neo4j/community
# a confirmation dialog in webadmin for the ref-node
# configurable option that inhibits deleting the root node

Thanks a lot

Michael
Re: [Neo4j] I deleted root=node(0) by accident, now what? Peter Neubauer 6/7/12 12:16 AM

Mmh,
That is why cascading deletion is not the default on the Java and REST apis. Webadmin was considered to be mostly for testing and introspection.

If you want to reliable address nodes, then I would consider using and index to store your root node and look it up instead of having an absolute id?

Send from mobile.

Re: [Neo4j] I deleted root=node(0) by accident, now what? TheOutlander 6/7/12 2:05 AM
Created Issue #590 and #591. Feel free to add any details as I'm new here and haven't followed any format for opening this.

Thanks,
Nick
Re: [Neo4j] I deleted root=node(0) by accident, now what? Michael Hunger 6/7/12 2:11 AM
That's fine, thanks a lot

Were you able to fix your db?

Michael
Re: [Neo4j] I deleted root=node(0) by accident, now what? Neil Barnwell 6/8/12 7:03 AM
It's possibly not my place, but I just wanted to throw my ten-penneth in.

Rather than adding functionality to the web admin interface, what about the more general solution of "locked" nodes/relationships? In a fresh database node 0 would be locked (though locking would generally be opt-in). Cascading deletes and accidents like the OP described would then throw a "CannotDeleteLockedObject" exception of some sort.

This idea is borrowed from digital cameras, which often offer this feature so you don't accidentally delete a favourite shot from your memory card when trying to free-up space.

HTH.

Neil.
RE: [Neo4j] I deleted root=node(0) by accident, now what? Rick Otten 6/8/12 7:38 AM

This sounds almost like being able to set ACL’s on nodes and relationships (except without the users and roles bit).

 

Why not go all the way and mark them for read, update, and delete ?  Throw in an equivalent to “insert”  to mean you are not allowed to create a relationship to or from this node.  I can’t think of a case where with only one user you’d ever want to take away ‘read’ permissions, so that would be the most basic permission level.

 

By default node 0 would be read only.  All of the other nodes, unless otherwise specified would default to read,update,insert,delete.

 

The biggest issue I could see with this is the performance overhead of having to check permissions when you are mutating the graph.

 

 

From: ne...@googlegroups.com [mailto:ne...@googlegroups.com] On Behalf Of Neil Barnwell
Sent: Friday, June 08, 2012 10:03 AM
To: ne...@googlegroups.com
Subject: Re: [Neo4j] I deleted root=node(0) by accident, now what?

Re: I deleted root=node(0) by accident, now what? Mat Tyndall 6/8/12 11:35 AM
So the solution I wound up going with was to just create a new
database, it was the simplest solution since the db was small.

The main reason I went with a reset is because with a fresh db all I
can count on is that there's a node 0, indexes and other nodes may or
may not exist.

I'm all in favor of changes that protect a root/reference node.

Thanks for all the replies,

-Mat

On Jun 8, 7:38 am, Rick Otten <rot...@manta.com> wrote:
> This sounds almost like being able to set ACL’s on nodes and relationships (except without the users and roles bit).
>
> Why not go all the way and mark them for read, update, and delete ?  Throw in an equivalent to “insert”  to mean you are not allowed to create a relationship to or from this node.  I can’t think of a case where with only one user you’d ever want to take away ‘read’ permissions, so that would be the most basic permission level.
>
> By default node 0 would be read only.  All of the other nodes, unless otherwise specified would default to read,update,insert,delete.
>
> The biggest issue I could see with this is the performance overhead of having to check permissions when you are mutating the graph.
>
> From: ne...@googlegroups.com [mailto:ne...@googlegroups.com] On Behalf Of Neil Barnwell
> Sent: Friday, June 08, 2012 10:03 AM
> To: ne...@googlegroups.com
> Subject: Re: [Neo4j] I deleted root=node(0) by accident, now what?
>
> It's possibly not my place, but I just wanted to throw my ten-penneth in.
>
> Rather than adding functionality to the web admin interface, what about the more general solution of "locked" nodes/relationships? In a fresh database node 0 would be locked (though locking would generally be opt-in). Cascading deletes and accidents like the OP described would then throw a "CannotDeleteLockedObject" exception of some sort.
>
> This idea is borrowed from digital cameras, which often offer this feature so you don't accidentally delete a favourite shot from your memory card when trying to free-up space.
>
> HTH.
>
> Neil.
>
> On Thursday, June 7, 2012 8:15:17 AM UTC+1, Michael Hunger wrote:
>
> So far we haven't see that issue in production, only in development but it is better to be safe than sorry.
>
> So can you please add two issues to github.com/neo4j/community<http://github.com/neo4j/community>
Re: [Neo4j] Re: I deleted root=node(0) by accident, now what? Peter Neubauer 6/10/12 1:24 AM

Mat,
Could you please raise a feature request for this?

Send from mobile.

Re: [Neo4j] Re: I deleted root=node(0) by accident, now what? Sean Sill 1/30/14 5:58 AM
Any updates on this particular problem?
Re: [Neo4j] Re: I deleted root=node(0) by accident, now what? Michael Hunger 1/30/14 6:33 AM
Sean,

the reference node was removed in Neo4j 2.0 so it shouldn't be a problem.

Otherwise just shut down your db, so that id's will be reused and after startup the next created node will get id 0.

Michael

-- 
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: [Neo4j] Re: I deleted root=node(0) by accident, now what? Sean Sill 1/30/14 6:34 AM
Fantastic!

Thanks!


--
You received this message because you are subscribed to a topic in the Google Groups "Neo4j" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/neo4j/Sb2ANlJtLDY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to neo4j+un...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Sean Sill
Electronic Systems Consultant/Contractor
Electrical and Computer Engineering Alumni from
Missouri University of Science and Technology(Missouri S&T)