Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete edge error: Cannot update record the resource has restricted access #6425

Closed
2 tasks done
VillHub opened this issue Jul 16, 2016 · 6 comments
Closed
2 tasks done
Assignees

Comments

@VillHub
Copy link

VillHub commented Jul 16, 2016

When deleting edge before creating got error
DELETE EDGE EdgeName FROM #8:1 to #9:1
CREATE EDGE EdgeName FROM #8:1 to #9:1 SET _allow =#4:1
"code": 500,
"reason": 500,
"content": "com.orientechnologies.orient.core.exception.OSecurityException: Cannot update record #10:1: the resource has restricted access

Error appeared after migrate from 2.1.0 to 2.2.4
Workaround:
No error when I get the Edge rid, and delete it after the new edge is created
var g = orient.getGraph();
var q = 'select FROM edgeName WHERE in = #9:1 AND out = #8:1'
var cDel = g.command("sql", q, []);
if (cDel.length) {
existingEdgeRid = cDel[0].getRecord().field("@Rid").toString();
}
CREATE EDGE EdgeName FROM #8:1 to #9:1 SET _allow =#4:1
DELETE EDGE existingEdgeRid

and some case no error when javascript
var q = 'DELETE EDGE EdgeName FROM #8:1 to #9:1'
var cDelrid = g.command("sql", q);
g.commit();
var q = 'CREATE EDGE EdgeName FROM #8:1 to #9:1 SET _allow =#4:1'
var createdrid = g.command("sql", q);
g.commit();

Error appears also when trying delete all edges with sql
DELETE EDGE EdgeName
the error appears but eventually the edge is been deleted anyway, but the process has been broken.
No errors with root user

OrientDB Version

  • v2.2.4

Java Version

  • 8
@luigidellaquila
Copy link
Member

Hi @vipuusepp

which user are you using to do these operations? Did you change the user/role permissions on your DB?

Any chance to have a working DB where to reproduce the error? Probably it depends on your schema and user/role configuration

Thanks

Luigi

@lvca
Copy link
Member

lvca commented Jul 18, 2016

Could you please provide more information about the way you delete the record and the security settings?

@lvca lvca self-assigned this Jul 18, 2016
@VillHub
Copy link
Author

VillHub commented Jul 18, 2016

Hi
first I found in user oRole rules data like this
{
"database.cluster.internal": 15,
"null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.database.query": 16,
"null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.database.query": 0,
"null.null.null.null.null.null.null.null.null.null.null.null.null.null.database.query": 16,
"null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.database.query": 1,
"null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.database.query": 4,
"null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.database.query": 8,
"database.systemclusters": 15,
"database.hook.record": 15,
"null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.null.database.query": 2,
"database.cluster.orole": 15,
"database": 2,
"null.null.null.null.null.null.null.null.null.database.query": 0,
"database.function": 15,
"database.schema": 15,
"database.cluster.ouser": 15,
"database.command": 15,
"database.cluster": 15,
"database.class": 15
}
I dont know when and how it mutated like this

I deleted it and now I have user permissions like this
{
"database.cluster.internal": 15,
"database.cluster.orole": 15,
"database": 2,
"database.function": 15,
"database.schema": 15,
"database.cluster.ouser": 15,
"database.systemclusters": 15,
"database.cluster": 15,
"database.query": 15,
"database.command": 15,
"database.class": 15,
"database.hook.record": 15
}

and when trying in studio sql execute (logged in with same user)
DELETE EDGE HoolduslepingHoone FROM #61:4232
got error
Cannot update record #201:72: the resource has restricted access
to result this command should delete 3 edges, but after error I got only one of the three edges deleted
when execute 3 times all edges got deleted.
Probably I have some data corrupted, because trying add and delete edges in sample base Gratefuldeadconcerts
seems like it works with no errors.
But when exported existing base and with console imported data to Gratefuldeadconcerts
the same error appeared in Gratefuldeadconcerts base also.
Any idea how to trace what could be causing this error.

@G4br13l3
Copy link
Contributor

Hi @vipuusepp,

could you provide us more info in order to reproduce the bug?

Thanks.

@VillHub
Copy link
Author

VillHub commented Dec 28, 2016

Hi

to reproduce just alter class E and V to Orestricted superclass
then make some Vertice classses and one edge class for example Vtest1, Vtest2 and Etest1
Login as user , not as root or admin.
for example I used default account "writer"

Now query
CREATE CLASS Vtest1 extends V
CREATE CLASS Vtest2 extends V
CREATE CLASS Etest1 extends E

Create Vertex Vtest1 set test="v1"
return #1:0
Create Vertex Vtest2 set test="v2"
return #2:0
Create EDGE Etest1 from #1:0 to #2:0 set etest = "e1"
Create EDGE Etest1 from #1:0 to #2:0 set etest = "e2"
Create EDGE Etest1 from #1:0 to #2:0 set etest = "e3"
Create EDGE Etest1 from #1:0 to #2:0 set etest = "e4"

error appear wher query
DELETE EDGE Etest1

@SDIPro SDIPro self-assigned this Jan 30, 2017
@SDIPro SDIPro closed this as completed Feb 15, 2017
@SDIPro
Copy link
Contributor

SDIPro commented Feb 15, 2017

No response from customer. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants