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

Luis Bot -> Error: Response status code does not indicate success: 403 (Forbidden). #3299

Closed
cxbuilders opened this issue Jun 3, 2020 · 23 comments
Assignees
Labels
Type: Bug Something isn't working

Comments

@cxbuilders
Copy link

When a new bot is created with Luis enabled, in the Emulator it throws an error:
Response status code does not indicate success: 403 (Forbidden).

Version

ffde16f

To Reproduce

Steps to reproduce the behavior:

1.Create new echo based bot
2. Switch to Luis and add trigger with intent and some utterances
3. Run provision script
4. Copy settings from script in Bot settings in Composer
5. Start Bot & Run emulator
6. Type something to see the error
4. See error
image

@cxbuilders cxbuilders added Needs-triage A new issue that require triage Type: Bug Something isn't working labels Jun 3, 2020
@cxbuilders cxbuilders changed the title Response status code does not indicate success: 403 (Forbidden). Luis Bot -> Error: Response status code does not indicate success: 403 (Forbidden). Jun 3, 2020
@luhan2017
Copy link
Contributor

@cxbuilders , so you started a local runtime by a deployed config. could you check the generated folder of your bot?

We are using this pattern to load the luis config file:
luis.settings.{luis.environment}.{luis.authoringRegion}.json

could you check the generated folder of your bot and your settings to see whether they match.

@luhan2017 luhan2017 self-assigned this Jun 4, 2020
@luhan2017 luhan2017 added Type: Question Further information is requested and removed Needs-triage A new issue that require triage Type: Bug Something isn't working labels Jun 4, 2020
@cxbuilders
Copy link
Author

@luhan2017 This is a vanilla bot in the latest version. I created the bot, enabled luis, ran the provisioncomposer.js script, filled in the settings in the appsettings and that's it.

File looks ok:
image
image

@luhan2017
Copy link
Contributor

@cxbuilders , Oh, I know why this happen, in the deployment process, we are assigning the authored luis resource to the prediction luis service, which binds the endpointKey. So you should missed this part. You can try the following:

  1. Use the authoringKey as the endpointKey.
  2. kick of a deployment to bind the endpointKey with the luis resource.

@cxbuilders
Copy link
Author

@luhan2017 Not completely clear. Are you saying I missed something or this is a bug?

@luhan2017
Copy link
Contributor

@cxbuilders I mean you missed the deployment step, you can't just do provision and use the settings to start a local bot, you missed a luis endpoint assignment process which is in the deployment process.

@cxbuilders
Copy link
Author

@luhan2017 Yeah but the provisionComposer.js script is the deployment script, right? Which I did run as mentioned

@luhan2017
Copy link
Contributor

luhan2017 commented Jun 5, 2020

@cxbuilders
No, you should do deployment like this:

  1. Click Add new profile, paste your provision result in the publish Configuration

image

  1. Click publish to selected profile, select OK, then you are kicking off a deployment.

@mudasar
Copy link

mudasar commented Jun 5, 2020

I am having a similar error. It was working fine a couple of days ago but now when trying to run the bot on local with Luis integration it is returning this strange error without any further help that which kind of authentication is failed.

@luhan2017
Copy link
Contributor

@mudasar , could you help paste your error message here?

@cxbuilders
Copy link
Author

cxbuilders commented Jun 10, 2020

@luhan2017 I thought that was called Publishing..
I did that and it still has the same issue. Also tried changing the keys around in the publish profile and publish it again. Basically all of Luis is not working now. Did you try to replicate this with a simple bot?

Also how is this not a bug?

@cxbuilders
Copy link
Author

@luhan2017 As I really needed this I dived more into the issue and found the following.

When you start a bot in Composer and additional application is created in Luis with the (composer) in the name. This is also where the generated folder comes into play, only for the local usage of Luis.

When I checked the (composer) app in Luis I noticed that the Prediction resource has the Authoring key. I am not sure if that was meant to be, but either of the following is true;

  1. The generated folder should contain "endpointKey": "=settings.luis.authoringKey"
  2. The Endpoint key should be used as the prediction key in the (composer) Luis app

So to me this has nothing to do with Publishing, but goes wrong when starting the bot for local usage.

Could you please mark this as a bug again?

@luhan2017 luhan2017 added Type: Bug Something isn't working and removed Type: Question Further information is requested labels Jun 11, 2020
@luhan2017
Copy link
Contributor

@cxbuilders sure, there is a logic in composer, if user don't add luis:endpointKey, we will take luis:authoringKey as the luis: endpointKey.
We've found a bug yesterday and I think it maybe related to the error you met. Which is:

