ex_aws
ex_aws copied to clipboard
The authorization header is malformed; a non-empty Access Key (AKID) must be provided in the credential.
Environment
- Elixir version 1.14 & Erlang version 24
- ExAws version 2.5.0
- HTTP client version 1.18.1
Current behavior
Mostly failed to read/upload files but after retrying 3/4 times it works and reads files.
Sample code to read file:
ExAws.S3.get_object("project-assets", "yallo-gjuyq/ealog-jxsyr.png") |> ExAws.request()
Expected behaviour
It should read/write the file on the first attempt.
Error
<Error>
<Code>AuthorizationHeaderMalformed</Code>
<Message>The authorization header is malformed; a non-empty Access Key (AKID) must be provided in the credential.</Message>
<RequestId>8BNSPWDTRBZ8ZSGG</RequestId>
<HostId>eYIsLyoStWtle4KHE0lCM/ipmKEwqXNvfe37kwciV5pX5aoRKe9TE0cpARb1Cvw9K7t3YbKvIsY=</HostId>
</Error>
That's weird. What's your config look like (with keys redacted, obviously)? Because it works fine for plenty of people so there must be something specifically weird in your setup.
It worked fine before the update to the latest version (2.5.5) and used the same config.
config :ex_aws,
access_key_id: System.fetch_env!("AWS_ACCESS_KEY_ID"),
secret_access_key: System.fetch_env!("SECRET_ACCESS_KEY"),
region: "eu-west-1",
json_codec: Jason
Then we revert back the version to 2.4.4 and it works.