microsoft / chat-copilot

MIT License
1.99k stars 681 forks source link

Deployment template not working with bing-search failure #498

Closed yanxiaodi closed 10 months ago

yanxiaodi commented 10 months ago

Describe the bug

I tried two ways to deploy the app but got similar errors.

I suspect it's related to the bing-search component. Not sure if it's the same problem as this issue: #491

Thanks.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://github.com/microsoft/chat-copilot/blob/main/scripts/deploy/README.md
  2. Click on Deploy to Azure
  3. Fill the fields and deploy
  4. See error

Expected behavior The deployment should complete without errors.

Screenshots If applicable, add screenshots to help explain your problem. image image

Platform

Additional context Add any other context about the problem here.

threegitty350 commented 10 months ago

Same issue as I'm experiencing. "Warning BCP081: Resource type "Microsoft.Bing/accounts@2020-06-10" does not have types available." is also what I get

TaoChenOSU commented 10 months ago

Hello @yanxiaodi and @threegitty350,

Sorry to hear that you are both experiencing the same deployment issue.

To assist you better, could you let us know your bicep version? You can learn more here: https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/bicep-cli

yanxiaodi commented 10 months ago

@TaoChenOSU Thanks. The version is Bicep CLI version 0.22.6 (d62b94db31).

I just installed azure CLI yesterday so I suppose it should be the latest version.

yanxiaodi commented 10 months ago

I guess Bicep doesn't support Bing search? I saw a warning as follows: image

Also I cannot find Bing here: https://learn.microsoft.com/en-us/azure/templates/

threegitty350 commented 10 months ago

Adding to this:

Bicep CLI version 0.21.1 > upgraded to > Bicep CLI v0.22.6 Did not result in a different outcome

While running the azure deploy script I get:

Warning BCP081: Resource type "Microsoft.Bing/accounts@2020-06-10" does not have types available.

Using: ./deploy-azure.ps1 -Subscription {REDACTED} -DeploymentName {REDACTED} -AIService AzureOpenAI -AIApiKey {REDACTED} -AIEndpoint {REDACTED} -ResourceGroup {REDACTED} -BackendClientId {REDACTED} -FrontendClientId {REDACTED} -TenantId {REDACTED}

Then it concludes with:

{"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/[REDACTED]/resourceGroups/rg-[REDACTED]/providers/Microsoft.Resources/deployments/[REDACTED]","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"BadRequest","target":"/subscriptions/[REDACTED]/resourceGroups/rg-[REDACTED]/providers/Microsoft.Resources/deployments/[REDACTED]","message":"{\r\n \"Code\": \"BadRequest\",\r\n \"Message\": \"Encountered an error (ServiceUnavailable) from host runtime.\",\r\n \"Target\": null,\r\n \"Details\": [\r\n {\r\n \"Message\": \"Encountered an error (ServiceUnavailable) from host runtime.\"\r\n },\r\n {\r\n \"Code\": \"BadRequest\"\r\n },\r\n {\r\n \"ErrorEntity\": {\r\n \"Code\": \"BadRequest\",\r\n \"Message\": \"Encountered an error (ServiceUnavailable) from host runtime.\"\r\n }\r\n }\r\n ],\r\n \"Innererror\": null\r\n}"}]}}

Deploy to azure button: Same issue occurs:

image

{
    "status": "Failed",
    "error": {
        "code": "BadRequest",
        "message": "Encountered an error (ServiceUnavailable) from host runtime.",
        "details": [
            {
                "message": "Encountered an error (ServiceUnavailable) from host runtime."
            },
            {
                "code": "BadRequest"
            },
            {}
        ]
    }

}

TaoChenOSU commented 10 months ago

This is likely due to a race condition in getting the function host key @glahaye

glahaye commented 10 months ago

Or a race condition caused by a clash of App Insights resources and config of the Bing Search Plugin Host.

I have a potential fix if my theory is correct. Testing it right now.

TaoChenOSU commented 10 months ago

The Web Searcher plugin has become optional (default to NOT deploy) when you deploy using the deploy-azure scripts. PR: https://github.com/microsoft/chat-copilot/pull/517.

Closing as the PR will address this issue. Feel free to reopen if you have further questions.

yanxiaodi commented 10 months ago

Thanks @TaoChenOSU . But I got another error:

{"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/76760d52-2d57-4b56-9ba6-f0f5044f60a6/resourceGroups/rg-chat-copilot/providers/Microsoft.Resources/deployments/chat-copilot","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"ResourceDeploymentFailure","target":"/subscriptions/76760d52-2d57-4b56-9ba6-f0f5044f60a6/resourceGroups/rg-chat-copilot/providers/Microsoft.Web/sites/app-copichat-7tz57cfyqmyry-memorypipeline/extensions/MSDeploy","message":"The resource write operation failed to complete successfully, because it reached terminal provisioning state 'failed'.","details":[{"code":"Failed","message":"Deployment was interrupted and the process running it was terminated unexpectedly, if an ARM template is used, the likely cause is a race condition. To solve the race condition, make all resources that could potentially restart the site (app settings or site config changes for example) have a dependency on MSDeploy resource. For more info please read the information here: http://go.microsoft.com/fwlink/?LinkId=808141"}]}]}}

Not sure if I need to create a new issue? Thanks.

yanxiaodi commented 10 months ago

The failed one is app-copichat-7tz57cfyqmyry-memorypipeline/MSDeploy.

ERROR TYPE Deployment was interrupted and the process running it was terminated unexpectedly, if an ARM template is used, the likely cause is a race condition. To solve the race condition, make all resources that could potentially restart the site (app settings or site config changes for example) have a dependency on MSDeploy resource. For more info please read the information here: http://go.microsoft.com/fwlink/?LinkId=808141 (Code: Failed)

glahaye commented 10 months ago

@yanxiaodi We are aware of this issue and hope to have a fix today.

In the meantime, you can work around the problem by simply deploying again (without deleting the resources of the failed deployment).