Alienwarez
Alienwarez2mo ago

also R2 requires all non-trailing parts

also R2 requires all non-trailing parts to have the same length, if I try to upload a big file on the dashboard of convex it shows this error
INFO convex-cloud-http: [] 10.0.11.4:35506 "OPTIONS /api/storage/upload
INFO file_storage::core: Uploading with content length Some(ContentLength(20782000))
ERROR common::errors: Caught error (RUST_BACKTRACE=1 RUST_LOG=info,common::errors=debug for full trace): service error: unhandled error (InvalidPart): Error { code: "InvalidPart", message: "All non-trailing parts must have the same length." }
INFO convex-cloud-http: [] 10.0.11.4:35506 "OPTIONS /api/storage/upload
INFO file_storage::core: Uploading with content length Some(ContentLength(20782000))
ERROR common::errors: Caught error (RUST_BACKTRACE=1 RUST_LOG=info,common::errors=debug for full trace): service error: unhandled error (InvalidPart): Error { code: "InvalidPart", message: "All non-trailing parts must have the same length." }
1 Reply
nipunn
nipunn2mo ago
if you have time to work on it - we'd take a PR with a fix! The file storage code is more battle tested with S3 than with R2. @Spioune worked on it and might be able to help you out if they have time. https://github.com/get-convex/convex-backend/pull/53
GitHub
Add support for Cloudflare R2 Storage by Spioune · Pull Request #5...
This PR introduces support for Cloudflare R2 by adding a new environment variable, AWS_ENDPOINT_URL, and replacing get_object_attributes with head_object. From the S3 documentation, get_object_attr...

Did you find this page helpful?