You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "dentiny (via GitHub)" <gi...@apache.org> on 2026/03/24 03:02:37 UTC

[I] bug: S3 presign discards write operation [opendal]

dentiny opened a new issue, #7275:
URL: https://github.com/apache/opendal/issues/7275

   ### Describe the bug
   
   It reads to me that S3 `presign` implementation for write operation somehow discards the user-provided `OpWrite` argument: https://github.com/apache/opendal/blob/9fe02f2066c1dfd36196ddc97cb575a4cf24f558/core/services/s3/src/backend.rs#L1102-L1105
   while other operations (stats and read) do pass correctly: https://github.com/apache/opendal/blob/9fe02f2066c1dfd36196ddc97cb575a4cf24f558/core/services/s3/src/backend.rs#L1097-L1101
   
   ### Steps to Reproduce
   
   N/A
   
   ### Expected Behavior
   
   User-specified arguments should be respected instead of passing default.
   
   ### Additional Context
   
   _No response_
   
   ### Are you willing to submit a PR to fix this bug?
   
   - [x] Yes, I would like to submit a PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: S3 presign discards write operation [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo closed issue #7275: bug: S3 presign discards write operation
URL: https://github.com/apache/opendal/issues/7275


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: S3 presign discards write operation [opendal]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #7275:
URL: https://github.com/apache/opendal/issues/7275#issuecomment-4115055255

   <!-- Answer -->
   Good catch! I can confirm this bug exists. In the [presign implementation](https://github.com/apache/opendal/blob/27d5677d4526519313cbce00cd28f8fbcc099642/core/src/services/s3/backend.rs#L1138-L1141), the write operation explicitly discards the user-provided `OpWrite`:
   
   ```rust
   PresignOperation::Write(_) => {
       self.core
           .s3_put_object_request(path, None, &OpWrite::default(), Buffer::new())
   }
   ```
   
   The underscore pattern `Write(_)` ignores the argument, and `OpWrite::default()` is used instead. This contrasts with `presign_stat` and `presign_read`, which correctly pass their operation arguments:
   - `PresignOperation::Stat(v) => self.core.s3_head_object_request(path, v)`
   - `PresignOperation::Read(v) => self.core.s3_get_object_request(path, BytesRange::default(), &v)`
   
   The fix should be straightforward:
   ```rust
   PresignOperation::Write(v) => {
       self.core
           .s3_put_object_request(path, None, &v, Buffer::new())
   }
   ```
   
   This ensures user-specified metadata like content type, cache control, content disposition, and user metadata are properly included in presigned write URLs. Looking forward to your PR!
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=brand-link).*
   
   ---
   <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/250a2480-fb72-4739-babe-8dea46ac0860?feedback_type=great_response&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/250a2480-fb72-4739-babe-8dea46ac0860?feedback_type=irrelevant_answer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/250a2480-fb72-4739-babe-8dea46ac0860?feedback_type=incorrect_sources&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/250a2480-fb72-4739-babe-8dea46ac0860?feedback_type=too_verbose&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/250a2480-fb72
 -4739-babe-8dea46ac0860?feedback_type=hallucination&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/250a2480-fb72-4739-babe-8dea46ac0860?feedback_type=bug_report&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-bug_report) | [Other](https://app.dosu.dev/response-feedback/250a2480-fb72-4739-babe-8dea46ac0860?feedback_type=other&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-other)</sup>
   
   [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/997a2c5a-0c54-497b-989d-44651635dd36/ask?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=chat-badge)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=Good%20catch%21%20I%20can%20confirm%20this%20bug%20exists.%20In%20the%20%5Bpresign%20implementation%5D%28https%3A//github.com/apache/opendal/blob/27d5677d4526519313cbce00cd28f8fbcc099642/core/src/services/s3/backend.rs%23L1138-L1141%29%2C%20the%20write%20operation%20explicitly%20discards%20the%20user-provided%20%60OpWrite%60%3A%0A%0A%60%60%60rust%0APresignOperation%3A%3AWrite%28_%29%20%3D%3E%20%7B%0A%20%20%20%20self.core%0A%20%20%20%20%20%20%20%20.s3_put_object_request%28path%2C%20None%2C%20%26OpWrite%3A%3Adefault%28%29%2C%20Buffer%3A%3Anew%28%29%29%0A%7D%0A%60%60%60%0A%0AThe%20underscore%20pattern%20%60Write%28_%29%60%20ignores%20the%20argument%2C%20and%20%60OpWrite%3A%3Ad
 efault%28%29%60%20is%20used%20instead.%20This%20contrasts%20with%20%60presign_stat%60%20and%20%60presign_read%60%2C%20which%20correctly%20pass%20their%20operation%20arguments%3A%0A-%20%60PresignOperation%3A%3AStat%28v%29%20%3D%3E%20self.core.s3_head_object_request%28path%2C%20v%29%60%0A-%20%60PresignOperation%3A%3ARead%28v%29%20%3D%3E%20self.core.s3_get_object_request%28path%2C%20BytesRange%3A%3Adefault%28%29%2C%20%26v%29%60%0A%0AThe%20fix%20should%20be%20straightforward%3A%0A%60%60%60rust%0APresignOperation%3A%3AWrite%28v%29%20%3D%3E%20%7B%0A%20%20%20%20self.core%0A%20%20%20%20%20%20%20%20.s3_put_object_request%28path%2C%20None%2C%20%26v%2C%20Buffer%3A%3Anew%28%29%29%0A%7D%0A%60%60%60%0A%0AThis%20ensures%20user-specified%20metadata%20like%20content%20type%2C%20cache%20control%2C%20content%20disposition%2C%20and%20user%20metadata%20are%20properly%20included%20in%20presigned%20write%20URLs.%20Looking%20forward%20to%20your%20PR%21)&nbsp;[![Join Discord](https://img.shields.io/badge/jo
 in-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=join-discord)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/opendal/issues/7275)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: S3 presign discards write operation [opendal]

Posted by "dentiny (via GitHub)" <gi...@apache.org>.
dentiny commented on issue #7275:
URL: https://github.com/apache/opendal/issues/7275#issuecomment-4115358901

   @BillionClaw I put a PR already, code review welcomed :)
   PR: https://github.com/apache/opendal/pull/7276


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: S3 presign discards write operation [opendal]

Posted by "BillionClaw (via GitHub)" <gi...@apache.org>.
BillionClaw commented on issue #7275:
URL: https://github.com/apache/opendal/issues/7275#issuecomment-4115355181

   Looking into the S3 presign operation flag issue — will submit a fix.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org