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

SignatureDoesNotMactch error while uploading a file to Ceph storage #1237

Closed
1 task
Wasif-Jamal opened this issue Jan 10, 2025 · 3 comments
Closed
1 task
Labels
bug This issue is a bug. p3 This is a minor priority issue response-requested Waiting on additional info and feedback. Will move to 'closing-soon' in 7 days. third-party This issue is related to third-party libraries or applications.

Comments

@Wasif-Jamal
Copy link

Wasif-Jamal commented Jan 10, 2025

Describe the bug

Ceph storage is compatible with S3. I am able to upload to a S3 bucket but when I try to do any operation (or upload) to Ceph storage it throws a SignatureDoesNotMatch error. I am providing the IP Address in the endpoint_url(). If I provide a domain name then it works.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

File should be uploaded to Ceph storage

Current Behavior

Throws SignatureDoesNotMatch

Reproduction Steps

#[::tokio::main]
async fn main() -> Result<(), aws_sdk_s3::Error> {
    let config = aws_config::defaults(aws_config::BehaviorVersion::latest())
    .region("custom")
    .endpoint_url("Ceph endpoint")
    .load()
    .await;

    let client = aws_sdk_s3::Client::new(&config);

    let body = aws_sdk_s3::primitives::ByteStream::from_path("filepath").await.unwrap();
    let _resp = client
        .put_object()
        .bucket("bucket name")
        .key("key for file identification")
        .body(body)
        .send()
        .await?;

    Ok(())
}

Possible Solution

No response

Additional Information/Context

virtual-hosted style addressing is not working because of the IP Address

https://mybucket.192.168.1.100/

Instead, the SDK falls back to path-style addressing, where the bucket name is part of the URL path:

http://192.168.1.100/mybucket

However, even this is not working.

Version

aws-config = { version = "1.1.7", features = ["behavior-version-latest"] }
aws-sdk-s3 = "1.68.0"
tokio = { version = "1", features = ["full"] }

Environment details (OS name and version, etc.)

Ubuntu 22.04

Logs

No response

@Wasif-Jamal Wasif-Jamal added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 10, 2025
@aajtodd aajtodd added third-party This issue is related to third-party libraries or applications. p3 This is a minor priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Jan 10, 2025
@aajtodd
Copy link
Contributor

aajtodd commented Jan 10, 2025

We don't guarantee compatibility of the SDK with anything other than the official AWS S3 service.

If you want the SDK to use path style addressing you can configure it on the client:

    let config = aws_config::defaults(aws_config::BehaviorVersion::latest())
        .region("custom")
        .endpoint_url("Ceph endpoint")
        .load()
        .await;

let s3_config = aws_sdk_s3::config::Builder::from(&config)
    .force_path_style(true)
    .build();

let s3 = aws_sdk_s3::Client::from_conf(s3_config);

See the developer guide for more information on configuring service clients.

@aajtodd aajtodd added the response-requested Waiting on additional info and feedback. Will move to 'closing-soon' in 7 days. label Jan 10, 2025
@Wasif-Jamal
Copy link
Author

Thank you for replying @aajtodd

Copy link

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

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. p3 This is a minor priority issue response-requested Waiting on additional info and feedback. Will move to 'closing-soon' in 7 days. third-party This issue is related to third-party libraries or applications.
Projects
None yet
Development

No branches or pull requests

2 participants