REST API call returns no response with ClientProtocolException: null error

Hi, 


API call returns no response with ClientProtocolException: null for DELETE operation. No changes made in the existing payload/resources in driver config, but the REST driver throws this error since a few days. And other methods are working fine, they return a valid response. 

[08/10/24 17:07:15.939]:REST-Driver Logs ST:REST-Driver: RESTSubscriptionShim.execute() :
[08/10/24 17:07:15.939]:REST-Driver Logs ST:REST-Driver: modifyHandler
[08/10/24 17:07:15.939]:REST-Driver Logs ST:REST-Driver: modifyHandler: class-name == 'RemoveUserFromGroup'
[08/10/24 17:07:15.940]:REST-Driver Logs ST:REST-Driver: Modify: preparing DELETE to gw.sit1.api.srv.abc.com.au/.../users
[08/10/24 17:07:15.940]:REST-Driver Logs ST:REST-Driver: Resetting headers
[08/10/24 17:07:15.941]:REST-Driver Logs ST:REST-Driver: Setting the following HTTP request properties:
Authorization: <content suppressed>
[08/10/24 17:07:15.941]:REST-Driver Logs ST:REST-Driver: Content-Length:0
[08/10/24 17:07:15.941]:REST-Driver Logs ST:REST-Driver: Content-Type:application/json
[08/10/24 17:07:15.942]:REST-Driver Logs ST:REST-Driver: Did a HTTP DELETE with 0 bytes of data to gw.sit1.api.srv.abc.com.au/.../users
[08/10/24 17:07:15.943]:REST-Driver Logs ST:REST-Driver: modifyHandler
[08/10/24 17:07:15.943]:REST-Driver Logs ST:REST-Driver: modifyHandler: class-name == 'UpdateProfileInUser'
[08/10/24 17:07:15.943]:REST-Driver Logs ST:REST-Driver: Modify: preparing PUT to gw.sit1.api.srv.abc.com.au/.../186189
[08/10/24 17:07:15.944]:REST-Driver Logs ST:REST-Driver: Resetting headers
[08/10/24 17:07:15.944]:REST-Driver Logs ST:REST-Driver: Setting the following HTTP request properties:
Authorization: <content suppressed>
[08/10/24 17:07:15.944]:REST-Driver Logs ST:REST-Driver: Content-Type:application/json
[08/10/24 17:07:15.945]:REST-Driver Logs ST:REST-Driver: Did a HTTP PUT with 141 bytes of data to gw.sit1.api.srv.abc.com.au/.../186189
[08/10/24 17:07:16.230]:REST-Driver Logs ST:REST-Driver: Response code and message: 404 Not Found
[08/10/24 17:07:16.231]:REST-Driver Logs ST:SubscriptionShim.execute() returned:
[08/10/24 17:07:16.232]:REST-Driver Logs ST:
<nds dtdversion="3.0">
<source>
<product build="20240304_0430" version="1.3.0.0000">Identity Manager REST Driver</product>
<contact>NetIQ Corporation.</contact>
</source>
<output>
<status level="error" type="app-general">ClientProtocolException: null</status>
<status level="error" type="driver-general">
<driver-operation-data class-name="UpdateProfileInUser" command="modify" dest-dn="\SITGROUPIDM\data\users\ABC2345" matchuserid="12345" src-dn="\SITGROUPIDM\data\users\ABC2345">
<response>
<header Content-Type="application/json"/>
<url-token association="186189"/>
<response-header Connection="keep-alive" Content-Language="en" Content-Length="117" Content-Security-Policy="frame-ancestors 'none'; upgrade-insecure-requests" Content-Type="application/json" Date="Sat, 10 Aug 2024 07:07:16 GMT" Keep-Alive="timeout=60" Max-Forwards="20" Referrer-Policy="strict-origin" Server="abc" Set-Cookie="N-ISD-A008E0-443-CK=2679662602.47873.0000; path=/; Httponly; Secure" Strict-Transport-Security="max-age=63072000; includeSubdomains; preload" X-Content-Type-Options="nosniff" X-Frame-Options="DENY" X-UA-Compatible="IE=Edge" X-XSS-Protection="1;mode=block"/>

<value message="Not Found" status="404">{"code":"404","message":"Not Found - OP-05062: The requested user was not found. [V9X2WXZJLTZS]","errorCode":"-5062"}</value>
</response>
</driver-operation-data>
</status>
</output>
</nds>

Thanks in advance,

