Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment template not working with bing-search failure #498

Closed
yanxiaodi opened this issue Oct 13, 2023 · 11 comments
Closed

Deployment template not working with bing-search failure #498

yanxiaodi opened this issue Oct 13, 2023 · 11 comments
Assignees
Labels
deployment Issues related to deploying Chat-Copilot

Comments

@yanxiaodi
Copy link

Describe the bug

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

  • Manual deployment: I got a warning Warning BCP081: Resource type "Microsoft.Bing/accounts@2020-06-10" does not have types available.. The script run a long time then failed.
  • Using the deployment template: One deployment task failed: function-copichat-7tz57cfyqmyry-websearcher-plugin/default.

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

  • OS: [e.g. Windows, Mac]
  • IDE: [e.g. Visual Studio, VS Code]
  • Language: [e.g. C#, Python]
  • Source: [e.g. NuGet package version 0.1.0, pip package version 0.1.0, main branch of repository]

Additional context
Add any other context about the problem here.

@yanxiaodi yanxiaodi changed the title Deployment template not working with bing-search failture Deployment template not working with bing-search failure Oct 13, 2023
@threegitty350
Copy link

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
Copy link
Collaborator

TaoChenOSU commented Oct 13, 2023

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

@TaoChenOSU TaoChenOSU self-assigned this Oct 13, 2023
@TaoChenOSU TaoChenOSU added the deployment Issues related to deploying Chat-Copilot label Oct 13, 2023
@yanxiaodi
Copy link
Author

yanxiaodi commented Oct 13, 2023

@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
Copy link
Author

yanxiaodi commented Oct 14, 2023

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
Copy link

threegitty350 commented Oct 16, 2023

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
Copy link
Collaborator

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

@glahaye
Copy link
Collaborator

glahaye commented Oct 16, 2023

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.

github-merge-queue bot pushed a commit that referenced this issue Oct 17, 2023
### Motivation and Context

<!-- Thank you for your contribution to the chat-copilot repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
The Web Searcher plugin requires a Bing resource, which may require
elevated permission. This will fail the whole deployment, blocking
developers from deploying the latest CC.

Issues:
#498

### Description
This PR makes deploying the Web Searcher plugin optional. And by
default, it's NOT deployed.

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows the [Contribution
Guidelines](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
@TaoChenOSU
Copy link
Collaborator

The Web Searcher plugin has become optional (default to NOT deploy) when you deploy using the deploy-azure scripts. PR: #517.

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

@yanxiaodi
Copy link
Author

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
Copy link
Author

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
Copy link
Collaborator

glahaye commented Oct 19, 2023

@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).

Ryangr0 pushed a commit to webgrip/chat-copilot that referenced this issue Oct 26, 2023
### Motivation and Context

<!-- Thank you for your contribution to the chat-copilot repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
The Web Searcher plugin requires a Bing resource, which may require
elevated permission. This will fail the whole deployment, blocking
developers from deploying the latest CC.

Issues:
microsoft#498

### Description
This PR makes deploying the Web Searcher plugin optional. And by
default, it's NOT deployed.

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows the [Contribution
Guidelines](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployment Issues related to deploying Chat-Copilot
Projects
No open projects
Development

No branches or pull requests

4 participants