-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Uncatchable throws on botbuilder-adapter-webex registerWebhookSubscription Functions #2217
Comments
facing similar issue while using this package in case of wrong token |
I've also faced a similar issue although not with botbuilder-adapter-webex, but with the built-in botkit adapter used for Microsoft Webchat integration, specifically when specifying a wrong token. @benbrown suggested a work-around which I haven't had a chance to implement yet (#2200 (comment)). The idea was to create custom webhook endpoints that would allow one to catch exceptions. Not sure if this might help you too. In any case, I wonder if 'promisifying' as suggested by @punithk could be applied to both situations, and be a better solution that requiring each botkit user to resolve via customization? |
Facing same issue in case of wrong token. Please suggest some solution. |
While using this package facing issue in case of wrong token. |
Facing an issue with this package when the token is changed. It crashes the application. |
I have also faced the same issue, the application crashes if the token has been altered |
Facing same issue in case of wrong token. Please suggest some solution. |
facing similar issue while using this package in case of wrong token |
I am also facing the similar issue while using this package in case of wrong token. |
Facing an issue with this package when the token is changed. It crashes the application. |
Hi @benbrown while using this botbuilder-webex-adaptor in my project whenever token is altered or changes it is causing my system to crash could you provide any solution. |
facing similar issue while using this package. Please suggest some solution. |
issue while using this package |
Did something change in Webex that caused this issue to occur more often... or are you all from the same company? |
My guess is that, just like it happened to me in issue #2200, developers are probably updating their node installations, which is the cause for the trouble (newer versions of node do not accept uncaught exceptions , and this causes the bot script to exit) |
@benbrown issue is that above code crashes if wrong credentials are passed and when we try to create a cycling credentials and some wrong credentials get in, due to which entire server crashes and does not allow to go any further. Other services in that server too does not run as the adapter invocation happens on the main flow. Issue is that error is thrown probably internally on a promise but the registerWebhookSubscription is not promisfied due to which we cannot catch this error and instead crashes the server. i have made the changes on this, and I see there are many such places where there are error thrown and since they are on promise we cannot catch them due to which it crashes. The changes made in my pull request is made in such a way that it wouldn't break existing code as well. So kindly check and let us know. |
Hi, I believe you can use the CLI flag You can check the nodejs documentation here : https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode |
hey, the above flag is good but if webex is initiating a webhook connection, like it was for our project, then that means the webhook will fail and then an uncaught exception is thrown and essentially, your webex webhook will not work. Instead, you can actually wait for uncaught exceptions. Add this at the entry point of your nodejs application:
Now, in case you have the same problem we did - where the webex webhook fails to initiate due to multiple server instances trying to initiate it at the same time, we implemented the retry mechanism using the RETRY_AFTER provided by the uncaught exception
Are you seeing unwanted error logs coming from the webex (npm) library? Override your console error instance:
|
Thanks for suggesting the above @penguinsource, as the same mechanism could be used for other errors too (not related to webex, slack, credentials, etc.) since any uncaught exception will otherwise cause the server to exit). |
We were using botbuilder-adapter-webex and I see there was an issue where we change or added wrong tokens from Webex the application crashes. There was no way to catch the error as the throw error was after asynchronous operation and that could not be caught by try catch.
What we tried was:
What we tried was:
What was the result you received?
Code crashed even with try catch.
What did you expect?
The error should be catchable on try catch or .then().catch(); so that it can be managed. If tokens expire or are changed it would simply crash the server which should not be the behavior instead it should be handled to gracefully let user decide.
Probable reason its happening:
Both
registerWebhookSubscription
andregisterAdaptiveCardWebhookSubscription
are not returning promise and throwing error asynchronously, wrapping it with a promise should fix it.Context:
Try to wrap and provide solution as a pull request
The text was updated successfully, but these errors were encountered: