BotFramework-Composer icon indicating copy to clipboard operation
BotFramework-Composer copied to clipboard

Failed to bind LUIS prediction resource when publishing bot from composer desktop 2.0

Open geo-msft opened this issue 3 years ago • 18 comments

Describe the bug

After creating a new publish profile with new resources, then publish the bot from Composer desktop 2.0, the publish fails with the error fail to bind LUIS prediction resource to LUIS applications.

Version

image

Browser

No browser, just composer desktop 2.0.

  • [x ] Electron distribution
  • [ ] Chrome
  • [ ] Safari
  • [ ] Firefox
  • [ ] Edge

OS

  • [ ] macOS
  • [x ] Windows
  • [ ] Ubuntu

To Reproduce

Steps to reproduce the behavior:

  1. Have a bot with LUIS built in Composer 2.0 desktop.
  2. Choose to publish it on new resources.
  3. Create a new publish profile with new resources and wait for the provision step to finish.
  4. Go to publish and choose the publish profile created earlier.
  5. Press Publish and wait for a few seconds

Actual result: the publish fails with this error

image

NOTE: this node "luisResource": "luis prediction resource here" is correctly populated in the publishing profile.

Expected behavior

The expected result should be: the publish should be successful.

Screenshots

Additional context

If the user manually binds the prediction resources in the LUIS.ai portal, the error still happens.

geo-msft avatar Jul 13 '21 08:07 geo-msft

FYI custsomers are hitting this and LUIS requested that we promote handling of this. (more info coming).

In essence: Composer isn’t assigning the prediction keys to the LUIS apps so it ends up being unable to call the LUIS apps.

scheyal avatar Jul 13 '21 21:07 scheyal

Thanks @scheyal

Working with @natalgar; we could not reproduce the issue.

Looking into who should be a suitable owner to look into this.

dmvtech avatar Jul 13 '21 21:07 dmvtech

Hi folks, When adding a prediction key to Composer, even during development, I will populate both the authoring and endpoint keys appropriately in the advanced settings.

See below image

Having an endpoint key means you won't run out of quota by using the authoring key for endpoint requests. When this happens, you get 403s constantly. By providing the endpoint key we expect the prediction resource should be assigned to that application.

When checking the LUIS portal, no prediction resource is assigned. image

hazemelh avatar Jul 13 '21 23:07 hazemelh

@srinaath , @dmvtech - please see @hazemelh details. Looks like a bug (with a delayed repro b/c first you have to reach the quota to hit the condition).

scheyal avatar Jul 13 '21 23:07 scheyal

@benbrown can you please chime in on this one. I know that we worked through much of this when we were working on the LUIS provisioning and publishing. I can connect with the customer to see the setup if needed.

Dewain27 avatar Aug 11 '21 15:08 Dewain27

Composer does NOT currently bind the endpoint key to the LUIS apps when starting the bot locally. So if you specify the endpoint key in the advanced settings, you must manually bind the same key via the LUIS portal.

However, during the PUBLISH, it definitely should do that binding. In the publishing profile, are both the endpoint and authoring key specified?

benbrown avatar Aug 11 '21 18:08 benbrown

yes, both authoring and prediction keys were specified when I repro-ed this.

geo-msft avatar Sep 01 '21 09:09 geo-msft

Status update. We are investigating internally and will update when we have more findings.

dmvtech avatar Sep 08 '21 22:09 dmvtech

I am having this issue as well- reproduced on behalf of a customer. Thanks for update @dmvtech

kendallroden avatar Sep 09 '21 14:09 kendallroden

Another customer raised a support case where he faces the issue. Today in my bot, I was not able to repro, but the customer was. The log he shared is:


"Accepted for publishing..."


"Abs settings incomplete, skip linking bot with webapp ..."


"appPasswordHint incomplete, return ..."


"Building the bot app..."


"Build succeeded!"


"start publish luis"


"Assigning to luis app id: 06a7b182-8966-4528-b72a-46760ba91c84"


