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

[on_turn_error] unhandled error: (MessageSizeTooBig) The request content length exceeded limit of 262144 bytes. #2174

Open
javeria-geek opened this issue Sep 12, 2024 · 2 comments
Assignees
Labels
bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team.

Comments

@javeria-geek
Copy link

javeria-geek commented Sep 12, 2024

Github issues should be used for bugs and feature requests. Use Stack Overflow for general "how-to" questions.

Version

botbuilder==0.0.1
botbuilder-core==4.16.1
botbuilder-dialogs==4.16.1
botbuilder-integration-aiohttp==4.16.1

Describe the bug

Getting the File size exceed error on pdf file upload using.

Expected behavior

Max file size limit is 2MB. The file I am trying to upload is 214KB. So, it should upload without error.
Using the following approach:

conversation_id = turn_context.activity.conversation.id
                response = await connector.conversations.upload_attachment(
                    conversation_id,
                    AttachmentData(
                        name=os.path.basename(file_path),
                        original_base64=file_content,
                        type="application/pdf",
                    ),
                )

trace back

Traceback (most recent call last):
File "D:\WorkSpace-PyCharm\Python Bot\env\lib\site-packages\botbuilder\core\bot_adapter.py", line 174, in run_pipeline
return await self._middleware.receive_activity_with_status(
File "D:\WorkSpace-PyCharm\Python Bot\env\lib\site-packages\botbuilder\core\middleware_set.py", line 69, in receive_activity_with_status
return await self.receive_activity_internal(context, callback)
File "D:\WorkSpace-PyCharm\Python Bot\env\lib\site-packages\botbuilder\core\middleware_set.py", line 79, in receive_activity_internal
return await callback(context)
File "D:\WorkSpace-PyCharm\cpaclientonboardingbot\bots\dialog_bot.py", line 38, in on_turn
await super().on_turn(turn_context)
File "D:\WorkSpace-PyCharm\Python Bot\env\lib\site-packages\botbuilder\core\activity_handler.py", line 70, in on_turn
await self.on_message_activity(turn_context)
File "D:\WorkSpace-PyCharm\cpaclientonboardingbot\bots\dialog_bot.py", line 53, in on_message_activity
await run_main_conversation_flow(turn_context,self.obj_FlowAccesor,self.obj_PopulateDataModels)
File "D:\WorkSpace-PyCharm\cpaclientonboardingbot\conversationalflow\create_conversational_flow.py", line 398, in run_main_conversation_flow
response = await connector.conversations.upload_attachment(
File "D:\WorkSpace-PyCharm\Python Bot\env\lib\site-packages\botframework\connector\aio\operations_async_conversations_operations_async.py", line 1133, in upload_attachment
raise models.ErrorResponseException(self._deserialize, response)
botbuilder.schema._models_py3.ErrorResponseException: (MessageSizeTooBig) The request content length exceeded limit of 262144 bytes.

##Similar issue
https://www.google.com/search?q=why+cant+azure+bot+framework+upload+file+over+1MB&rlz=1C1UEAD_enUS1104US1104&oq=why+cant+azure+bot+framework+upload+file+over+1MB&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIJCAEQIRgKGKABMgkIAhAhGAoYoAEyCQgDECEYChigATIJCAQQIRgKGKABMgkIBRAhGAoYoAHSAQkxNzI4OGoxajeoAgewAgE&sourceid=chrome&ie=UTF-8

@javeria-geek javeria-geek added bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team. labels Sep 12, 2024
@stevkan stevkan self-assigned this Sep 13, 2024
@stevkan
Copy link
Collaborator

stevkan commented Sep 13, 2024

@javeria-geek - Thank you for raising this to our attention. I have a couple questions, to start:

botbuilder==0.0.1

  • The version of the botbuilder package seems incorrect. Can you verify what is actually being installed / what you are running?
  • What channel are your users connecting thru to interact with your bot (e.g., DirectLine, Facebook, Slack, etc.)?

@javeria-geek
Copy link
Author

javeria-geek commented Sep 16, 2024

@javeria-geek - Thank you for raising this to our attention. I have a couple questions, to start:

botbuilder==0.0.1

  • The version of the botbuilder package seems incorrect. Can you verify what is actually being installed / what you are running?
  • What channel are your users connecting thru to interact with your bot (e.g., DirectLine, Facebook, Slack, etc.)?

It is the same as, I am using "botbuilder-integration-aiohttp" mainly.

botbuilder 0.0.1
botbuilder-core 4.16.1
botbuilder-dialogs 4.16.1
botbuilder-integration-aiohttp 4.16.2
botbuilder-schema 4.16.1
botframework-connector 4.16.1
botframework-streaming 4.16.1

@tracyboehrer tracyboehrer transferred this issue from microsoft/botframework-sdk Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team.
Projects
None yet
Development

No branches or pull requests

2 participants