apache / apache/arrow-rs-object-store
redirection doesn't work in put request
- Dominant language
- Rust
- Stars
- 322
- Forks
- 212
- Avg merge
- 5d 2h
- Merged PRs (30d)
- 10
Description
**Describe the bug**
Hi there.
I'm trying to use the object store with Nvidia Aistore, which uses an aws s3 backend.
I've set up aistore with 1 gateway and 1 target (storage instance).
```rust
#[tokio::main]
async fn main() {
fmt()
.with_env_filter(
EnvFilter::try_from_default_env()
.unwrap_or_else(|_| EnvFilter::new("info,object_store=trace")),
)
.init();
let client = object_store::aws::AmazonS3Builder::from_env()
.with_allow_http(true)
.build()
.unwrap();
let response = client
.get(&object_store::path::Path::from_url_path("test").unwrap())
.await
.unwrap(); # OK, this file is located in s3. Redirect is also used to get it.
tracing::info!("get response: {:?}", response);
client
.put(
&object_store::path::Path::from_url_path("test").unwrap(),
PutPayload::new(),
)
.await
.unwrap();
}
```
Error/Logs:
```sh
2026-01-14T09:53:23.862399Z DEBUG object_store::aws::builder: Using Static credential provider
2026-01-14T09:53:23.898166Z INFO example: get response: GetResult { payload: GetResultPayload(Stream), meta: ObjectMeta { location: Path { raw: "test" }, last_modified: 2026-01-14T09:46:34Z, size: 0, e_tag: None, version: None }, range: 0..0, attributes: Attributes({ContentType: AttributeValue("application/octet-stream")}) }
thread 'main' panicked at src/main.rs:38:10:
called `Result::unwrap()` on an `Err` value: Generic { store: "S3", source: RetryError(RetryErrorImpl { method: PUT, uri: Some(http://192.168.103.92:8080/s3/oo/test), retries: 0, max_retries: 10, elapsed: 415.533µs, retry_timeout: 180s, inner: Status { status: 307, body: None } }) }
```
**To Reproduce**
1. Setup Aistore: https://github.com/NVIDIA/aistore?tab=readme-ov-file#quick-start
2. Run the code shown above
My env:
```
export AWS_ENDPOINT=http://my-domain:8080/s3
export AWS_REGION=us-east-1
export AWS_ACCESS_KEY_ID=FAKEKEY
export AWS_SECRET_ACCESS_KEY=FAKESECRET
export AWS_BUCKET=oo
```
**Expected behavior**
Put is working successfully.
**Additional context**
```toml
object_store = { version = "0.13.0", features = ["aws"] }
```
Contributor guide
Research direction
Start in the AWS object-store PUT request path and reproduce the failure against the Aistore setup using the example and environment variables in the issue. Trace how the 307 response is handled for PUT, then verify that the reproduction completes successfully without the 307 error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, rust
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100