microsoft / botframework-cli

CLI Tools for the Microsoft Bot Framework
Other
176 stars 129 forks source link

bf orchestrator:create failing with parsing error #1306

Open rdivakar opened 3 years ago

rdivakar commented 3 years ago

Versions

@microsoft/botframework-cli/4.15.0-rc0 win32-x64 node-v14.18.1 Node v14.18.1 Powershell WIndows 11

Describe the bug

Below command is failing with json parsing error.

bf orchestrator:create --debug --hierarchical --in ./CognitiveModels --out ./generated --model ./model Error:

[2021-10-18T18:46:43.816Z] LOG-MESSAGE: "refresh=undefined" [2021-10-18T18:46:43.818Z] LOG-MESSAGE: "baseModelPath=D:\src\Akira\src\Akira\AkiraBot\model" [2021-10-18T18:46:43.818Z] LOG-MESSAGE: "entityBaseModelPath=D:\src\Akira\src\Akira\AkiraBot\model" [2021-10-18T18:46:43.818Z] LOG-MESSAGE: "inputPathConfiguration=D:\src\Akira\src\Akira\AkiraBot" [2021-10-18T18:46:43.818Z] LOG-MESSAGE: "outputPath=D:\src\Akira\src\Akira\AkiraBot\generated" [2021-10-18T18:46:43.819Z] LOG-MESSAGE: "hierarchical=true" [2021-10-18T18:46:43.819Z] LOG-MESSAGE: "fullEmbeddings=false" [2021-10-18T18:46:43.819Z] LOG-MESSAGE: "OrchestratorCreate.runAsync(), ready to call LabelResolver.createWithSnapshotFileAsync()" [2021-10-18T18:46:43.819Z] LOG-MESSAGE: "LabelResolver.createWithSnapshotAsync(): loading a snapshot." [2021-10-18T18:46:43.819Z] LOG-MESSAGE: "OrchestratorHelper.getSnapshotFromFile()", argument0="D:\src\Akira\src\Akira\AkiraBot\generated" [2021-10-18T18:46:43.820Z] LOG-MESSAGE: "LabelResolver.createWithSnapshotAsync(): baseModelPath=D:\src\Akira\src\Akira\AkiraBot\model, entityBaseModelPath=D:\src\Akira\src\Akira\AkiraBot\model" [2021-10-18T18:46:43.820Z] LOG-MESSAGE: "LabelResolver.loadNlrAsync(): creating Orchestrator." [2021-10-18T18:46:43.820Z] LOG-MESSAGE: "LabelResolver.loadNlrAsync(): baseModelPath=D:\src\Akira\src\Akira\AkiraBot\model" [2021-10-18T18:46:43.820Z] LOG-MESSAGE: "LabelResolver.loadNlrAsync(): entityBaseModelPath=D:\src\Akira\src\Akira\AkiraBot\model" [2021-10-18T18:46:43.820Z] LOG-MESSAGE: "LabelResolver.loadNlrAsync(): baseModelPath-resolved=D:\src\Akira\src\Akira\AkiraBot\model" [2021-10-18T18:46:43.820Z] LOG-MESSAGE: "LabelResolver.loadNlrAsync(): entityBaseModelPath-resolved=D:\src\Akira\src\Akira\AkiraBot\model" [2021-10-18T18:46:43.821Z] LOG-MESSAGE: "LabelResolver.loadNlrAsync(): loading intent and entity base model" [2021-10-18T18:46:44.469Z] LOG-MESSAGE: "LabelResolver.loadNlrAsync(): leaving." [2021-10-18T18:46:44.470Z] LOG-MESSAGE: "LabelResolver.createWithSnapshotAsync(): typeof(snapshot)=object" [2021-10-18T18:46:44.470Z] LOG-MESSAGE: "LabelResolver.createWithSnapshotAsync(): snapshot.byteLength=0" [2021-10-18T18:46:44.470Z] LOG-MESSAGE: "LabelResolver.createWithSnapshotAsync(): creating label resolver." [2021-10-18T18:46:44.472Z] LOG-MESSAGE: "LabelResolver.createWithSnapshotAsync(): finished creating label resolver." [2021-10-18T18:46:44.472Z] LOG-MESSAGE: "OrchestratorCreate.runAsync(), after calling LabelResolver.createWithSnapshotFileAsync()" [2021-10-18T18:46:44.472Z] LOG-MESSAGE: "ready to call LabelResolver.setRuntimeParams(), fullEmbeddings=false" [2021-10-18T18:46:44.472Z] LOG-MESSAGE: "ready to call LabelResolver.setRuntimeParams(), resetAll=false" [2021-10-18T18:46:44.472Z] LOG-MESSAGE: "ready to call LabelResolver.setRuntimeParams(), useCompactEmbeddingsObject=[object Object]" [2021-10-18T18:46:44.473Z] LOG-MESSAGE: "ready to call LabelResolver.setRuntimeParams(), useCompactEmbeddingsObject.use_compact_embeddings=true" [2021-10-18T18:46:44.473Z] LOG-MESSAGE: "ready to call LabelResolver.setRuntimeParams(), useCompactEmbeddingsObjectJson={\n \"use_compact_embeddings\": true\n}" [2021-10-18T18:46:44.473Z] LOG-MESSAGE: "ready to call Utility.getConfigJson(), LabelResolver.LabelResolver=[object Object]" Processing D:\src\Akira\src\Akira\AkiraBot\appsettings.json... Failed to parse LUIS or JSON file on intent/entity labels Failed to parse D:\src\Akira\src\Akira\AkiraBot\appsettings.json, error= {}

