-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74213/#review224918
-----------------------------------------------------------


Ship it!




Ship It!

- Dineshkumar Yadav


On Nov. 23, 2022, 6:57 p.m., Pradeep Agrawal wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74213/
> -----------------------------------------------------------
> 
> (Updated Nov. 23, 2022, 6:57 p.m.)
> 
> 
> Review request for ranger, bhavik patel, Abhay Kulkarni, Madhan Neethiraj, 
> Nikhil P, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and 
> Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-3977
>     https://issues.apache.org/jira/browse/RANGER-3977
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> **Problem Statement:** Ranger's TagRest API deleteTagResourceMapByGuid is 
> calling deleteServiceResource() rather deleteTagResourceMap()
> 
> Sample curl request: curl -u 'admin:SecretPass@123' -X DELETE 
> 'http://localhost:6080/service/tags/tagresourcemap/guid/58fde8a1-5d01-485d-843b-c84bc60d0e5f'
>  -H 'Accept: application/json' -H 'Content-Type: application/json'
> 
> Response: 400 bad request
> 
> Error message: 
> 2022-11-23 23:26:32,132 INFO org.apache.ranger.common.RESTErrorUtil: Request 
> failed. loginId=admin, logMessage=XXServiceResource can't be d
> eleted
> javax.ws.rs.WebApplicationException
> ...
> 2022-11-23 23:26:32,133 INFO org.apache.ranger.common.RESTErrorUtil: 
> Validation error:logMessage=44, error=Exception [EclipseLink-4002] (Ecl
> ipse Persistence Services - 2.7.7.v20200504-69f2c2b80d): 
> org.eclipse.persistence.exceptions.DatabaseException
> Internal Exception: org.postgresql.util.PSQLException: ERROR: update or 
> delete on table "x_service_resource" violates foreign key constraint
>  "x_tag_res_map_fk_res_id" on table "x_tag_resource_map"
>   Detail: Key (id)=(44) is still referenced from table "x_tag_resource_map".
> Error Code: 0
> Call: DELETE FROM x_service_resource WHERE ((id = ?) AND (version = ?))
>         bind => [2 parameters bound], 
> response=VXResponse={org.apache.ranger.view.VXResponse@39100f8statusCode={1} 
> msgDesc={XXServiceResourc
> e can't be deleted} 
> messageList={[VXMessage={org.apache.ranger.view.VXMessage@df9230fname={OPER_NOT_ALLOWED_FOR_STATE}
>  rbKey={xa.error.oper_
> not_allowed_for_state} message={Operation not allowed in current state} 
> objectId={44} fieldName={null} }]} }
> javax.ws.rs.WebApplicationException
>         at 
> org.apache.ranger.common.RESTErrorUtil.createRESTException(RESTErrorUtil.java:56)
> 
> 
> Diffs
> -----
> 
>   security-admin/src/main/java/org/apache/ranger/rest/TagREST.java 0d29a95ca 
>   security-admin/src/test/java/org/apache/ranger/rest/TestTagREST.java 
> 7fba152a9 
> 
> 
> Diff: https://reviews.apache.org/r/74213/diff/1/
> 
> 
> Testing
> -------
> 
> Tested the above mentioned curl request with the proposed patch and request 
> completed successfully with response code 200 OK and output 
> 
> {"id":44,"guid":"58fde8a1-5d01-485d-843b-c84bc60d0e5f","isEnabled":true,"createdBy":"admin","updatedBy":"admin","createTime":1669122505391,"updateTime":1669122505391,"tagId":62,"resourceId":63}
> 
> 
> Thanks,
> 
> Pradeep Agrawal
> 
>

Reply via email to