Skip to main content
Level 2
Jul 24, 2019 10:34 AM UTC
Solved

Asynchronous HttpClientRequest: Authentication Error Handling Issue

Hi,

I am invoking HttpCleintRequest asynchronously from the JavaScript within the workflow.

“compete” function is working fine in all scenarios the except following –

  • In case of invalid authorization token (due to validity expiration) it’s not invoking the complete handler. So, HttpClientRequest.wait activity is indefinitely waiting for the complete action to be performed for this request. I have waited till 1 hour for the completion, but still it’s not invoked (thought that it will set status as timeout in complete action)

  My question is how to handle this, which function need to implement to handle this scenario?

 

Getting below error in the log– 

Below is the sample code. Complete part is not invoking whenever there is any error in the Authorization value (highlighted)

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Jonathon_wodnicki
Jonathon_wodnickiAccepted solution
Community Advisor
Jul 31, 2019 4:20 PM UTC

Hi,

A cleaner workaround would be to forgo the buggy HTTPClientRequest() and instead use shell scripting with curl:

Is this a single call though?

Thanks,

-Jon

6 replies

Jonathon_wodnicki
Community Advisor
Community Advisor
Jul 24, 2019 1:58 PM UTC

Hi,

You have the params out of order in that execute() call, swap the last two.

Thanks,

-Jon

Translate
ADB407207Author
Level 2
Jul 25, 2019 5:42 AM UTC

Hi,

Tried to swap last 2 params. but in this case, valid scenarios (i.e. when token is valid) are also not working, always getting following error –

Thanks

Translate
Jonathon_wodnicki
Community Advisor
Community Advisor
Jul 25, 2019 2:41 PM UTC

Hi,

Make sure your URL is whitelisted in instance conf, or turn off URL security in instance conf.

Thanks,

-Jon

Translate
ADB407207Author
Level 2
Jul 26, 2019 10:47 AM UTC

Thanks for the reply Jon. However probably I was unable to explain the exact scenario, my code is working as expected for all scenarios. Only when somehow authorization fails, it was unable to invoke the complete operation. As a result the workflow was getting stuck (more specifically the JS activity), as HttpClientRequest.wait activity was waiting for the complete operation to be performed.
     For the workaround, created a separate monitoring workflow, which will monitor the process and it will kill and restart the main workflow during this scenario.

Thanks,

Sitangshu

Translate
pablo_rosero1
Level 9
Jul 30, 2019 10:14 PM UTC

Thanks for your help so far wodnicki​!

Any on why authorization fails getting the workflow stuck?

Translate
Jonathon_wodnicki
Community Advisor
Jonathon_wodnickiCommunity AdvisorAccepted solution
Community Advisor
Jul 31, 2019 4:20 PM UTC

Hi,

A cleaner workaround would be to forgo the buggy HTTPClientRequest() and instead use shell scripting with curl:

Is this a single call though?

Thanks,

-Jon

Translate