fix(backup): S3 backup failure with proxied connections #11026
+21
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
S3 backups fail when proxy is enabled, producing incomplete uploads with error
put_object write size < data.size(), w_size=15728640, data.size=16396159. AWS SDK v3 uses the global fetch/undici dispatcher which routes through the proxy manager, causing stream corruption on large files.Changes
Configure S3Client to bypass proxy
undici.Agentdispatcher to S3Storage constructorFetchHttpHandlerusing direct dispatcherThis ensures S3 requests bypass the global proxy, preventing stream interference during large file uploads while maintaining proxy functionality for other services.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
cdn.sheetjs.com/usr/local/bin/node /home/REDACTED/work/cherry-studio/cherry-studio/.yarn/releases/yarn-4.9.1.cjs install(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This section details on the original issue you should resolve
<issue_title>[Bug]: S3 Backup Failed</issue_title>
<issue_description>> [!NOTE]
Issue Checklist
Platform
macOS
Version
v1.6.5
Bug Description
S3-compatible storage backup failed, as shown in the image below
Steps To Reproduce
Managing backups can retrieve normally, which indicates my S3 configuration is correct
Clicking "Backup Now" shows backup failed
Expected Behavior
The expected behavior is that backup should succeed normally
Relevant Log Output
Additional Context
No response
Original Content
Issue Checklist
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.