ex-aws / ex_aws

A flexible, easy to use set of clients AWS APIs for Elixir
https://hex.pm/packages/ex_aws
MIT License
1.28k stars 527 forks source link

SignatureDoesNotMatch. The request signature we calculated does not match the signature you provided. Check your key and signing method. #1045

Open briankariuki opened 6 months ago

briankariuki commented 6 months ago

Environment

Current behavior

This code that streams a file from s3 lineline works in dev mode. I'm using minio as my storage server. When I make this request in production I get the error below. The code snippet I got from the ex_aws_s3 docs on streaming files.

bucket
      |> ExAws.S3.download_file(file, :memory, opts)
      |> ExAws.stream!(scheme: scheme <> "://", host: host, port: nil)
      |> Stream.chunk_while("", &chunk_fun/2, &to_line_stream_after_fun/1)
      |> Stream.concat()
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><Key>uploads/moh505_test_data.csv</Key><BucketName>shield</BucketName><Resource>/shield/uploads/moh505_test_data.csv</Resource><RequestId>17C2848BAE0756DC</RequestId><HostId>c982ebc0b30b0b1e6851f91e1fd25224e8a9cfb5f459a7264d11acb53d47a971</HostId></Error>

Expected behavior

I expect the code to work as does in dev. I don't know if its my nginx configuration or something else. File uploads, generating download links, getting a file object all work, so its not an issue with my credentials.