Sathish

  • 0  

    You are sending a HTTP DELETE 'command' (Event?  NOt sure what the HTTP PUT/PATHC/DELETE/GET/POST action is called) and it is responding with a 404 error. Page not found.  The URL:
    https://gw.sit1.api.srv.abc.com.au/users/186189?isName=false

    Did not return a result.  So it would usggest the object referenced does not exist at the time the DELETE is sent.

  • 0 in reply to   

    Hi Geoffrey, 

    There are two API endpoints called for the event, for 1st API call (DELETE), no response received and for 2nd API call (PUT), received 404 error. So I am not sure why the delete method returns 'ClientProtocolException: null" error. When we checked in the target log, they also do not see any trace related to this API call. So the 404 error received is for both Delete and PUT?

  • 0   in reply to 

    Hello, what happens if you replicate those calls in Postman?

    While looking at this several questions came to mind,

    • why do you want delete a user if it is only removal from group,
    • how is the user deleted with that call (it looks like no part of that call defines which user to delete)
    • and finally are you trying to edit a user that you have just deleted (that does not seem like something that should work - if you delete a user you cannot edit him)?

    Please disregard these questions if you find the solution with the first suggestion. But if you still have problems then I would wonder about those questions and also more trace would help (the event that is sent to the trace, what are we doing with two calls).

  • 0 in reply to   

    Hi Zan,

    Below is the trace, and you can see DELETE method returns no response and PUT method returns the response. Delete method is used to remove user from a group and PUT method is used to update the user profile.


    And the same API call is working fine and returns the response as expected via Postman and curl command as well. But the Delete method is not working thru Rest driver. Even I upgraded the driver package to latest version with respect to IDM 4.9 as we have recently upgraded IDM to IDM 4.9 but still no luck. 

    This issue occurred recently after IDM upgrade.

    Authorization: <content suppressed>
    [08/21/24 17:48:22.312]:REST Logs ST:REST: Content-Length:0
    [08/21/24 17:48:22.313]:REST Logs ST:REST: Content-Type:application/json
    [08/21/24 17:48:22.313]:REST Logs ST:REST: Did a HTTP DELETE with 0 bytes of data to gw.sit1.api.srv.abc.com/.../users
    [08/21/24 17:48:22.314]:REST Logs ST:REST: *******************************************************
    [08/21/24 17:48:22.314]:REST Logs ST:REST: **********************LOGGING REQUEST******************
    [08/21/24 17:48:22.314]:REST Logs ST:REST: *******************************************************
    [08/21/24 17:48:22.315]:REST Logs ST:REST: Request URL :gw.sit1.api.srv.abc.com/.../users
    [08/21/24 17:48:22.315]:REST Logs ST:REST: Http Method : DELETE
    [08/21/24 17:48:22.316]:REST Logs ST:REST: Sending http request with below headers :-
    [08/21/24 17:48:22.316]:REST Logs ST:REST: Authorization: <content suppressed>
    [08/21/24 17:48:22.316]:REST Logs ST:REST: Content-Length: 0
    [08/21/24 17:48:22.316]:REST Logs ST:REST: Content-Type: application/json
    [08/21/24 17:48:22.317]:REST Logs ST:REST: ***************************END**************************
    [08/21/24 17:48:22.317]:REST Logs ST:REST: modifyHandler
    [08/21/24 17:48:22.318]:REST Logs ST:REST: modifyHandler: class-name == 'UpdateProfileInUser'
    [08/21/24 17:48:22.318]:REST Logs ST:REST: Modify: preparing PUT to gw.sit1.api.srv.abc.com/.../1386771
    [08/21/24 17:48:22.319]:REST Logs ST:REST: Resetting headers
    [08/21/24 17:48:22.319]:REST Logs ST:REST: Setting the following HTTP request properties:
    Authorization: <content suppressed>
    [08/21/24 17:48:22.319]:REST Logs ST:REST: Content-Type:application/json
    [08/21/24 17:48:22.319]:REST Logs ST:REST: Did a HTTP PUT with 141 bytes of data to gw.sit1.api.srv.abc.com/.../1386771
    [08/21/24 17:48:22.320]:REST Logs ST:REST: *******************************************************
    [08/21/24 17:48:22.320]:REST Logs ST:REST: **********************LOGGING REQUEST******************
    [08/21/24 17:48:22.321]:REST Logs ST:REST: *******************************************************
    [08/21/24 17:48:22.321]:REST Logs ST:REST: Request URL :gw.sit1.api.srv.abc.com/.../1386771
    [08/21/24 17:48:22.322]:REST Logs ST:REST: Http Method : PUT
    [08/21/24 17:48:22.322]:REST Logs ST:REST: Sending http request with below headers :-
    [08/21/24 17:48:22.322]:REST Logs ST:REST: Authorization: <content suppressed>
    [08/21/24 17:48:22.323]:REST Logs ST:REST: Content-Type: application/json
    [08/21/24 17:48:22.323]:REST Logs ST:REST: ***************************END**************************
    [08/21/24 17:48:28.424]:REST Logs ST:REST: ********************************************************
    [08/21/24 17:48:28.424]:REST Logs ST:REST: ***********************LOGGING RESPONSE*****************
    [08/21/24 17:48:28.425]:REST Logs ST:REST: ********************************************************
    [08/21/24 17:48:28.425]:REST Logs ST:REST: Http response code : 200
    [08/21/24 17:48:28.425]:REST Logs ST:REST: Http response status : HTTP/1.1 200 OK
    [08/21/24 17:48:28.426]:REST Logs ST:REST: Getting http response with below headers :-
    [08/21/24 17:48:28.426]:REST Logs ST:REST: Server: abc

  • 0   in reply to 

    The response to the DELETE seems to be missing.

    Do you still get the ClientProtocolException if you send just one command - either DELETE or PUT?

    It would also be interesting to see the actual bytes being send an received. The easiest way to do that is probably to setup an intercepting proxy with https://httptoolkit.com/ or https://portswigger.net/burp/communitydownload

  • 0 in reply to   

    Hi Norbert,

    Sure, I will try with one command. But do you have any idea why the DELETE method is not returning any response and throws "ClientProtocolException: null" error?

    Thanks in advance!

  • Suggested Answer

    0 in reply to 

    Hi All,

    FYI. Issue has been resolved after removing Content-Length from header. Not sure why all of sudden API did not accept the content length in header.

  • 0   in reply to 

    The content-length header should be calculated by the client, not supplied manually as a header.

    Some tools are getting really strict about that now.

  • 0   in reply to 

    Wild!  How did you figure that out?  Was it working with the endpoint vendor?  That is a crazy one.