ranger-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "rangerqa (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (RANGER-204) Not able to delete user or group if user/group has any policy defined.
Date Sat, 30 Jan 2016 12:21:39 GMT

    [ https://issues.apache.org/jira/browse/RANGER-204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15124871#comment-15124871
] 

rangerqa commented on RANGER-204:
---------------------------------

{color:green}+1 overall{color}.  Here are the results of testing the latest attachment
  http://issues.apache.org/jira/secure/attachment/12784571/RANGER-204.patch
  against master revision 870070f.

    {color:green}+1 @author{color}.  The patch does not contain any @author tags.

    {color:green}+1 tests included{color}.  The patch appears to include 1 new or modified
test files.

    {color:green}+1 javac{color}.  The applied patch does not increase the total number of
javac compiler warnings.

    {color:green}+1 javadoc{color}.  There were no new javadoc warning messages.

    +1 checkstyle.  The patch generated 0 code style errors.

    {color:green}+1 findbugs{color}.  The patch does not introduce any new Findbugs (version
2.0.3) warnings.

    {color:green}+1 release audit{color}.  The applied patch does not increase the total number
of release audit warnings.

    {color:green}+1 core tests{color}.  The patch passed unit tests in .

Test results: https://builds.apache.org/job/PreCommit-RANGER-Build/25//testReport/
Console output: https://builds.apache.org/job/PreCommit-RANGER-Build/25//console

This message is automatically generated.

> Not able to delete user or group if user/group has any policy defined.
> ----------------------------------------------------------------------
>
>                 Key: RANGER-204
>                 URL: https://issues.apache.org/jira/browse/RANGER-204
>             Project: Ranger
>          Issue Type: Bug
>    Affects Versions: 0.4.0
>            Reporter: Hanish Bansal
>            Assignee: Gautam Borad
>             Fix For: 0.5.0
>
>         Attachments: RANGER-204.patch
>
>
> If a user/group has some policy assigned (entry in x_perm_map table of database) then
delete rest api is not able to delete user/group.
> It gives "404 not found" error that is not proper exception message.
> {quote}
> In log file catalina.out, below exception message is coming:
> [EL Warning]: 2014-12-26 16:24:02.643--UnitOfWork(382747336)--Exception [EclipseLink-4002]
(Eclipse Persistence Services - 2.5.2.v20131113-a7346c6): org.eclipse.persistence.exceptions.DatabaseException
> Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:
Cannot delete or update a parent row: a foreign key constraint fails (`ranger`.`x_perm_map`,
CONSTRAINT `x_perm_map_FK_group_id` FOREIGN KEY (`group_id`) REFERENCES `x_group` (`id`))
> Error Code: 1451
> Call: DELETE FROM x_group WHERE (ID = ?)
>     bind => [1 parameter bound]
> Query: DeleteObjectQuery(XXGroup={XXDBBase={createTime={Thu Dec 25 12:41:06 IST 2014}
updateTime={Thu Dec 25 12:41:06 IST 2014} addedByUserId={1} updatedByUserId={1} }name={Group5}
description={} status={0} groupType={0} credStoreId={null} groupSrc={0} })
> Dec 26, 2014 4:24:02 PM com.sun.jersey.spi.container.ContainerResponse mapMappableContainerException
> SEVERE: The RuntimeException could not be mapped to a response, re-throwing to the HTTP
container
> javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence
Services - 2.5.2.v20131113-a7346c6): org.eclipse.persistence.exceptions.DatabaseException
> Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:
Cannot delete or update a parent row: a foreign key constraint fails (`ranger`.`x_perm_map`,
CONSTRAINT `x_perm_map_FK_group_id` FOREIGN KEY (`group_id`) REFERENCES `x_group` (`id`))
> Error Code: 1451
> Call: DELETE FROM x_group WHERE (ID = ?)
>     bind => [1 parameter bound]
> Query: DeleteObjectQuery(XXGroup={XXDBBase={createTime={Thu Dec 25 12:41:06 IST 2014}
updateTime={Thu Dec 25 12:41:06 IST 2014} addedByUserId={1} updatedByUserId={1} }name={Group5}
description={} status={0} groupType={0} credStoreId={null} groupSrc={0} })
>     at org.eclipse.persistence.internal.jpa.EntityManagerImpl.flush(EntityManagerImpl.java:868)
>     at sun.reflect.GeneratedMethodAccessor46.invoke(Unknown Source)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke(Method.java:606)
>     at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:240)
>     at com.sun.proxy.$Proxy20.flush(Unknown Source)
>     at org.apache.ranger.common.db.BaseDao.remove(BaseDao.java:106)
>     at org.apache.ranger.common.db.BaseDao.remove(BaseDao.java:97)
>     at org.apache.ranger.biz.XUserMgr.deleteXGroup(XUserMgr.java:77)
>     at org.apache.ranger.rest.XUserREST.deleteXGroupByGroupName(XUserREST.java:545)
>     at org.apache.ranger.rest.XUserREST$$FastClassByCGLIB$$b2a65360.invoke(<generated>)
>     at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
>     at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
>     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
>     at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
>     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>     at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
>     at org.apache.ranger.rest.XUserREST$$EnhancerByCGLIB$$246afd5.deleteXGroupByGroupName(<generated>)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke(Method.java:606)
>     at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$VoidOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:151)
>     at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:70)
>     at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:279)
>     at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:136)
>     at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:86)
>     at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:136)
>     at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:74)
>     at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1357)
>     at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1289)
>     at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1239)
>     at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1229)
>     at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:420)
>     at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:497)
>     at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:684)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
>     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
>     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
>     at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
>     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
>     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
>     at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:186)
>     at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
>     at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
>     at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
>     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
>     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
>     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
>     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
>     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
>     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
>     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
>     at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
>     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
>     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
>     at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
>     at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
>     at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
>     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>     at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
>     at java.lang.Thread.run(Thread.java:744)
> Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20131113-a7346c6):
org.eclipse.persistence.exceptions.DatabaseException
> Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:
Cannot delete or update a parent row: a foreign key constraint fails (`ranger`.`x_perm_map`,
CONSTRAINT `x_perm_map_FK_group_id` FOREIGN KEY (`group_id`) REFERENCES `x_group` (`id`))
> {quote}
> Rest apis used for delete are:
> {quote}
> DELETE http://<ip>:6080/service/xusers/users/userName/<userName>
> DELETE http://<ip>:6080/service/xusers/groups/groupName/<groupName>
> DELETE http://<ip>:6080/service/xusers/groups/<id>
> DELETE http://<ip>:6080/service/xusers/users/<id>
> {quote}
> If user/group don't have any policy assigned then user/group get successfully deleted
and get invisible from UI. Also mapping of user-group get deleted from database(x_group_users
table).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message