ex-aws / ex_aws

A flexible, easy to use set of clients AWS APIs for Elixir

Home Page:https://hex.pm/packages/ex_aws

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

briankariuki opened this issue · comments

Environment

  • Elixir & Erlang versions Elixir 1.16.2 (compiled with Erlang/OTP 26):
  • ExAws version 2.5.1
  • HTTP client version. hackney 1.20.1

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.