microsoft / botframework-solutions

Welcome to the Bot Framework Solutions repository which is the home for a set of templates and solutions to help build advanced conversational experiences using Azure Bot Service and Bot Framework. Microsoft Bot Framework is a comprehensive framework for building enterprise-grade conversational AI experiences.
https://aka.ms/bfsolutionsdocs
MIT License
1.05k stars 529 forks source link

Deploying a new VA throws error #3273

Closed ipraveenMS closed 4 years ago

ipraveenMS commented 4 years ago

What project is affected?

VA 0.8

What language is this in?

C#

What happens?

I create the project using 0.8 VA template. But deploying this in azure throws the error

PS C:\msazure\EngSys\Obi\assistant\src\VirtualAssistant> cd.. PS C:\msazure\EngSys\Obi\assistant\src> cd .\VirtualAssistant\ PS C:\msazure\EngSys\Obi\assistant\src\VirtualAssistant> ./Deployment/Scripts/deploy.ps1 ? Bot Name (used as default name for resource group and deployed resources): NewVA1 ? Azure resource group region: westus ? Password for MSA app registration (must be at least 16 characters long, contain at least 1 special character, and contain at least 1 numeric character): Obi1234567890#$% ? Create a new LUIS Authoring Resource? [y/n]: n ? LUIS Authoring Key: 7dc80faa20e8498c9387b6d0d3b3ccb2 ? LUIS Authoring Region (westus, westeurope, or australiaeast): westus

Creating resource group ...Done. Validating Azure deployment ...This command is implicitly deprecated because command group 'group deployment' is deprecated and will be removed in a future release. Use 'deployment group' instead. Done. > Deploying Azure services (this could take a while)...Done. > Updating appsettings.json ...Done. > Initializing en-us dispatch model ...Done. > Parsing en-us General LU file ...Done. > Deploying en-us General LUIS app ...! Could not deploy LUIS model. Review the log for more information. ! Log: C:\msazure\EngSys\Obi\assistant\src\VirtualAssistant\Deployment\Scripts..\deploy_cognitive_models_log.txt Setting LUIS subscription key ...! Could not create LUIS app. Skipping dispatch add. Parsing en-us Chitchat LU file ...Done. Deploying en-us Chitchat QnA kb ...Done. Adding en-us Chitchat kb to dispatch model ...Done. Parsing en-us Faq LU file ...Done. Deploying en-us Faq QnA kb ...Done. Adding en-us Faq kb to dispatch model ...Done. Creating en-us dispatch model ...Done. ConvertFrom-Json: C:\msazure\EngSys\Obi\assistant\src\VirtualAssistant\Deployment\Scripts\deploy_cognitive_models.ps1:337 Line | 337 | $dispatchApp = $dispatch | ConvertFrom-Json | ~~~~ | Conversion from JSON failed with error: Unexpected character encountered while parsing value: C. Path | '', line 0, position 0.

Setting LUIS subscription key ...! Could not assign subscription key automatically. Review the log for more information. ! Log: C:\msazure\EngSys\Obi\assistant\src\VirtualAssistant\Deployment\Scripts..\deploy_cognitive_models_log.txt

  • Please assign your subscription key manually in the LUIS portal. Publishing to Azure ...Done.
  • Summary of the deployed resources:
  • Resource Group: NewVA1
  • Bot Web App: NewVA1-wal2b4h
  • Microsoft App Id: 945dd764-baf8-44b2-a677-53cdb1abc417
  • Microsoft App Password: Obi1234567890#$% Deployment complete.

    What are the steps to reproduce this issue?

    See above.

    What were you expecting to happen?

    Successful azure deployment. I tried many times and see the same error every time

    Can you share any logs, error output, etc.?

    above is the errors. Attached is the log file. deploy_cognitive_models_log.txt

Any screenshots or additional context?

VladPapacostea-SM commented 4 years ago

Hi @ipraveenMS . I have encountered a similar issue before, in a previous version of the deployment scripts. At that time, one of the tools being used in the scripts was returning a message about the deprecation of the tool, concatenated to the JSON response, making the response take an invalid format. This would explain your error when trying to ConvertFromJson If I remember correctly, this was caused by the "luisgen" tool when parsing the models.

Our solution was to migrate to the bf-cli tool, for all the functionality that has already been ported.

pavolum commented 4 years ago

@ipraveenMS this is probably a result of out of date CLI tools. Can you ensure you have the latest versions of the CLI tools outlined here

I ran a fresh publish with the .8 with out an issue and have the latest CLI tools. I will try again to double check but I do believe this is the root of your issue and the out of date tool is emitting an error message that is being accidentally parsed as json

pavolum commented 4 years ago

@ipraveenMS I have confirmed that deployment works with the up to date bf-cli tool Please ensure you have the most up to date CLI tool installed when deploying

npm install -g @microsoft/botframework-cli botdispatch luis-apis

Also ensure previous CLI versions are not lingering on your machine.