Troubleshoot a Custom Commands application at runtime

Important

Custom Commands will be retired on April 30th 2026. As of October 30th 2023 you can't create new Custom Commands applications in Speech Studio. Related to this change, LUIS will be retired on October 1st 2025. As of April 1st 2023 you can't create new LUIS resources.

This article describes how to debug when you see errors while running Custom Commands application.

Connection failed

If your run Custom Commands application from client application (with Speech SDK) or Windows Voice Assistant Client, you might experience connection errors as listed below:

Error code Details
401 AuthenticationFailure: WebSocket Upgrade failed with an authentication error
1002 The server returned status code '404' when status code '101' was expected.

Error 401

  • The region specified in client application doesn't match with the region of the custom command application

  • Speech resource Key is invalid

    Make sure your speech resource key is correct.

Error 1002

  • Your custom command application isn't published

    Publish your application in the portal.

  • Your custom command applicationId isn't valid

    Make sure your custom command application ID is correct. custom command application outside your speech resource

    Make sure the custom command application is created under your speech resource.

For more information on troubleshooting the connection issues, reference Windows Voice Assistant Client Troubleshooting

Dialog is canceled

When your Custom Commands application is running, the dialog would be canceled when some errors occur.

  • If you're testing the application in the portal, it would directly display the cancellation description and play out an error earcon.

  • If you're running the application with Windows Voice Assistant Client, it would play out an error earcon. You can find the Event: CancelledDialog under the Activity Logs.

  • If you're following our client application example client application (with Speech SDK), it would play out an error earcon. You can find the Event: CancelledDialog under the Status.

  • If you're building your own client application, you can always design your desired logics to handle the CancelledDialog events.

The CancelledDialog event consists of cancellation code and description, as listed below:

Cancellation Code Cancellation Description
MaxTurnThresholdReached No progress was made after the max number of turns allowed
RecognizerQuotaExceeded Recognizer usage quota exceeded
RecognizerConnectionFailed Connection to the recognizer failed
RecognizerUnauthorized This application can't be accessed with the current subscription
RecognizerInputExceededAllowedLength Input exceeds the maximum supported length for the recognizer
RecognizerNotFound Recognizer not found
RecognizerInvalidQuery Invalid query for the recognizer
RecognizerError Recognizer returns an error

No progress was made after the max number of turns allowed

The dialog is canceled when a required slot isn't successfully updated after certain number of turns. The build-in max number is 3.

Recognizer usage quota exceeded

Language Understanding (LUIS) has limits on resource usage. Usually "Recognizer usage quota exceeded error" is caused by:

  • Your LUIS authoring exceeds the limit

    Add a prediction resource to your Custom Commands application:

    1. go to Settings, LUIS resource
    2. Choose a prediction resource from Prediction resource, or select Create new resource
  • Your LUIS prediction resource exceeds the limit

    If you are on a F0 prediction resource, it has limit of 10 thousand/month, 5 queries/second.

For more details on LUIS resource limits, refer Language Understanding resource usage and limit

Connection to the recognizer failed

Usually it means transient connection failure to Language Understanding (LUIS) recognizer. Try it again and the issue should be resolved.

This application can't be accessed with the current subscription

Your subscription isn't authorized to access the LUIS application.

Input exceeds the maximum supported length

Your input exceeded 500 characters. We only allow at most 500 characters for input utterance.

Invalid query for the recognizer

Your input exceeded 500 characters. We only allow at most 500 characters for input utterance.

Recognizer return an error

The LUIS recognizer returned an error when trying to recognize your input.

Recognizer not found

Can't find the recognizer type specified in your custom commands dialog model. Currently, we only support Language Understanding (LUIS) Recognizer.

Other common errors

Unexpected response

Unexpected responses result from many different reasons. A few checks to start with:

  • Yes/No Intents in example sentences

    As we currently don't support Yes/No Intents except when using with confirmation feature. All the Yes/No Intents defined in example sentences wouldn't be detected.

  • Similar intents and examples sentences among commands

    The LUIS recognition accuracy might get affected when two commands share similar intents and examples sentences. You can try to make commands functionality and example sentences as distinct as possible.

    For best practice of improving recognition accuracy, refer LUIS best practice.

  • Dialog is canceled

    Check the reasons of cancellation in the section above.

Error while rendering the template

An undefined parameter is used in the speech response.

Object reference not set to an instance of an object

You have an empty parameter in the JSON payload defined in Send Activity to Client action.

Next steps