To Reproduce

Steps to reproduce the behavior:

  1. Create .lu file by using bf luis:version:export
  2. Create .qna files by using bf qnamaker:kb:export
  3. Place the files in CognitiveModels directory
  4. Run the orchestrator command bf orchestrator:create --debug --hierarchical --in ./CognitiveModels --out ./generated --model ./model

Expected behavior

Would like to know clear reason for the failure.

[bug]

tsuwandy commented 2 years ago

@rdivakar, I couldn't repro with bf version 4.15.0-rc0

D:\src\BotBuilder-Samples\samples\csharp_dotnetcore\14.nlp-with-orchestrator>bf -v @microsoft/botframework-cli/4.15.0-rc0 win32-x64 node-v14.17.4

Could you check if you have orchestratorsettings.json file where you run the command, delete the file and try to run the command again?

These from your logs: bf orchestrator:create --debug --hierarchical --in ./CognitiveModels --out ./generated --model ./model Error:

[2021-10-18T18:46:43.816Z] LOG-MESSAGE: "refresh=undefined" [2021-10-18T18:46:43.818Z] LOG-MESSAGE: "baseModelPath=D:\src\Akira\src\Akira\AkiraBot\model" [2021-10-18T18:46:43.818Z] LOG-MESSAGE: "entityBaseModelPath=D:\src\Akira\src\Akira\AkiraBot\model" [2021-10-18T18:46:43.818Z] LOG-MESSAGE: "inputPathConfiguration=D:\src\Akira\src\Akira\AkiraBot"

The inputPathConfig doesn't sue what you passed in to the command for some reason.

When I ran this command, D:\src\BotBuilder-Samples\samples\csharp_dotnetcore\14.nlp-with-orchestrator>bf orchestrator:create --debug --hierarchical --in ./CognitiveModels --out ./generated --model ./model >> log.txt

The inputPathConfiguration in the log matches what I passed in.

[2021-10-29T21:56:23.414Z] LOG-MESSAGE: "inputPathConfiguration=D:\src\BotBuilder-Samples\samples\csharp_dotnetcore\14.nlp-with-orchestrator\CognitiveModels"

tsuwandy commented 2 years ago

@rdivakar, could you try removing orchestratorsettings.json? I think you used to run a few commands bf orchestrator:add (dispatch style commands and the old path was used instead.

tsuwandy commented 2 years ago

I have a fix to always take the path from the input if specified, but for now, removing orchestratorsettings.json will fix the issue.