Botframework-emulator: 500 Error when changing AppId/Pass. Requires Emulator restart.

Created on 22 May 2019  路  9Comments  路  Source: microsoft/BotFramework-Emulator

Related (probably): https://github.com/microsoft/BotBuilder-Samples/issues/1523

I've seen this happen before, too.

Version

4.4.1-60043 (although I'm fairly certain this isn't new)

Describe the bug

In order for a change to MicrosoftAppId / MicrosoftAppPassword to take effect in the Emulator, the whole Emulator application must be restarted, not just the opened bot or the "Live Chat" window. I have a feeling this is tied to caching it for an endpoint, but I haven't tested different endpoints.

This can be a problem in the following scenarios:

  1. Having a typo in appId/pass and then trying to change it. It will appear to never work unless user restarts Emulator
  2. Testing a local bot with and without an appId/appPass
  3. Testing multiple bots on the localhost endpoint
  4. Needing to change the password while testing -- maybe user accidentally uploads to repo

To Reproduce

Get two valid AppIds/AppPasswords. I'll refer to them as AppA/PassA, AppB/PassB.

FAIL:

  1. Start a bot with AppA/PassA set in appsettings.json
  2. Connect to the bot in Emulator using Open Bot, using AppA/PassA
  3. Stop the bot
  4. Change the bot to use AppB/PassB in appsettings.json
  5. Close Live Chat window in Emulator
  6. Open Bot in Emulator with AppB/PassB
  7. Receive 500 Error
  8. Close Emulator entirely
  9. Open Bot in Emulator with AppB/PassB
  10. Success

SUCCESS:

  1. Start a bot with AppA/PassA set in appsettings.json
  2. Connect to the bot in Emulator using Open Bot, using AppA/PassA
  3. Stop the bot
  4. Change the bot to use AppB/PassB in appsettings.json
  5. Close Emulator entirely
  6. Open Bot in Emulator with AppB/PassB
  7. Success

Expected behavior

Opening a new Bot session in Emulator should not use an old AppId/AppPassword.

Additional context

I've tested various ways of stopping/restarting the bot and with/without ngrok. Pretty sure this is an Emulator issue.

The completely breaks in C#, presenting the 500 error and then not connecting. In Node, it seems to first try to connect with the old AppId/Pass, but then tries to connect with the new one and works. See image:

image

Note that when connecting in Emulator, I used 94ea2b04-ccba-437e-b3f1-3f0376fcbc98. It showed the error in console, but actually worked in the Emulator.

[bug]

All 9 comments

I've been able to repro this on some scenarios as well. I believe this change will solve the issue.

@mdrichardson try updating to the most recent nightly build and see if the change fixes the issue.

@tonyanziano Still able to repro:

image

image

Restarting the Emulator still "fixes" it and I'm using Win+V to paste, so I'm definitely using the same/correct id/pass.

@mdrichardson - Sorry for the late reply. #1597 fixes this issue with your repro steps above. Feel free to test the latest nightly build with your scenario to see if it's been solved. If not, let's plan to meet in person or via teams to solve it.

@justinwilaby Still experiencing this:

image
image

I'd be a little surprised if that fixed it, since I can repro this without ngrok.

Let's meet tomorrow in person. Reach out to me on Teams when you're free and I'll pop down--I'm pretty flexible outside of 10-1030am.

@justinwilaby @mdrichardson Did you two end up working this out, or is this still an outstanding issue?

@tonyanziano Still outstanding. I haven't tested this in awhile, though.

Tried to repro on 4.5 and seems to be fixed now.

@tonyanziano Confirmed fix! Good work!

Was this page helpful?
0 / 5 - 0 ratings