Botframework-solutions: Deploying Enterprise Bot Template (Typescript) to Azure fails with 500 error code (Request Timed Out)

Created on 15 Mar 2019  路  12Comments  路  Source: microsoft/botframework-solutions

Project

Name:
Enterprise Bot Template

Language:
TypeScript

Description


After the post deployment steps of the Enterprise Bot Template, publishing to Azure fails with a Request Timed Out error.

To Reproduce

  1. Go through the steps for installing the Enterprise Bot Template found here: https://github.com/Microsoft/AI/tree/master/templates/Enterprise-Template/src/typescript/enterprise-bot
  2. Do the post deployment configuration successfully
  3. Run Final Deployment step to publish to Azure
  4. Command executed (with resource group/bot names and subscription id replaced): az bot publish --resource-group "RESOURCE_GROUP_NAME" -n "BOT_NAME" --subscription "SUBSCRIPTION_ID" -v v4 --verbose --code-dir "."

Output I get is this

Detected SDK version v4. Running prepare publish in code directory . and for project file None
Preparing Bot Builder SDK v4 bot for publish, with code directory . and project file .
Detected bot language Node, Bot Builder version v4.
Creating upload zip file.
Creating upload zip file, code directory ..
Adding node_modules to folders to exclude from zip file.
Compressing bot source into C:\Users\emawa\sources\conversational-ai-master\templates\Enterprise-Template\src\typescript\enterprise-bot\upload.zip.
Zip file path created, at C:\Users\emawa\sources\conversational-ai-master\templates\Enterprise-Template\src\typescript\enterprise-bot\upload.zip.
Emptying the "site/wwwroot/" folder on Kudu in preparation for publishing.
Failed with status code 500 and reason <html><head><title>500 - The request timed out.</title></head><body>  <font color ="#aa0000">         <h2>500 - The request timed out.</h2></font>  The web server failed to respond within the specified time.</body></html>

Expected behavior


Bot should be deployed successfully to Azure and testing should work using the production endpoint.

Screenshots

Additional context

Bug

Most helpful comment

@awaemmanuel - Thanks alot mate. It worked like a charm. Now I can claim that I know DevOps also ;)

This was my first asp.net core and devops configuration via Azure DevOps.

All 12 comments

For anyone else with this error, a temporary work around is to deploy from git or any other deployment method other than az bot. The Issue seems to be Kudu timing out when installing the node modules.

For anyone else with this error, a temporary work around is to deploy from git or any other deployment method other than az bot. The Issue seems to be Kudu timing out when installing the node modules.
@01 Any links to guides on how to deploy using git and other methods?

As you can see in Microsoft/botbuilder-tools#876 it's an already known issue, and it's been worked on. Despite the error message, the deployment to Azure using az is successful (in most cases).

@awaemmanuel I'm personally using the local git deployment. https://docs.microsoft.com/en-us/azure/app-service/deploy-local-git

@dfavretto I'm assuming most cases are successful considering I haven't seen much about this. But any large application with large amount of dependencies is going to time out. I haven't been able to successfully use AZ publish in months and the issue you linked was opened months ago. I would probably put the work around in documentation as i spent alot of time before I realized the issue. Another work around is just to go into Kude console and manually do the npm install and run the post deployment script, but recommend everyone simply use git deployment.

@01 Thank you. While this is being debugged, I just set up an Azure DevOps pipeline to push my code and changes to Azure. Any reason why the process uses az bot publish and not az webapp up? I heard that az webapp up is more stable.

@awaemmanuel I haven't used AZ bot publish in awhile but I'm sure if you look at output its doing some bot specific operations I also havent deployed any webapps to azure other then bots

Honestly I wouldn't go back to AZ bot publish I'm already using git for version control, simply need to push to the azure repo when I want to deploy

Even I'm experiencing the same pain. Not sure, why this works in some cases?

Please help to resolve this at the earliest to move on.

@narulasrinivas in the meantime you can deploy via github or just make an azure pipelines to do the same thing. https://docs.microsoft.com/en-us/azure/app-service/deploy-local-git

@awaemmanuel - Thanks. I'll give a try.

@awaemmanuel - Thanks alot mate. It worked like a charm. Now I can claim that I know DevOps also ;)

This was my first asp.net core and devops configuration via Azure DevOps.

Is this issue still opened?

Because I'm facing a similar problem. With the publish script the node_modules folder is not being created (maybe for the timeout) but also when I try to deploy the Bot with the "workaround" (deploy-local-git and KUDU) the lib folder is not being created, means that the application won't run. Basically to make it work I have to deploy first with the deploy-local and then run the publish script in this way I have all the files deployed and the application starts. :)

Is this issue still opened?

Because I'm facing a similar problem. With the publish script the node_modules folder is not being created (maybe for the timeout) but also when I try to deploy the Bot with the "workaround" (deploy-local-git and KUDU) the lib folder is not being created, means that the application won't run. Basically to make it work I have to deploy first with the deploy-local and then run the publish script in this way I have all the files deployed and the application starts. :)

@tommyJimmy87 if your lib folder is not being created it means your deploy script is not running the properm node commands like npm install. Should have a deploy.cmd in your base directory which is the Kudu deployment script if your using local git deployment. You should be export it from kudu console on portal or create your own https://github.com/projectkudu/kudu/wiki/Custom-Deployment-Script

Was this page helpful?
0 / 5 - 0 ratings