This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-01-30
Channels
- # admin-announcements (1)
- # announcements (1)
- # babashka (8)
- # bristol-clojurians (1)
- # calva (36)
- # clojure (115)
- # clojure-europe (5)
- # clojure-italy (4)
- # clojure-nl (3)
- # clojure-norway (3)
- # clojure-uk (161)
- # clojuredesign-podcast (3)
- # clojurescript (71)
- # core-async (34)
- # cursive (26)
- # datomic (43)
- # docker (2)
- # emacs (24)
- # figwheel-main (1)
- # fulcro (36)
- # graalvm (7)
- # immutant (2)
- # jackdaw (1)
- # jobs (2)
- # leiningen (8)
- # luminus (5)
- # off-topic (29)
- # onyx (1)
- # other-languages (5)
- # pathom (6)
- # pedestal (3)
- # reagent (11)
- # ring (8)
- # shadow-cljs (42)
- # spacemacs (17)
- # specter (6)
- # tools-deps (80)
- # videos (1)
Hello everyone! I'm kicking the tyres on Datomic Cloud, and have run into a problem that I think might be a bug.
I have a working SOCKS proxy and can curl -x "socks5h://...
to verify the connection is healthy. Now I'm trying to create a database but I'm getting an error about there not being an AWS profile with the name I've specified in my config:
(def cfg
{:server-type :ion
:region "eu-west-1"
:system "<REDACTED>"
:creds-profile "dev"
:endpoint ".<REDACTED>. "
:proxy-port 8182})
With that config I can create a client without issue, and can invoke the call to datomic.client.api/create-database
but that's where this exception is thrown:
1. Unhandled clojure.lang.ExceptionInfo
No AWS profile named 'dev'
#:cognitect.anomalies{:category :cognitect.anomalies/fault,
:message "No AWS profile named 'dev'"}
async.clj: 58 datomic.client.api.async/ares
async.clj: 54 datomic.client.api.async/ares
sync.clj: 73 datomic.client.api.sync.Client/create_database
api.clj: 144 datomic.client.api/create-database
api.clj: 135 datomic.client.api/create-database
I know that profile does exist. I can use it via the CLI (e.g. aws --profile dev s3 ls
). I'm using STS to access an organisation within my account, and I think this might be where the problem comes from.
@ghadi not yet. Just trying to create a database from my local machine. I thought the client could create DBs with Datomic Cloud, but maybe not?
1. Caused by clojure.lang.ExceptionInfo
:server-type must be one of :cloud, :local, :peer-client, or :peer-server
#:cognitect.anomalies{:category :cognitect.anomalies/incorrect,
:message
":server-type must be one of :cloud, :local, :peer-client, or :peer-server"}
That's good because using :peer-client
gave me this:
1. Caused by .FileNotFoundException
Could not locate datomic/peer_client__init.class, datomic/peer_client.clj or
datomic/peer_client.cljc on classpath. Please check that namespaces with
dashes use underscores in the Clojure file name.
😄:deps
{com.cognitect/anomalies {:mvn/version "0.1.12"}
com.datomic/client-cloud {:mvn/version "0.8.81"}
com.datomic/ion {:mvn/version "0.9.35"}
org.clojure/clojure {:mvn/version "1.10.1"}
org.clojure/data.json {:mvn/version "0.2.7"}}
Prerequestites to then get to https://docs.datomic.com/cloud/getting-started/start-system.html. Then on to https://docs.datomic.com/cloud/getting-started/get-connected.html. Now I'm doing the client API cloud tutorial above.
@ghadi I'm pretty sure @daemianmack and Joe ran into this same problem when we were trying to pull together a Datomic Cloud demo on a recent consulting gig. There was some workaround they needed to get profiles working across AWS orgs.
I've got the same setup where I have a root AWS account with IAM users. Those users assume an admin role in sub-orgs via profiles. It works via the AWS CLI but I think maybe the Java SDK doesn't work the same way.
This has been open for a couple of years and appears unresolved: https://github.com/aws/aws-sdk-java/issues/803
No AWS profile named 'dev' is a really odd error. It looks like the profile isn't being found at all as opposed to not having the right permissions etc.
I wonder if there's a way to pass in my own AWS credential provider? https://github.com/cognitect-labs/aws-api/blob/635a0dfaa6f60e8158196874fa1a99e3db69d83a/examples/assume_role_example.clj#L46-L64
heya @jcf! how’s things?
Hey, @daemianmack! Really good thanks! Hope you're well. 🙂
i don’t quite understand why you’d get that profile error at that point in the sequence, instead of earlier, but we eventually settled on aws-mfa
to handle that piece of things — https://github.com/broamski/aws-mfa
yeee…. essss.
Creating a custom credential provider's going to mean some lifecycle management from the looks of it. I have to stop the provider. Hmm. This is surely too fiddly to be the right way of connecting things.
Ahh, shucks! Looks like Datomic Client doesn't use aws-api. I think I'm going to park this for today. Why I'm getting told I don't have a profile that I know exists I'm not sure but I'll dig in more soon.
Thanks for the help, @ghadi @daemianmack! Much appreciated. 🙂
Does Datomic not allow you to divide two numbers in a query and get a number that is between 0-1?
e.g. [(/ ?connected-mins ?reported-mins) ?percent-connected]
?percent-connected is always 0 for some reason.
Huh... https://docs.datomic.com/cloud/query/query-data-reference.html#built-in-functions > Datomic's / operator is similar to Clojure's / in terms of promotion and contagion with a notable exception: Datomic's / operator does not return a clojure.lang.Ratio to callers. Instead, it returns a quotient as per quot. I guess I have to store these attributes as doubles to be able to do division on them?