[ https://issues.apache.org/jira/browse/RANGER-1000?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pradeep Agrawal reopened RANGER-1000: ------------------------------------- Reopening this to assign default policy type if policy type is not provided. > Tag service deletion failure due to MySQLIntegrityConstraintViolationException > ------------------------------------------------------------------------------ > > Key: RANGER-1000 > URL: https://issues.apache.org/jira/browse/RANGER-1000 > Project: Ranger > Issue Type: Bug > Components: Ranger > Affects Versions: 0.6.0 > Reporter: Pradeep Agrawal > Assignee: Pradeep Agrawal > Fix For: 0.6.0 > > Attachments: RANGER-1000-3.patch > > > Tag service deletion failed with a bad request error in one of the test > environments. > Delete was performed via Ranger Admin UI. > Request URL:http://localhost:6080/service/plugins/services/51 > Request Method:DELETE > Status Code:400 Bad Request > Remote Address:localhost:6080 > Response: > {"statusCode":1,"msgDesc":"XXService can't be > deleted","messageList":[{"name":"OPER_NOT_ALLOWED_FOR_STATE","rbKey":"xa.error.oper_not_allowed_for_state","message":" > Operation not allowed in current state","objectId":51}]} > Exception trace from xa_portal.log > {noformat} > 2016-05-25 08:57:32,424 [http-bio-6080-exec-32] ERROR > org.apache.ranger.service.RangerBaseModelService > (RangerBaseModelService.java:277) - Error deleting XXService. Id=51 > javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse > Persistence Services - 2.5.2.v20140319-9ad6abd): > 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_service`, CONSTRAINT `x_service_FK_tag_service` FOREIGN KEY > (`tag_service`) REFERENCES `x_service` (`id`)) > Error Code: 1451 > Call: DELETE FROM x_service WHERE ((id = ?) AND (version = ?)) > bind => [2 parameters bound] > Query: DeleteObjectQuery(XXService [id=51]) > at > org.eclipse.persistence.internal.jpa.EntityManagerImpl.flush(EntityManagerImpl.java:868) > at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > ...... > Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - > 2.5.2.v20140319-9ad6abd): 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_service`, CONSTRAINT `x_service_FK_tag_service` FOREIGN KEY > (`tag_service`) REFERENCES `x_service` (`id`)) > Error Code: 1451 > Call: DELETE FROM x_service WHERE ((id = ?) AND (version = ?)) > bind => [2 parameters bound] > Query: DeleteObjectQuery(XXService [id=51]) > at > org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:331) > at > org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:900) > at > org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeNoSelect(DatabaseAccessor.java:962) > ......... > Caused by: > com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: > Cannot delete or update a parent row: a foreign key constraint fails > (`ranger`.`x_service`, CONSTRAINT `x_service_FK_tag_service` FOREIGN KEY > (`tag_service`) REFERENCES `x_service` (`id`)) > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) > at > sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) > ......... > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)