[PR #13354] fix: add compatibility config for third-party S3-compatible providers #27930

Closed
opened 2026-02-21 20:42:28 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/13354

State: closed
Merged: Yes


Summary

dify 0.15.3 upgraded boto3 version

image

Starting in boto3-1.36.0, the request_checksum_calculation config is set to when_supported in all AWS SDKs and AWS CLI (see https://github.com/boto/boto3/issues/4392 for more details). This means SDKs will now compute checksums by default for service operations that model support for them.

This update has introduced an incompatibility issue with certain third-party S3-compatible providers including Huawei Cloud OBS and ByteDance TOS, which currently do not support this new configuration. When executing the PutObject operation, the system returns an error: "The provided content-sha256 does not match what was computed."

Setting the following when create boto3 client fixes the problem, this skips the calculation and validation of checksums when not required:
request_checksum_calculation="when_required"
response_checksum_validation="when_required"

Rolling back to boto3==1.35.x can also solve this problem, but I'm not sure if there are any features that depend on the new version sdk.

See the Data Integrity Protections for Amazon S3 guide for more details.

Resolves https://github.com/langgenius/dify/issues/13348

Screenshots

Before After
bug fix

Checklist

Important

Please review the checklist below before submitting your pull request.

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
**Original Pull Request:** https://github.com/langgenius/dify/pull/13354 **State:** closed **Merged:** Yes --- # Summary dify 0.15.3 upgraded boto3 version <img width="501" alt="image" src="https://github.com/user-attachments/assets/ac3f6acf-52d6-4654-8d85-88220060d29d" /> Starting in boto3-1.36.0, the request_checksum_calculation config is set to when_supported in all AWS SDKs and AWS CLI (see https://github.com/boto/boto3/issues/4392 for more details). This means SDKs will now compute checksums by default for service operations that model support for them. This update has introduced an incompatibility issue with certain third-party S3-compatible providers including Huawei Cloud OBS and ByteDance TOS, which currently do not support this new configuration. When executing the PutObject operation, the system returns an error: "The provided content-sha256 does not match what was computed." Setting the following when create boto3 client fixes the problem, this skips the calculation and validation of checksums when not required: `request_checksum_calculation="when_required"` `response_checksum_validation="when_required"` Rolling back to `boto3==1.35.x` can also solve this problem, but I'm not sure if there are any features that depend on the new version sdk. See the [Data Integrity Protections for Amazon S3](https://docs.aws.amazon.com/sdkref/latest/guide/feature-dataintegrity.html) guide for more details. Resolves https://github.com/langgenius/dify/issues/13348 # Screenshots | Before | After | |--------|-------| | <img width="1584" alt="bug" src="https://github.com/user-attachments/assets/da49cccd-3418-4128-a23c-c39ac41dbdee" /> | <img width="1572" alt="fix" src="https://github.com/user-attachments/assets/b768afe6-0162-49ce-b0fd-a9fdaf8ea651" /> | # Checklist > [!IMPORTANT] > Please review the checklist below before submitting your pull request. - [ ] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) - [x] I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!) - [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change. - [x] I've updated the documentation accordingly. - [x] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods
yindo added the pull-request label 2026-02-21 20:42:28 -05:00
yindo closed this issue 2026-02-21 20:42:28 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#27930