Fork me on GitHub
#datomic
<
2020-11-27
>
daniel.spaniel09:11:44

I am trying to set up a composite tuple index for lets say an account entity and I am doing this ( which is like something straight out of the docs )

{:db/ident       :account/company+number
 :db/valueType   :db.type/tuple
 :db/tupleAttrs  [:account/company :account/number]
 :db/cardinality :db.cardinality/one
 :db/unique      :db.unique/value
 }
where the account/company is a ref and the account/number is a long. the problem is that the account/number value (that datomic is filling in) is always -> nil. it seems like this tuple will be filled in by datomic correctly when the attrs are anything BUT ref and something else. if i do keyword and long its fine, but ref and anything else does not work. is this a known issue ?

souenzzo12:11:35

I tryied to reproduce this issue here https://gist.github.com/souenzzo/3ba161909006ef08d53ac63a1d622fa2 But I can't understand where you are seeing this nil

daniel.spaniel12:11:22

i am going to run this gist in my db and see if i can alter it to show good reproduction of issue

👍 3
daniel.spaniel13:11:09

this does work on my db so that was interesting. thanks. i now have to correlate this with my schema and see what is different. Muchos thanks again!

daniel.spaniel16:11:46

i found the problem .. we are doing this

{:db/ident       :accounting-category/company+number
                           :db/valueType   :db.type/tuple
                           :db/tupleAttrs  [:entity/company :accounting-category/number]
                           :db/cardinality :db.cardinality/one
                           :db/unique      :db.unique/value
                           }

daniel.spaniel16:11:00

and this attribute entity/company is shared with other entities.

daniel.spaniel16:11:17

seems like datomic trying to make this tuple for any entity with that attirbute and not just accounting-category entity

daniel.spaniel16:11:35

is there a way to stop that and only make this constraint tuple when this exact entity is created / edited ?

jcf14:11:59

Is anyone here using AssumeRole/STS to delegate access to sub-accounts in AWS, and successfully connecting to a running Datomic system with the Datomic CLI?

./datomic cloud list-systems --profile example-dev
WARNING: When invoking clojure.main, use -M
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
Execution error (ExceptionInfo) at datomic.tools.ops.aws/invoke! (aws.clj:83).
AWS Error: Unable to fetch credentials. See log for more details.
Running aws --profile example-dev s3 ls works as expected so I think this might be a problem in the Datomic CLI side of things. My ~/.aws/config looks good to me:
[profile example]
region=eu-west-2

[profile example-dev]
role_arn=arn:aws:iam::111111111111:role/developer
source_profile=example
Credentials should be inherited from the example profile… the AWS CLI appears to get this right so I think my ~/.aws stuff is kosher.

jcf14:11:06

I vaguely remember a problem with some Datomic tooling and use of assumed roles. The workaround was to juggle your AWS config about so you're not using profiles but this won't work here as I have to STS my way into the sub account. No direct access possible.

jcf14:11:41

I've added the SSH ingress rule to the bastion security group, and I've attached the Datomic Admin policy to the role that gets assumed when you switch into the sub-account.

jcf14:11:46

I don't know what the "log" is that the error refers to. I've seen that in cognitect-labs/aws-api too and didn't know what log was being referred to there either. 🙈