BotBuilder-Samples: Unexplained errors while replying to a conversation

Version

botbuilder-integration-aiohttp>=4.9.1

Describe the bug

We have deployed a teams bot with python SDK. Intermittently when the users are trying to converse with the bot we get exceptions in the SDK

concurrent.futures._base.CancelledError if “MemberNotFoundInConversation” in e.args[0]: IndexError: tuple index out of range

although if the same user retries the same message again , right away everything works fine. Due to this we are unable to scale the bot further.

To Reproduce

Steps to reproduce the behavior: Intermittent issue, Start the bot and monitor the conversation logs

Expected behavior

  1. Give clear error message explaining where is the issue
  2. Bot should respond to the user

Screenshots

Error type 1

[2020-09-11 04:23:37 +0000] [12] [DEBUG] [on_turn_error] unhandled error: DEBUG:aiohttp.web: [on_turn_error] unhandled error: Traceback (most recent call last): File “/usr/local/lib/python3.7/site-packages/botbuilder/core/bot_adapter.py”, line 128, in run_pipeline context, callback File “/usr/local/lib/python3.7/site-packages/botbuilder/core/middleware_set.py”, line 69, in receive_activity_with_status return await self.receive_activity_internal(context, callback) File “/usr/local/lib/python3.7/site-packages/botbuilder/core/middleware_set.py”, line 79, in receive_activity_internal return await callback(context) File “/usr/local/lib/python3.7/site-packages/botbuilder/core/activity_handler.py”, line 68, in on_turn await self.on_message_activity(turn_context) File “/teams-connector/bot/teams_bot.py”, line 112, in on_message_activity await turn_context.send_activity(row[‘text’]) File “/usr/local/lib/python3.7/site-packages/botbuilder/core/turn_context.py”, line 170, in send_activity result = await self.send_activities([activity_or_text]) File “/usr/local/lib/python3.7/site-packages/botbuilder/core/turn_context.py”, line 217, in send_activities return await self._emit(self._on_send_activities, output, logic()) File “/usr/local/lib/python3.7/site-packages/botbuilder/core/turn_context.py”, line 295, in _emit return await logic File “/usr/local/lib/python3.7/site-packages/botbuilder/core/turn_context.py”, line 212, in logic responses = await self.adapter.send_activities(self, output) File “/usr/local/lib/python3.7/site-packages/botbuilder/core/bot_framework_adapter.py”, line 728, in send_activities raise error File “/usr/local/lib/python3.7/site-packages/botbuilder/core/bot_framework_adapter.py”, line 714, in send_activities activity.conversation.id, activity.reply_to_id, activity File “/usr/local/lib/python3.7/site-packages/botframework/connector/aio/operations_async/_conversations_operations_async.py”, line 529, in reply_to_activity request, stream=False, **operation_config File “/usr/local/lib/python3.7/site-packages/msrest/async_client.py”, line 115, in async_send pipeline_response = await self.config.pipeline.run(request, **kwargs) File “/usr/local/lib/python3.7/site-packages/msrest/pipeline/async_abc.py”, line 159, in run return await first_node.send(pipeline_request, **kwargs) # type: ignore File “/usr/local/lib/python3.7/site-packages/msrest/pipeline/async_abc.py”, line 79, in send response = await self.next.send(request, **kwargs) # type: ignore File “/usr/local/lib/python3.7/site-packages/msrest/pipeline/async_requests.py”, line 106, in send return await self.next.send(request, **kwargs) File “/usr/local/lib/python3.7/site-packages/msrest/pipeline/async_abc.py”, line 79, in send response = await self.next.send(request, **kwargs) # type: ignore File “/usr/local/lib/python3.7/site-packages/msrest/pipeline/async_abc.py”, line 79, in send response = await self.next.send(request, **kwargs) # type: ignore File “/usr/local/lib/python3.7/site-packages/msrest/pipeline/async_requests.py”, line 85, in send await self.driver.send(request.http_request, **kwargs) File “/usr/local/lib/python3.7/site-packages/msrest/universal_http/async_requests.py”, line 91, in send return await super(AsyncRequestsHTTPSender, self).send(request, **requests_kwargs) File “/usr/local/lib/python3.7/site-packages/msrest/universal_http/async_requests.py”, line 79, in send await future concurrent.futures._base.CancelledError

