This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-12-25
Channels
I am getting the following error trying to run uberjar
on a project containing the AWS cognitect library:
Execution error (AssertionError) at cognitect.aws.credentials/basic-credentials-provider (credentials.clj:346).
Assert failed: Missing
access-key-id
I am passing my access key ID via environment variable since I am using Digital Ocean, not AWS:
(def s3 (aws/client {:api :s3
:credentials-provider (credentials/basic-credentials-provider
{:access-key-id (:access-key env/digital-ocean)
:secret-access-key (:secret-key env/digital-ocean)})
:endpoint-override {:hostname (:hostname env/digital-ocean)
:protocol :https}
:region "us-east-2"}))
Where env
comes from environ. How can I bypass this?If this works fine in the REPL, then I suspect some difference in the environment when uberjar
is being run. If I were you, I'd add some debugging right before (def s3 ...
to see what the env/digital-ocean
map contains right before the exception occurs, whether or not it contains the expected environment variables.