question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Receives UnhandledPromiseRejectionWarning message during bot SSO

See original GitHub issue

Github 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:

  1. clone the sample
  2. do as the sample readme
  3. you may update the code in onInvokActivity to return 412 directly in server/bots/botActivityHandler.js
  4. See error

Expected behavior

The App should not crash down.

Screenshots

image

Additional context

Or any other suggestion?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
ceciliaavilacommented, Nov 17, 2022

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.

2reactions
JuanArcommented, Nov 7, 2022

Hi @JuanAr,

It appears we are able to repro this issue. Assigned this to you.

Please let me know if you have any questions. Happy to provide additional info. Thanks.

Hi @ramfattah, thanks for reporting and details. We added this issue to our backlog and we’ll be tackling it next week.

Thanks, Juan

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found