Receives UnhandledPromiseRejectionWarning message during bot SSO
See original GitHub issueGithub issues should be used for bugs and feature requests. Use Stack Overflow for general “how-to” questions.
Versions
“botbuilder”: “^4.15.0”. Node.js 16-latest chrome-latest windows-latest
Describe the bug
Try this sample when the bot onInvokeActivity
directly return 412 in server/bots/botActivityHandler.js
the app crash down because BotFrameworkAdapter.processActivity
throw exception once there is a 412 response but in the index.ts
don’t handle this exception.
Bot Started, restify listening to http://[::]:3978
Debugger attached.
/Users/kimjason/projects/teams-apps/pradeep-sso/query-org-user-with-message-extension-sso/bot/node_modules/botbuilder/src/botFrameworkAdapter.ts:1275
throw new Error(`BotFrameworkAdapter.processActivity(): ${status} ERROR`);
^
Error: BotFrameworkAdapter.processActivity(): 412 ERROR
at BotFrameworkAdapter.<anonymous> (/Users/kimjason/projects/teams-apps/pradeep-sso/query-org-user-with-message-extension-sso/bot/node_modules/botbuilder/src/botFrameworkAdapter.ts:1275:23)
at Generator.next (<anonymous>)
at fulfilled (/Users/kimjason/projects/teams-apps/pradeep-sso/query-org-user-with-message-extension-sso/bot/node_modules/botbuilder/lib/botFrameworkAdapter.js:12:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Waiting for the debugger to disconnect...
[nodemon] app crashed - waiting for file changes before starting...
To Reproduce
Steps to reproduce the behavior:
- clone the sample
- do as the sample readme
- you may update the code in
onInvokActivity
to return 412 directly inserver/bots/botActivityHandler.js
- See error
Expected behavior
The App should not crash down.
Screenshots
Additional context
Or any other suggestion?
Issue Analytics
- State:
- Created a year ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Oauth error unhandled in SDK · Issue #3882 - GitHub
Running dialog with Message Activity. (node:22472) UnhandledPromiseRejectionWarning: Error: BotFrameworkAdapter.processActivity(): 412 ERROR at ...
Read more >how do i fix this? UnhandledPromiseRejectionWarning
First of all, welcome to stackoverflow! The problem in your code is that the callback in the client.on('message', [the_callback]) is an ...
Read more >Microsoft/BotBuilder - Gitter
my bot has sucessfully created new Group and Tab in MS Teams but I can't create conversation, I'm getting 405 BadArgument This channel...
Read more >Resolve "The security token included in the request is expired ...
My Java applications using the AWS SDK for Java on an Amazon Elastic Compute Cloud (Amazon EC2) instance receive an exception similar to...
Read more >Troubleshooting Bot Framework Authentication - Bot Service
Learn how to troubleshoot bot authentication errors, such as connectivity issues and problems with app IDs and passwords.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi everyone, We found a similar issue that was closed because, for SSO flows, the 412 errors are frequent, and in case you want to ignore them, you should catch them in the bot’s code. Additionally, as BotFrameworkAdapter is deprecated, the recommended path is to use CloudAdapter. We tested the sample using CloudAdapter, and the app doesn’t crash when facing 412 errors because it doesn’t get any UnhandledPromiseRejectionWarnings. We believe this issue should be closed, and we recommend applying one of the above solutions.
Hi @ramfattah, thanks for reporting and details. We added this issue to our backlog and we’ll be tackling it next week.
Thanks, Juan