Error Type 2

[on_turn_error] unhandled error: tuple index out of range DEBUG:aiohttp.web: [on_turn_error] unhandled error: tuple index out of range Traceback (most recent call last): File “/teams-connector/bot/teams_bot.py”, line 162, in get_member_details turn_context, turn_context.activity.from_property.id File “/usr/local/lib/python3.7/site-packages/botbuilder/core/teams/teams_info.py”, line 175, in get_member connector_client, conversation_id, member_id File “/usr/local/lib/python3.7/site-packages/botbuilder/core/teams/teams_info.py”, line 264, in _get_member conversation_id, member_id File “/usr/local/lib/python3.7/site-packages/botframework/connector/aio/operations_async/_conversations_operations_async.py”, line 731, in get_conversation_member request, stream=False, **operation_config File “/usr/local/lib/python3.7/site-packages/msrest/async_client.py”, line 115, in async_send pipeline_response = await self.config.pipeline.run(request, **kwargs) File “/usr/local/lib/python3.7/site-packages/msrest/pipeline/async_abc.py”, line 159, in run return await first_node.send(pipeline_request, **kwargs) # type: ignore File “/usr/local/lib/python3.7/site-packages/msrest/pipeline/async_abc.py”, line 79, in send response = await self.next.send(request, **kwargs) # type: ignore File “/usr/local/lib/python3.7/site-packages/msrest/pipeline/async_requests.py”, line 106, in send return await self.next.send(request, **kwargs) File “/usr/local/lib/python3.7/site-packages/msrest/pipeline/async_abc.py”, line 79, in send response = await self.next.send(request, **kwargs) # type: ignore File “/usr/local/lib/python3.7/site-packages/msrest/pipeline/async_abc.py”, line 79, in send response = await self.next.send(request, **kwargs) # type: ignore File “/usr/local/lib/python3.7/site-packages/msrest/pipeline/async_requests.py”, line 85, in send await self.driver.send(request.http_request, **kwargs) File “/usr/local/lib/python3.7/site-packages/msrest/universal_http/async_requests.py”, line 91, in send return await super(AsyncRequestsHTTPSender, self).send(request, **requests_kwargs) File “/usr/local/lib/python3.7/site-packages/msrest/universal_http/async_requests.py”, line 79, in send await future concurrent.futures._base.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “/usr/local/lib/python3.7/site-packages/botbuilder/core/bot_adapter.py”, line 128, in run_pipeline context, callback File “/usr/local/lib/python3.7/site-packages/botbuilder/core/middleware_set.py”, line 69, in receive_activity_with_status return await self.receive_activity_internal(context, callback) File “/usr/local/lib/python3.7/site-packages/botbuilder/core/middleware_set.py”, line 79, in receive_activity_internal return await callback(context) File “/usr/local/lib/python3.7/site-packages/botbuilder/core/activity_handler.py”, line 68, in on_turn await self.on_message_activity(turn_context) File “/teams-connector/bot/teams_bot.py”, line 75, in on_message_activity email_id, name, tenant_id = await self.get_member_details(turn_context) File “/teams-connector/bot/teams_bot.py”, line 165, in get_member_details if “MemberNotFoundInConversation” in e.args[0]: IndexError: tuple index out of range

`

Additional context

we used below starter code, and more or less have the same structure https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/python/57.teams-conversation-bot

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17 (10 by maintainers)

Most upvoted comments

@v-kydela Sure that sounds good !

to answer your questions ,

  1. I havent tested it but i suspect it does. I will test this today and get back,
  2. Yes
  3. I need to test this. I will report back on this.