Skip to content

Issues with Amazon Lex when using Conversation AI Bot and MCP Server Tools

0

I'm setting up a conversational AI bot in Amazon Connect. I'm sometimes getting a random error in the conversation. The AgentCore MCP (Lambda) tool shows no errors and returns the proper data. The Lex log shows what should be returned to the user, and that is correct. But in the Amazon Connect logs, I get an internal server error. Here is the error: { "Results": "Error", "ContactId": "REDACTED", "ContactFlowId": "arn:aws:connect:us-east-1:REDACTED:instance/REDACTED/contact-flow/REDACTED", "ContactFlowName": "Main Flow", "ContactFlowModuleType": "GetUserInput", "Identifier": "Conversational AI", "Timestamp": "2025-12-23T19:48:40.540Z", "ErrorDetails": { "ErrorCode": "InternalFailure", "Message": "Internal service error occurred" } }

I'm only seeing error is in the Connect log. No other errors in the Lex, AgentCore, or Lambda logs. Those all show it is working correctly. I have tried switching the engine on the Conversation Bot from speech-to-speect to text-to-speech. Is there any way to debug this further to determine why it fails from time to time?

Thanks!

1 Answer
0

This internal service error in Amazon Connect while using a conversational AI bot with Lex integration can be challenging to troubleshoot since the error only appears in the Connect logs while Lex and Lambda logs show everything working correctly.

Here are some troubleshooting steps you can take:

  1. Check timeout settings: If your bot is processing spelled inputs or complex responses, the default timeout settings in the Lex-Connect integration might be causing issues. You can configure timeouts for voice interactions with your Lex V2 bot in Amazon Connect by using session attributes in the "Get customer input" block:
  • End Silence Threshold: x-amz-lex:audio:end-timeout-ms:[intentName]:[slotToElicit]
  • Start Silence Threshold: x-amz-lex:audio:start-timeout-ms:[intentName]:[slotToElicit]
  • Max Speech Duration: x-amz-lex:audio:max-length-ms:[intentName]:[slotToElicit]
  1. Session ID length: If you're using a custom session ID in your API calls, ensure it's not too long. There have been cases where using a 64-character session ID caused errors, while reducing it to 32 characters resolved the issue.

  2. Permissions issues: Verify that the service-linked role for Lex has all necessary permissions to interact with other services. The error might be occurring because Lex cannot access a required resource.

  3. Regional configuration: Confirm that your Amazon Lex bot and Amazon Connect instance are in the same AWS account. While they can be in different regions, they must be in the same account for the integration to work properly.

  4. Amazon Q in Connect configuration: If you're using Amazon Q in Connect, ensure you've added the Amazon Q in Connect block to your flow and that all necessary permissions are in place.

  5. Disable and re-enable features: Sometimes disabling and then re-enabling Lex Bot Management in Amazon Connect, as well as Bot Analytics and Transcripts settings, can resolve integration issues.

Since the error is intermittent, it might also be worth implementing more detailed logging in your Lambda function to capture any subtle issues that might be occurring before the error manifests in Connect.
Sources
Amazon Connect Lex Integration – Need Control Over Lex Timeout for Spelling Inputs | AWS re:Post
Amazon Lex API Call Fails: "Invalid Bot Configuration: Amazon Lex could not access your Amazon Bedrock Agent" | AWS re:Post
Amazon Q in Connect Error: Invalid Bot Configuration: Amazon Lex could not access your Q In Connect Assistant. | AWS re:Post
Troubleshoot Amazon Q in Connect self-service issues - Amazon Connect
Lex and Connect | AWS re:Post

answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.