I’m trying to use datomic cloud and using the
[datomic.client.api :as d]
api for it. This is what I’ve done so far:
Create a client:
(d/client {
:server-type :ion
:region "us-east-1"
:system "humboi-march-2021"
:creds-profile "humboi"
:endpoint "<http://entry.humboi-march-2021.us-east-1.datomic.net:8182>"
:proxy-port 8182
})
And I evidently have the humboi named-profile in my ~/.aws/credentials:
[humboi]
aws_access_key_id = foobar
aws_secret_access_key = foobarbaz
But when I run this:
(d/create-database
client
{:db-name "humboi-march-2021"})
Amongst a lot of logs, I get this exception:
Execution error (ExceptionInfo) at datomic.client.api.async/ares (async.clj:58).
profile file cannot be null
Why am I getting this exception? Could it be possible that the database was in face created and that this exception be ignored or is that the app can genuinely not get the aws credentials?
@jaret @lanejo01 @alexmiller thanks for your help so far.Your client cannot get aws credentials, we proved that everything else works by running with the ion-starter project vs your existing app.
@lanejo01 if the credentials file can’t be read, can I put the key and the secret in the cfg map directly somehow?
No, it doesn't work like that.
This isn't a datomic related exception, see https://www.google.com/search?q=profile+file+cannot+be+null&rlz=1C5CHFA_enUS913US914&oq=profile+file+cannot+be+null&aqs=chrome..69i57j0j0i22i30l4j69i60l2.229j0j7&sourceid=chrome&ie=UTF-8
Random guess, datomic-cloud depends on a particular version of the AWS SDK, does Amazonica override that version to an incompatible version?
@lanejo01 I don’t think so. I was using amazonica 0.3.153, which I removed from dependencies, along with the related code. I still see this error upon restarting the server
did you lein clean
?
@lanejo01, yes
@lanejo01 is the library supposed to work if only the environment variables AWS_ACCESS_KEY_ID=xxx AWS_SECRET_ACCESS_KEY=yyy are provided? Does it still look for ~/.aws/credentials?
You already proved that you don't need those set a few days ago. https://clojurians.slack.com/archives/C03RZMDSH/p1615740607282600
When ion-starter worked, you didn't set credentials directly at all.
@lanejo01 you mention this: “Also, when you deploy this, you will. need to remove that creds profile and use a different approach”. What’s the different approach? Maybe I can try it in this case?
I don't think you'd want to deploy this on heroku. EC2 has iam roles baked in, you could use elastic-beanstalk for a heroku-like experience.
I see, when I’d deploy to elastic-beanstalk, the iam roles will be “baked in”. I’ll look into it. But I’ve really hit a wall with my dev setup and getting the ~/.aws/credentials into the app