microsoft / botframework-sdk

Bot Framework provides the most comprehensive experience for building conversation applications.
MIT License
7.5k stars 2.44k forks source link

[Azure Bot Service] Got 500 Error code during Bot migration to GA Bot service #4395

Closed edanilenko34 closed 6 years ago

edanilenko34 commented 6 years ago

Bot Info

Issue Description

During migration I've got message with 500 error code. Seems it was in process of file copying to created instance.

Reproduction Steps

  1. Press button "Migrate" in portal.azure.com or botframework site
  2. after couple of minutes see Error popup.

Expected Behavior

Success migration

Actual Results

Migration is not completed.

stevengum commented 6 years ago

@edanilenko34, thanks for reporting this issue we are currently investigating.

Andrea-Orimoto commented 6 years ago

@edanilenko34, what is the botId?

edanilenko34 commented 6 years ago

The BotID is 4949893f-f14b-4e63-b274-05fc8854c728

Andrea-Orimoto commented 6 years ago

hi @edanilenko34, it looks like the migration timed out. The migration of a Node.js functions bot can be tricky. The reason might be that it times out while copying all the node_modules to the new upgraded Function.

Have you moved your code to use FuncPack as described here? https://docs.microsoft.com/en-us/azure/bot-service/bot-service-migrate-bot

Note

Before migrating a Functions bot using Node.js, it is recommended that you use the Azure Functions Pack to package the Node.js modules together. Doing so will improve performance during migration and execution of the Functions bot after it is migrated. For more information, see Azure Functions Pack.

If not, please do so and retry.

Another option would be to do this "manually", which would involve the following steps (I can give you more details if you choose this route):

  1. Move your code to FuncPack (this is recommended no matter what)
  2. Create a brand new Azure Function App and copy all the app settings from your bot
  3. Deploy your FuncPack'ed code to it
  4. Change the endpoint in your bot settings to this new app
  5. We patch your bot record to make it a registration only bot
  6. Finally you migrate it (migration will skip all the app service copying, since you did it manually)
Andrea-Orimoto commented 6 years ago

hi @edanilenko34, we think we might have found the issue, if you want the long explanation please check this related issue #4227.

The short version is:

  1. Use FuncPack before migrating (change module.exports = { default: connector.listen() } to module.exports = connector.listen(); in index.js)
  2. Use an App Service name you never used before when you migrate (e.g. instead of vlgtrans-upgrade, use vlgtrans-upgrade1)

Let me know if you have any questions. Andrea

Andrea-Orimoto commented 6 years ago

One more important step I just discovered. Once you move to funcpack, delete the node_modules folder from the app service prior to migration. A function using funcpack does not need the node_modules anymore, and that folder might cause the timeout during migration.

Andrea-Orimoto commented 6 years ago

hi @edanilenko34, were you able to try this? Let me know if you have any questions.

fanidamj-zz commented 6 years ago

@edanilenko34 Closing the issue assuming it as resolved. Please open a new issue if you have any.

Andrea-Orimoto commented 6 years ago

The bot has not been migrated yet, reopening this issue.

@edanilenko34, here's what you need to do in order to migrate succesfully:

  1. move your code to funcpack https://github.com/Azure/azure-functions-pack
  2. remove the node_modules folder from the app service (or add it to .gitignore)
  3. wait until mid this week (ETA 5/17), we're deploying another fix that addresses a timeout issue during migration
  4. migrate your bot

I'm available to get on a screen share session if needed. Let me know if you have any questions, and thanks for your patience. Andrea

Andrea-Orimoto commented 6 years ago

@edanilenko34, quick update, we're moving the deployment of the fix to next week, we ran into some issues, so wait for steps 3 and 4. Will circle back when it's done. Thanks for your patience.

JasonSowers commented 6 years ago

Thank you for opening an issue against the Bot Framework SDK v3. As part of the Bot Framework v4 release, we’ve moved all v3 work to a new repo located at https://github.com/microsoft/botbuilder-v3. We will continue to support and offer maintenance updates to v3 via this new repo.

From now on, https://github.com/microsoft/botbuilder repo will be used as hub, with pointers to all the different SDK languages, tools and samples repos.

As part of this restructuring, we are closing all tickets in this repo.

For defects or feature requests, please create a new issue in the new Bot Framework v3 repo found here: https://github.com/microsoft/botbuilder-v3/issues

For Azure Bot Service Channel specific defects or feature requests (e.g. Facebook, Twilio, Teams, Slack, etc.), please create a new issue in the new Bot Framework Channel repo found here: https://github.com/microsoft/botframework-services/issues

For product behavior, how-to, or general understanding questions, please use Stackoverflow. https://stackoverflow.com/search?q=bot+framework

Thank you.

The Bot Framework Team