Fork me on GitHub
#datomic
<
2020-07-04
>
Aron11:07:39

Hi, continuing from here: https://clojurians.slack.com/archives/C053AK3F9/p1593859141412800 I cloned the ion-starter repo and I am reading https://docs.datomic.com/cloud/ions/ions-tutorial.html#orge88f23e I have to make sure I have installed the ion-dev tools. So I changed the config files according to that documentation. Does that constitutes of making sure? Is there a programmatic test I could do that changing files is actually installing things?

Alex Miller (Clojure team)13:07:51

I know you’ve tried some stuff - can you roll back as close as you can to the tutorial and then share your error message?

souenzzo13:07:45

@jonwalch [:find (pull ?e [:user/foo :user/other-one {:user/bar [*]}]) :where [?e :user/bar ?bar] [?bar :bar/bazed?]] ?

Jon Walch19:07:30

The issue here is that I also need to filter on :user/foo to make sure I'm getting the correct user.

Jon Walch20:07:11

Yeah just tried a version of this. I get no results for the entire query if nothing in :user/bar has :bar/bazed? set to false.

Aron13:07:07

Afaik, I am on par with the tutorial, I did the edits described there. But actually I started from aws marketplace first because I know less about aws than about datomic. (much much much less).

Aron13:07:51

However there isn't an error message unless I try to do something more, but I am not sure what I should try. I know that some things work and one thing doesn't.

Aron13:07:23

Let me create some gists so you can see both.

Aron14:07:22

One thing that makes it difficult to roll back is that I never knew I had a m2/settings file and similar things : )

Aron14:07:18

Right now I have to admit that nothing works, not even what worked in the morning, I get Error building classpath. Could not find artifact com.datomic:ion:jar:0.9.43 in central () to every command I try

souenzzo14:07:04

@ashnur check your ~/.m2/settings.xml

Aron17:07:37

Obviously, it would be nicer if I knew what to check on it, like does it have exactly 137 bytes in it or what 🙂 https://gist.github.com/ashnur/62a62afa1c538c249110cfc0202b524a

pvillegas1215:07:05

I am trying to do a recursive query

[:person/firstName :person/lastName {:person/friends ...}]
However, I would like to impose a condition on the recursion. For example, if the friend has the name “bob”. It looks like the recursion is on the read side of the pull, but I was wondering if there is some way to do recursion and have a condition on the friends (recursion attribute)?

Joe Lane18:07:06

@ashnur Are you still running into issues?

Aron18:07:01

They haven't been resolved yet

Joe Lane18:07:09

In my ~/.clojure/deps.edn I have these entries for my maven repos and an ion-dev alias

:aliases           {:ion-dev {:extra-deps {com.datomic/ion-dev {:mvn/version "0.9.265"}}
                     :main-opts ["-m" "datomic.ion.dev"]}}
:mvn/repos {"datomic-cloud" {:url ""}
             "central" {:url ""}
             "clojars" {:url ""}}

Joe Lane18:07:43

Of particular importance is the "datomic-cloud" entry under :mvn/repos

Aron18:07:51

I do have that too

Joe Lane18:07:12

What is your OS?

Joe Lane18:07:56

Can you show me the project's deps.edn?

Joe Lane18:07:01

Also, how are you "running" your project locally? What is the exact operation you're using to start a repl? Why do you have ?region-eu-west-1 at the end of the datomic-releases entry?

Aron18:07:41

I am not sure what "running locally" would mean in this context

Aron18:07:03

I don't usually start any repls

Aron18:07:40

what you call 'project' here is literally a core.clj with a single hello world function, I can run it many ways

Joe Lane18:07:22

I don't think you're interpreting the procurers section right.

Aron18:07:34

last time it worked I ran clj -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]" --interactive but obviously that also doesn't do anything right now just says the same error as above

Aron18:07:50

I haven't interpreted it at all, it was linked in a forum post

Joe Lane18:07:21

Which forum post are you referring to?

Aron18:07:35

If I am doing something stupid, just tell me 🙂

Joe Lane18:07:42

What is the output of aws s3 cp .

Joe Lane18:07:13

Also, nothing in the forum post you sent makes me think you need to append ?region-eu-west-1

Joe Lane18:07:55

After you paste the output of the aws s3 cp ... command, can you replace the :mvn/repos entry in your deps.edn with all three entries in the message I pasted above? https://clojurians.slack.com/archives/C03RZMDSH/p1593886989420200

Joe Lane18:07:35

Then run simply clj in the project root.

Joe Lane18:07:44

No nrepl or anything.

Joe Lane18:07:51

@ me when you do the above

Aron19:07:33

fatal error: An error occurred (403) when calling the HeadObject operation: Forbidden

Joe Lane20:07:59

@ashnur I didn't see this until just now. What is the output of

aws sts get-caller-identity

Aron20:07:08

{
    "UserId": "AIDAT24PJRSJ6WKCBUGPZ",
    "Account": "263904136339",
    "Arn": "arn:aws:iam::263904136339:user/same-page-dev"
}

Aron20:07:58

no worries, I think I am having some s3 access errors

Alex Miller (Clojure team)20:07:27

do you have aws env vars set?

Aron20:07:03

yes, but wait a second, I just have a terrible suspicion, let me check something

Aron20:07:33

Ok, I had to check that there are no typos, I wish I'd found one. I made some edits for consistency, but the user is added to the group, the policy is attached to the group and AWS shows that the user is active and it's used. I am not sure why the s3 thing says forbidden, I will try to debug that because even if it's unrelated, it should be working anyway, but maybe it helps.

Alex Miller (Clojure team)22:07:05

clj is trying to download the jar from the cloud s3 maven bucket. what region is your user in? I assume you're not running this from inside aws or anything like that.

Aron06:07:04

I am running this on my laptop, which I assume is not inside aws, but I am unfamiliar with the terminology, tell me if I misunderstood, please.

daniel.spaniel21:07:18

is there a way to query for an entity and its children (recursively) but also ( while recursing ) exclude certain children? I have query like this

(ffirst
    (d/q '[:find (pull ?e pattern)
           :in $ pattern ?tree-id ?company-id
           :where
           [?e :accounting-tree/id ?tree-id]
           [?e :accounting-account/children ?c]
           (or-join [?c ?company-id]
             [(missing? $ ?c :entity/company)]
             [?c :entity/company ?company-id])
           ]
      db '[* {:accounting-account/children ...}]
      tree-id company-id))

daniel.spaniel21:07:50

but it does not exclude the children without that company-id . I have tried many variations but no luck

bamarco22:07:10

I am trying to allow one of my ions to access dynamodb. I am following https://docs.datomic.com/cloud/operation/access-control.html#authorize-ions When I get to the step: > Adding an IAM Policy to Datomic Nodes > > The Datomic Compute CF template lets you specify a custom policy via the template parameter named `NodePolicyArn`. In the console UI this parameter appears under:

Optional Configuration | Existing IAM managed policy for instances
> You can set or update your custom node policy at any time by performing a https://docs.datomic.com/cloud/operation/howto.html#update-parameter, setting the `NodePolicyArn` to the ARN of your policy. > > Neither https://console.aws.amazon.com/console/home?region=us-east-1 nor https://console.aws.amazon.com/iam/home?region=us-east-1#/home seems to have an "Optional Configuration" option