Skip to content

Set fields in AIOConfig to prevent MissingContentLength error on upload #2665

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

Merged
merged 1 commit into from
Jun 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions backend/btrixcloud/storages.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,15 @@ async def get_s3_client(

session = aiobotocore.session.get_session()

config = None
config = AioConfig(
request_checksum_calculation="WHEN_REQUIRED",
response_checksum_validation="WHEN_REQUIRED",
)

if for_presign and storage.access_endpoint_url != storage.endpoint_url:
s3 = {"addressing_style": storage.access_addressing_style}
config = AioConfig(signature_version="s3v4", s3=s3)
config.signature_version = "s3v4"
config.s3 = s3

async with session.create_client(
"s3",
Expand Down
2 changes: 1 addition & 1 deletion backend/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ loguru
aiofiles
kubernetes-asyncio==29.0.0
kubernetes
aiobotocore
aiobotocore>=2.22.0
requests
redis>=5.0.0
pyyaml
Expand Down
Loading