Previously in composer, we auto generated the luis authoring and prediction endpoint by this pattern: https://${luis.region}.api.cognitive.microsoft.com which works fine for a while.

But recently, there is a change in the luis side which update the naming pattern as this:
https://{your-resource-name}.api.cognitive.microsoft.com
see https://docs.microsoft.com/en-us/azure/cognitive-services/luis/developer-reference-resource as a reference.

Could you check in you luis portal to check the endpoint url of your prediction and authoring resource? If that is the new pattern (https://{your-resource-name}.api.cognitive.microsoft.com), that should be the problem and we have a PR to fix this. #3364 .

Sorry for the confusing, please let me know if it works or not.

@cxbuilders
Copy link
Author

cxbuilders commented Jun 11, 2020

No I have the https://westus.api.cognitive.microsoft.com/ url.

Today I removed the resource group and created it all from scratch;

  • Simple bot with Luis enabled and some intents
  • Run provisionComposer.js
  • Copy Luis & App settings to Bot Settings
  • Copy output of provisionComposer.js into new publishing profile
  • Publish the Bot
  • Start the bot

And again:
image

This is still the issue that the wrong key is used for the (composer) Luis model as I mentioned in the previous message. This is only happening locally, in Azure the bot runs fine.

I have the feeling that we're running in circles here, if no-one just gives this a try to see if it replicates.

@mudasar
Copy link

mudasar commented Jun 11, 2020

@mudasar , could you help paste your error message here?

I have got it fixed. I think the issue is with Composer when you change something in the settings (config) you have to some times restart the Composer and then restart the bot. The config changes are not reflected.
You are on the settings screen and update the config (update the Luis key in my case) you may restart the bot as many times but the key is not going to take effect. unless you navigate to a different screen in the Composer and then close/reopen the Composer.

@luhan2017
Copy link
Contributor

luhan2017 commented Jun 11, 2020

No I have the https://westus.api.cognitive.microsoft.com/ url.

Today I removed the resource group and created it all from scratch;

  • Simple bot with Luis enabled and some intents
  • Run provisionComposer.js
  • Copy Output of script into new publishing profile
  • Publish the Bot
  • Start the bot

And again:
image

This is still the issue that the wrong key is used for the (composer) Luis model as I mentioned in the previous message. This is only happening locally, in Azure the bot runs fine.

I have the feeling that we're running in circles here, if no-one just gives this a try to see if it replicates.

@cxbuilders, I have tried your steps can't repro this error in my side. Could you share more information here? for your reproduce steps, did you update the local configuration after publishing the bot? what is your exact config of the local setting?

For local setting, It currently has the authoringKey and endpointKey properties, if endpointKey is not used, we will use the authoring service for both authoring and prediction.

I saw a screenshot at the beginning of this thread, you are using both authoringKey and endpointKey.

If you have assigned an endpointKey(which comes from the luis prediction service) in the local setting to start a local bot, you should manually add the prediction resource to your luis app as the following. Could you double check on whether the endpointKey is associated with the luis app?

https://docs.microsoft.com/en-us/azure/cognitive-services/luis/get-started-portal-deploy-app#assign-the-resource-key-to-the-luis-app-in-the-luis-portal

It's weird that I can't paste any screenshot now, will add the screenshot later.

@cxbuilders
Copy link
Author

cxbuilders commented Jun 13, 2020

@luhan2017 Whatever combination of steps I try, it always fails, whilst around 2 weeks ago I never had issues. Would it be possible to have a call about this, as that would be a whole lot simpler to show my side.

@luhan2017
Copy link
Contributor

@cxbuilders , sorry for the late response, sure, let's have a call on this. I am not sure how can we do this, what is your timezone? I am in Beijing. Please ping me when you are available.

@cxbuilders
Copy link
Author

@luhan2017 I have sent you a mail (what I think is your mail) let me know if you received it.

@luhan2017
Copy link
Contributor

@cxbuilders , I didn't receive your email, did you send it to luhan@microsoft.com?

@granicz
Copy link

granicz commented Mar 31, 2021

So what was the solution at the end or was this a misconfiguration issue?

@DnlCYan
Copy link

DnlCYan commented May 11, 2021

I don't know if is related, but I face this same 403 problem and I found that I needed to Add a prediction resource to my Luis

image

@praveenvavilla
Copy link

I am facing the same issue and shared details with @alanlong9278

@ma9az
Copy link

ma9az commented Aug 20, 2021

The solution shared by @DnlCYan worked for me as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants