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

Wrong exception handling in distributed mode #2630

Closed
henryzhao81 opened this issue Jul 29, 2014 · 2 comments
Closed

Wrong exception handling in distributed mode #2630

henryzhao81 opened this issue Jul 29, 2014 · 2 comments
Assignees
Milestone

Comments

@henryzhao81
Copy link
Contributor

I am using 1.7.6 under distributed mode,

When I query result in remote server, I set rule which not allow current login user to access remote cluter.

In Remote server(node1392928786390) , it returns response: com.orientechnologies.orient.core.exception.OSecurityAccessException: User 'testadmin1' has no the permission to execute the operation 'Read' against the resource: database.cluster.*, which is correct. I run console in (node1392928786389), the result should be the same as no access to cluster but what I got is another exception.

orientdb {pharos}> select from bodyAngle where user = #11:1379 limit 10

Error: com.orientechnologies.orient.core.exception.OStorageException: Cannot route COMMAND operation to the distributed node

Error: java.lang.ClassCastException: com.orientechnologies.orient.core.exception.OSecurityAccessException cannot be cast to java.util.Collection

Following are the exception stack log :
com.orientechnologies.orient.core.exception.OSecurityAccessException cannot be cast to java.util.Collection
-> com.orientechnologies.orient.server.distributed.ODistributedStorage.command(ODistributedStorage.java:281)
-> com.orientechnologies.orient.core.sql.query.OSQLQuery.run(OSQLQuery.java:69)
-> com.orientechnologies.orient.core.sql.query.OSQLSynchQuery.run(OSQLSynchQuery.java:80)
-> com.orientechnologies.orient.core.query.OQueryAbstract.execute(OQueryAbstract.java:29)
-> com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.command(ONetworkProtocolBinary.java:1181)
-> com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.executeRequest(ONetworkProtocolBinary.java:340)
-> com.orientechnologies.orient.server.network.protocol.binary.OBinaryNetworkProtocolAbstract.execute(OBinaryNetworkProtocolAbstract.java:169)
-> com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:45)

I do a debug, in my case node1392928786389 is local node which I send request by console, node1392928786390 is remote node. Response from node1392928786389 is ok, but for node1392928786390 actually is exception string.
In class ODistributedStorage.java, function command(final OCommandRequestText iCommand), line 281, the result expect to be a collection object, it remote node return other format will throw class cast exception.

Following are debug info for (Map<String, Object>) result.
{node1392928786389=com.orientechnologies.orient.core.sql.query.OResultSet@1, node1392928786390=com.orientechnologies.orient.core.exception.OSecurityAccessException: User 'testadmin1' has no the permission to execute the operation 'Read' against the resource: database.cluster.*}

@lvca lvca added this to the 1.7.8 milestone Jul 29, 2014
@lvca lvca self-assigned this Jul 29, 2014
lvca added a commit that referenced this issue Jul 29, 2014
@lvca
Copy link
Member

lvca commented Jul 29, 2014

Please let me know if now works as expected.

@lvca lvca closed this as completed Jul 29, 2014
@henryzhao81
Copy link
Contributor Author

It works, Thanks Luca

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

2 participants