Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create_multipart_upload() fails with MethodNotAllowed error #127

Closed
eagletmt opened this issue Jun 23, 2021 · 1 comment · Fixed by #134
Closed

create_multipart_upload() fails with MethodNotAllowed error #127

eagletmt opened this issue Jun 23, 2021 · 1 comment · Fixed by #134
Labels
bug This issue is a bug.

Comments

@eagletmt
Copy link
Contributor

Bug Report

Version

├── aws-sdk-s3 v0.0.9-alpha (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53)
│   ├── aws-auth v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53)
│   │   ├── smithy-http v0.0.1 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53)
│   │   │   ├── smithy-types v0.0.1 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53)
│   ├── aws-endpoint v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53)
│   │   ├── aws-types v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53)
│   │   └── smithy-http v0.0.1 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53) (*)
│   ├── aws-http v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53)
│   │   ├── aws-types v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53) (*)
│   │   ├── smithy-http v0.0.1 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53) (*)
│   │   ├── smithy-types v0.0.1 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53) (*)
│   ├── aws-hyper v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53)
│   │   ├── aws-auth v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53) (*)
│   │   ├── aws-endpoint v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53) (*)
│   │   ├── aws-http v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53) (*)
│   │   ├── aws-sig-auth v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53)
│   │   │   ├── aws-auth v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53) (*)
│   │   │   ├── aws-types v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53) (*)
│   │   │   ├── smithy-http v0.0.1 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53) (*)
│   │   ├── protocol-test-helpers v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53)
│   │   ├── smithy-client v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53)
│   │   │   ├── protocol-test-helpers v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53) (*)
│   │   │   ├── smithy-http v0.0.1 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53) (*)
│   │   │   ├── smithy-http-tower v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53)
│   │   │   │   ├── smithy-http v0.0.1 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53) (*)
│   │   │   ├── smithy-types v0.0.1 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53) (*)
│   │   ├── smithy-http v0.0.1 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53) (*)
│   │   ├── smithy-http-tower v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53) (*)
│   │   ├── smithy-types v0.0.1 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53) (*)
│   ├── aws-sig-auth v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53) (*)
│   ├── aws-types v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53) (*)
│   ├── smithy-http v0.0.1 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53) (*)
│   ├── smithy-types v0.0.1 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53) (*)
│   └── smithy-xml v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.9-alpha#52164d53)

Platform

Linux reinforce 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 GNU/Linux

AWS Services

S3

Description

create_multipart_upload() fails with MethodNotAllowed error.

I tried this code:

#[tokio::main]
async fn main() -> Result<(), aws_sdk_s3::Error> {
    tracing_subscriber::fmt::init();

    let client = aws_sdk_s3::Client::from_env();
    client
        .create_multipart_upload()
        .bucket("eagletmt-test-bucket")
        .key("object.txt")
        .send()
        .await?;
    Ok(())
}

I expected to see this happen: No output

Instead, this happened: MethodNotAllowed error saying "The specified method is not allowed against this resource"

Jun 24 00:26:47.707 TRACE smithy_http_tower::dispatch: request=Request { method: POST, uri: https://s3.ap-northeast-1.amazonaws.com/eagletmt-test-bucket/object.txt?uploads?x-id=CreateMultipartUpload, version: HTTP/1.1, headers: {"content-type": "application/xml", "content-length": "0", "host": "s3.ap-northeast-1.amazonaws.com", "user-agent": "aws-sdk-rust/0.1.0 os/linux lang/rust/1.53.0", "x-amz-user-agent": "aws-sdk-rust/0.1.0 api/s3/0.0.9-alpha os/linux lang/rust/1.53.0", "authorization": Sensitive, "x-amz-date": "20210623T152647Z", "x-amz-content-sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, body: SdkBody { inner: Once(Some(b"")), retryable: true } }
Jun 24 00:26:47.811 TRACE smithy_http::middleware: response=Response { status: 405, version: HTTP/1.1, headers: {"x-amz-request-id": "FVX6191VVT1EZTEB", "x-amz-id-2": "u/wOvQaxAg1pvYpLyMzcjInAss4os5LN3UlyeGhsMcfkh6sXv31DHCx7Dry5Oz4/+58PQQTxQAU=", "allow": "HEAD, DELETE, GET, PUT", "content-type": "application/xml", "transfer-encoding": "chunked", "date": "Wed, 23 Jun 2021 15:26:50 GMT", "server": "AmazonS3"}, body: b"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>MethodNotAllowed</Code><Message>The specified method is not allowed against this resource.</Message><Method>POST</Method><ResourceType>OBJECT</ResourceType><RequestId>FVX6191VVT1EZTEB</RequestId><HostId>u/wOvQaxAg1pvYpLyMzcjInAss4os5LN3UlyeGhsMcfkh6sXv31DHCx7Dry5Oz4/+58PQQTxQAU=</HostId></Error>" }
Error: Unhandled(Error { code: Some("MethodNotAllowed"), message: Some("The specified method is not allowed against this resource."), request_id: Some("FVX6191VVT1EZTEB"), extras: {"s3_extended_request_id": "u/wOvQaxAg1pvYpLyMzcjInAss4os5LN3UlyeGhsMcfkh6sXv31DHCx7Dry5Oz4/+58PQQTxQAU="} })

It seems the request path is wrong. It should be like /eagletmt-test-bucket/object.txt?uploads&x-id=CreateMultipartUpload .

@rcoh
Copy link
Contributor

rcoh commented Jun 23, 2021

Fixed! thanks for the report and fix. This will go out in next week's release.

@rcoh rcoh added the bug This issue is a bug. label Jun 25, 2021
@rcoh rcoh closed this as completed in #134 Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants