Symptoms


During the test, the sales order got the status "Approval Request Submission Failed" and failed with the error "HTTP server returns error with code 401: The application returned an error message with a non-parsable JSON. Check the application logs to find out what went wrong."

Note: The below information is applicable to any component/microservice. Not just Approval Engine.


I checked the application logs (log of the corresponding pod) to find out what went wrong and found the following error: 

No such consumer key MDdm******************************MDdi


Cause

oauthkey and oauthsecret mismatch between CBC DB and helm values (K8s).


Resolution

Check the current key and secret in helm values of the corresponding microservice, for example:

$ helm get values approvalengineapp
USER-SUPPLIED VALUES:
dockerrepo: odindevops-a8n-docker-21-public.jfrog.io
jdbcconnectionparams: ?sslmode=require&ApplicationName=approvalengineapp
oauthkey: M2Y3Z***************************0Mzk5
oauthsecret: Ym*********************************Iw

As you can see, the oauthkey doesn't match the one that CBC platform expects to see (the one seen in the pod log).


Investigate the root cause.

It could happen due to multiple reasons. For example, someone could have re-deployed the microservice in K8s by accident.

If the reason is clear and you have mitigated the root cause, you may correct the key and secret here in the CBC control panel:


CBC PCP -> Applications (-> System Applications) -> click on the affected application -> click on the application instance -> Edit  Connection Settings 

Put the key and secret from helm values to the respective fields.