Cognitive-Services-Voice-Assistant icon indicating copy to clipboard operation
Cognitive-Services-Voice-Assistant copied to clipboard

Error code: 1002. Error details: The server returned status code '401' when status code '101' was expected

Open Fatichti opened this issue 3 years ago • 5 comments

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

The issue

I have done everything that was indicated here, everything works, on the Bot emulator works perfectly and I have the "Your bot is ready" page. However, when I want to connect with Windows Voice Assistant Client, I get an error message

Any log messages given by the failure

Error (ConnectionFailure) : Connection was closed by the remote host. Error code: 1002. Error details: The server returned status code '401' when status code '101' was expected

Expected/desired behavior

A Hello and welcome message

OS and Version?

Windows 10

Mention any other details that might be useful

I checked the "Enable Streaming Endpoint" box and toggled "Web sockets" to On I restarted the cognitive services, without success. All my resources are in USA West except 1 which is in global, but that's normal. I tested with PowerShell as shown here, to see if the keys were invalid but I don't get an error, I get a response with lots of characters (about a hundred). I put the language en-FR then the default one, but without succes

Fatichti avatar Apr 12 '21 17:04 Fatichti

Thanks for getting in touch!

A "401" auth-style failure like this generally indicates that there was trouble connecting to your bot from the Direct Line Speech service -- confusingly enough, this is error message from one service telling you it couldn't handshake with another server!

Can you please check the following:

  • In the Azure Portal, if you navigate to your "Bot Channels Registration" resource and check "Channels" (left navbar), is the Direct Line Speech channel registered, does it report any errors, and/or is it associated with the expected speech resource when you click on "edit?"
  • To that point, make sure the resource the DLS channel registration is pointing to is the same one you're using for your subscription key in the client -- there are enough of these things that it's easy to mix them up!
  • If you navigate to the App Service resource for your bot and check "Settings >> Configuration" on the left, then navigate to "general settings" (top tabs), is "Web sockets" (roughly middle of the page) radio-buttoned to "on?"

Those are the most common gotchas. If all of that looks good and it's still being stubborn, please grab a log (by populating the "log file path" options in the Windows Voice Assistant Client or by following these steps for your own app) and share it with us here -- we can use the request IDs to look up more detail on the service side.

Thanks!

trrwilson avatar Apr 15 '21 18:04 trrwilson

Hello,

Thank you for taking the time to reply. I checked all the steps, everything is good. I have shared the log file. log_WVAC.txt

Fatichti avatar Apr 16 '21 07:04 Fatichti

Did you tested the bot in web chat following this? We had a similar issue and we fixed it when doing that procedure.

albanoandrea avatar May 19 '21 16:05 albanoandrea

I am facing the same issue. On top of this I am unable to test the bot in web chat. The instructions shown in the tutorial seem to not work.

socullen avatar Jul 07 '22 16:07 socullen

I am having the same issue. Also for the web chat, I am unable to access the password manager (It says: Insufficient privileges to complete the operation, but I am the admin). I followed the tutorial that @albanoandrea has suggested from start to finish but it does not work. logs.txt

aditya-azad avatar Jan 13 '23 10:01 aditya-azad