Question

Getting response code 401for rest connector although password is correct

Hi,

Sometime I am getting response code of rest connector 401 in production although password is correct.

I am using Auth profile for authentication and Preemptive authentication check box is checked

Error Message:

STATUS="FATAL" ; RESPONSE_CODE="401"; EVENT_MESSAGE="Publish Event API has returned an error. STATUS_VALUE=Fail:InternalReason ; RESPONSE_MESSAGE= ERROR_MESSAGE= com.pega.pegarules.pub.services.InboundMappingException: Error mapping incoming response to .response_POST: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')

Comments

Keep up to date on this post and subscribe to comments

Pega
July 6, 2018 - 8:21am

 

Hi,

Could you please increase logging level for that specific class in Designer Studio and then check logs again? 

Could you also enable logging on Load balancer or if this is a single server on the network device and analyze network traffic? If this is an intermittent problem it can be an issue with the network, and from time to time server receives broken json or html. 

 

 

Pega
July 6, 2018 - 8:59am

What error do you get when the password is incorrect ?

Do you still get the same error if you use an incorrect username as well ?

 

July 17, 2018 - 9:09pm
Response to JOHNPW_GCS

Yes, if password is wrong then I am getting the same error message . I have tried this one in lower environment  

Pega
July 6, 2018 - 9:04am

I agree with the post above - you need to get some more logging (and possibly 'sniffing') going on here to double-check.

Here's a theory though:

1. You have a Load Balancer - and/or a Proxy and/or you are using Single Sign On ....

2. The Load Balancer (or Proxy....) is intercepting your outgoing request; and for whatever reason has decided you are NOT authenticated. (Hence the 401).

3. The apparent PARSE message; it may be that this Load Balancer (Proxy whatever) is talking back not in JSON, but in HTML (or XML)....

Regardless if my theory above is correct or incorrect; I still think it would be correct for you to intercept that HTTP 401 message - and payload - from the server for the next clue as to what could be going wrong here.

 

July 17, 2019 - 10:38am

Hi,

Please refer the below URL for clear explanation for all the Response Code
https://www.restapitutorial.com/httpstatuscodes.html

Pega
July 18, 2019 - 1:46am

Hi,

Can you enable debug mode for the below class, so that we can see the request and response and we can analyze the response from rest connector why it is not able to map the response.

com.pega.pegarules.integration.engine.internal.connect.rest.RESTConnector

Thank You,