"Assigning to luis app id: a51afb52-80ac-4179-be61-fcd81bb9e00c"


"{\n "stack": "Error: Request failed with status code 400\n at createError (C:\\Users\\gec\\AppData\\Local\\Programs\\Bot Framework Composer\\resources\\app.asar.unpacked\\extensions\\azurePublish\\dist\\extension.js:102540:17)\n at settle (C:\\Users\\gec\\AppData\\Local\\Programs\\Bot Framework Composer\\resources\\app.asar.unpacked\\extensions\\azurePublish\\dist\\extension.js:102554:14)\n at IncomingMessage.handleStreamEnd (C:\\Users\\gec\\AppData\\Local\\Programs\\Bot Framework Composer\\resources\\app.asar.unpacked\\extensions\\azurePublish\\dist\\extension.js:103498:13)\n at IncomingMessage.emit (events.js:215:7)\n at endReadableNT (_stream_readable.js:1183:12)\n at processTicksAndRejections (internal/process/task_queues.js:80:21)",\n "message": "Request failed with status code 400",\n "config": {}\n}"


"{"stack":"Error: Failed to bind luis prediction resource to luis applications. Please check if your luisResource is set to luis prediction service name in your publish profile.\n at publishLuisToPrediction (C:\\Users\\gec\\AppData\\Local\\Programs\\Bot Framework Composer\\resources\\app.asar.unpacked\\extensions\\azurePublish\\dist\\extension.js:269227:17)","message":"Failed to bind luis prediction resource to luis applications. Please check if your luisResource is set to luis prediction service name in your publish profile."}"


"Error - Failed to bind luis prediction resource to luis applications. Please check if your luisResource is set to luis prediction service name in your publish profile."

The strange fact for him: when we checked the LUIS portal, the prediction resource was assigned to the LUIS app, but compo was throwing error and the publish of the bot did not happen.

Needless to say, the publish profile contained all the nodes (inluding luisResource) with the correct values.

And last week, the same user managed to publish another bot from the same machine.

geo-msft avatar Sep 22 '21 16:09 geo-msft

Is there a current workaround for getting your bot published here?

MCKRUZ avatar Nov 23 '21 20:11 MCKRUZ

As of today we are hitting this same exact issue. Last week deploying worked with out issues. No changes to the our local or cloud environments. Composer 2.1.1 in use. This is quite a major letdown as this effectively blocks our ability to do client releases.

mhtmht avatar Nov 30 '21 10:11 mhtmht

The actions Composer takes internally during publishing can be seen in this deployment pipeline sample...

https://github.com/gabog/ComposerCICDSamples/blob/main/build/yaml/templates/buildAndDeployModels.yaml

From the ci/cd instructions page here

You may consider publishing directly using steps like these rather than the built-in publishing system.

benbrown avatar Nov 30 '21 15:11 benbrown

@benbrown Thanks! We have been looking into this already a bit so this might now be the time to push it through. If for nothing else more information on the failing bits always helps.

mhtmht avatar Dec 01 '21 17:12 mhtmht

@mhtmht are you a part of multiple Azure tenants? One possible source of this error is if the key you using is owned by a different tenant than supplied during the API call...

benbrown avatar Dec 01 '21 18:12 benbrown

@dmvtech Sorry, I also faced the same issue, did we found the root cause or any plan to fix it?

sinnypan avatar Dec 16 '21 15:12 sinnypan

@mhtmht are you a part of multiple Azure tenants? One possible source of this error is if the key you using is owned by a different tenant than supplied during the API call...

Yes actually I am. Weirdly this was not a problem with any of the other environments under the same multi tenant setup.

But just to report back on the issues we were having. All the problems have magically disappeared during the time away the component in question. No deployment issue anymore. Also why things now work and didn’t a week ago is shrouded in mystery. No changes to the setup or method of deployment.

mhtmht avatar Dec 16 '21 16:12 mhtmht

For me it started working after I started and stopped the bot in Composer before publishing it.

iliosana avatar Mar 21 '22 12:03 iliosana