Asynchronous HttpClientRequest: Authentication Error Handling Issue

Avatar

Avatar
Give Back
Level 2
ADB407207
Level 2

Likes

3 likes

Total Posts

16 posts

Correct reply

0 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
Boost 3
Boost 1
View profile

Avatar
Give Back
Level 2
ADB407207
Level 2

Likes

3 likes

Total Posts

16 posts

Correct reply

0 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
Boost 3
Boost 1
View profile
ADB407207
Level 2

24-07-2019

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– 

1798789_pastedImage_0.png

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

1798857_pastedImage_2.png

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
MVP
wodnicki
MVP

Likes

977 likes

Total Posts

1,096 posts

Correct reply

515 solutions
Top badges earned
Establish
Affirm 500
Contributor
Shape 1
Give Back 100
View profile

Avatar
Establish
MVP
wodnicki
MVP

Likes

977 likes

Total Posts

1,096 posts

Correct reply

515 solutions
Top badges earned
Establish
Affirm 500
Contributor
Shape 1
Give Back 100
View profile
wodnicki
MVP

31-07-2019

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

Answers (5)

Answers (5)

Avatar

Avatar
Establish
MVP
wodnicki
MVP

Likes

977 likes

Total Posts

1,096 posts

Correct reply

515 solutions
Top badges earned
Establish
Affirm 500
Contributor
Shape 1
Give Back 100
View profile

Avatar
Establish
MVP
wodnicki
MVP

Likes

977 likes

Total Posts

1,096 posts

Correct reply

515 solutions
Top badges earned
Establish
Affirm 500
Contributor
Shape 1
Give Back 100
View profile
wodnicki
MVP

25-07-2019

Hi,

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

Thanks,

-Jon

Avatar

Avatar
Establish
MVP
wodnicki
MVP

Likes

977 likes

Total Posts

1,096 posts

Correct reply

515 solutions
Top badges earned
Establish
Affirm 500
Contributor
Shape 1
Give Back 100
View profile

Avatar
Establish
MVP
wodnicki
MVP

Likes

977 likes

Total Posts

1,096 posts

Correct reply

515 solutions
Top badges earned
Establish
Affirm 500
Contributor
Shape 1
Give Back 100
View profile
wodnicki
MVP

24-07-2019

Hi,

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

Thanks,

-Jon

Avatar

Avatar
Validate 250
Level 10
pablo_rosero1
Level 10

Likes

81 likes

Total Posts

348 posts

Correct reply

77 solutions
Top badges earned
Validate 250
Validate 100
Validate 50
Validate 25
Validate 10
View profile

Avatar
Validate 250
Level 10
pablo_rosero1
Level 10

Likes

81 likes

Total Posts

348 posts

Correct reply

77 solutions
Top badges earned
Validate 250
Validate 100
Validate 50
Validate 25
Validate 10
View profile
pablo_rosero1
Level 10

30-07-2019

Thanks for your help so far wodnicki​!

Any on why authorization fails getting the workflow stuck?

Avatar

Avatar
Give Back
Level 2
ADB407207
Level 2

Likes

3 likes

Total Posts

16 posts

Correct reply

0 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
Boost 3
Boost 1
View profile

Avatar
Give Back
Level 2
ADB407207
Level 2

Likes

3 likes

Total Posts

16 posts

Correct reply

0 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
Boost 3
Boost 1
View profile
ADB407207
Level 2

26-07-2019

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

Avatar

Avatar
Give Back
Level 2
ADB407207
Level 2

Likes

3 likes

Total Posts

16 posts

Correct reply

0 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
Boost 3
Boost 1
View profile

Avatar
Give Back
Level 2
ADB407207
Level 2

Likes

3 likes

Total Posts

16 posts

Correct reply

0 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
Boost 3
Boost 1
View profile
ADB407207
Level 2

24-07-2019

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 –

1799405_pastedImage_0.png

Thanks