datomic

Ask questions on the official Q&A site at https://ask.datomic.com!
em 2021-03-04T06:25:50.079300Z

+1 on this, I would be curious about solutions/answers here too

2021-03-04T06:37:25.083400Z

Yes, of course. But Im looking for a way to expose any transaction related information (in my case to expose some definition of created at). As it stands now there doesn't seem a way to expose transaction data

esp1 2021-03-04T19:29:48.091700Z

I'm having trouble installing the ion-dev tools as per https://docs.datomic.com/cloud/operation/howto.html#ion-dev. It looks like it's not able to retrieve the ion maven artifacts. When I run clj in the root of the ion-starter project, I get:

➜  ion-starter git:(master) βœ— clj
Downloading: com/datomic/ion/0.9.50/ion-0.9.50.pom from datomic-cloud
Downloading: com/datomic/ion/0.9.50/ion-0.9.50.jar from datomic-cloud
Error building classpath. Could not find artifact com.datomic:ion:jar:0.9.50 in central (<https://repo1.maven.org/maven2/>)
My $HOME/.clojure/deps.edn looks like:
{
  :aliases {
    :ion-dev {:deps {com.datomic/ion-dev {:mvn/version "0.9.282"}}
              :main-opts ["-m" "datomic.ion.dev"]}
  }
  :mvn/repos {
    "datomic-cloud" {:url "<s3://datomic-releases-1fc2183a/maven/releases>"}
  }
}
What am I doing wrong?

alexmiller 2021-03-04T19:34:35.092400Z

It’s not able to download from the Datomic s3 repo

alexmiller 2021-03-04T19:35:48.093200Z

You need aws creds active that have s3 permissions

2021-03-04T19:50:16.093500Z

https://clojure.org/reference/deps_and_cli#_maven_s3_repos This will provide further information for how to properly source credentials depending on which/where.

esp1 2021-03-04T20:15:03.098400Z

Hm, I'm pretty sure I did this already. I added the Datomic Administrator Policy (`datomic-admin-taxman-us-east-2`) policy to the role I'm logged in with and can successfully run datomic client access taxman , but I can't access the maven artifacts with those same creds. Upon closer inspection it looks like the Datomic Administrator Policy doesn't actually provide access to the <s3://datomic-releases-1fc2183a/maven/releases> bucket. Is there another policy somewhere I need to add in order to enable this access?

mikejcusack 2021-03-04T20:24:21.098700Z

Can you try clj -M:ion-dev from your actual project?

esp1 2021-03-04T20:25:32.098900Z

@mike.j.cusack that gives me the same error..

esp1 2021-03-04T20:26:01.099100Z

My understanding from the instructions was that the only role I needed to add was the Datomic Administrator Policy, but when I look in that policy it doesn't provide access to the <s3://datomic-releases-1fc2183a/maven/releases> bucket. Should it?

mikejcusack 2021-03-04T20:26:22.099300Z

The bucket isn't yours

esp1 2021-03-04T20:27:37.099500Z

That's true. I'm wondering how I'm supposed to get permission to read from it?

mikejcusack 2021-03-04T20:31:15.099700Z

Is that your full deps.edn or just a snippet?

mikejcusack 2021-03-04T20:31:50.099900Z

And you can aws s3 ls ?

esp1 2021-03-04T20:32:48.100100Z

that's the full deps.edn, with comments elided. i can run aws s3 ls and it shows me my own buckets.

mikejcusack 2021-03-04T20:34:39.100300Z

Try clj -M:ion-dev in a new repl. The error above isn't even for ion-dev, but ion.

esp1 2021-03-04T20:35:32.100500Z

I tried it in a blank directory w/no deps.edn and I get the same error

mikejcusack 2021-03-04T20:36:30.100700Z

Running the command I provided?

esp1 2021-03-04T20:36:38.100900Z

well, not exactly the same. i get this:

WARNING: Use of :deps in aliases is deprecated - use :replace-deps instead
Downloading: com/datomic/ion-dev/0.9.282/ion-dev-0.9.282.pom from datomic-cloud
Downloading: com/datomic/ion-dev/0.9.282/ion-dev-0.9.282.jar from datomic-cloud
Error building classpath. Could not find artifact com.datomic:ion-dev:jar:0.9.282 in central (<https://repo1.maven.org/maven2/>)

esp1 2021-03-04T20:36:51.101100Z

yes, clj -M:ion-dev

mikejcusack 2021-03-04T20:36:54.101300Z

So that's not the same error, but similar

mikejcusack 2021-03-04T20:37:15.101500Z

Which version of cli tools are you running?

esp1 2021-03-04T20:37:36.101700Z

➜  tmp git:(master) clj --version
Clojure CLI version 1.10.2.796

mikejcusack 2021-03-04T20:37:50.101900Z

@alexmiller Does this make any sense to you?

mikejcusack 2021-03-04T20:38:40.102100Z

Can you provide the full home deps.edn?

esp1 2021-03-04T20:39:52.102300Z

;; The deps.edn file describes the information needed to build a classpath.
;;
;; When using the `clojure` or `clj` script, there are several deps.edn files
;; that are combined:
;; - install-level
;; - user level (this file)
;; - project level (current directory when invoked)
;;
;; For all attributes other than :paths, these config files are merged left to right.
;; Only the last :paths is kept and others are dropped.

{
  ;; Paths
  ;;   Directories in the current project to include in the classpath

  ;; :paths ["src"]

  ;; External dependencies
 
  ;; :deps {
  ;;   org.clojure/clojure {:mvn/version "1.9.0"}
  ;; }

  ;; Aliases
	;;   resolve-deps aliases (-R) affect dependency resolution, options:
	;;     :extra-deps - specifies extra deps to add to :deps
	;;     :override-deps - specifies a coordinate to use instead of that in :deps
	;;     :default-deps - specifies a coordinate to use for a lib if one isn't found
	;;   make-classpath aliases (-C) affect the classpath generation, options:
	;;     :extra-paths - vector of additional paths to add to the classpath
	;;     :classpath-overrides - map of lib to path that overrides the result of resolving deps

  ;; :aliases {
  ;;   :deps {:extra-deps {org.clojure/tools.deps.alpha {:mvn/version "0.5.442"}}}
  ;;   :test {:extra-paths ["test"]}
  ;; }

  :aliases {
    :ion-dev {:deps {com.datomic/ion-dev {:mvn/version "0.9.282"}}
              :main-opts ["-m" "datomic.ion.dev"]} 
;;    :new {:extra-deps {seancorfield/clj-new {:mvn/version "1.1.228"}}
;;          :main-opts ["-m" "clj-new.create"]}
;;    :rebl {:extra-deps {com.cognitect/rebl          {:mvn/version "0.9.242"}
;;                        org.openjfx/javafx-fxml     {:mvn/version "15-ea+6"}
;;                        org.openjfx/javafx-controls {:mvn/version "15-ea+6"}
;;                        org.openjfx/javafx-swing    {:mvn/version "15-ea+6"}
;;                        org.openjfx/javafx-base     {:mvn/version "15-ea+6"}
;;                        org.openjfx/javafx-web      {:mvn/version "15-ea+6"}}
;;           :main-opts  ["-m" "cognitect.rebl"]}
;;    :reveal {:extra-deps {vlaaad/reveal {:mvn/version "1.1.163"}}
;;             :ns-default vlaaad.reveal
;;             :main-opts ["-m" "vlaaad.reveal" "repl"]
;;             :exec-fn repl}
  }

  ;; Provider attributes

  :mvn/repos {
  ;;   "central" {:url "<https://repo1.maven.org/maven2/>"}
  ;;   "clojars" {:url "<https://repo.clojars.org/>"}
;;    "cognitect-dev-tools" {:url "<https://dev-tools.cognitect.com/maven/releases/>"}
    "datomic-cloud" {:url "<s3://datomic-releases-1fc2183a/maven/releases>"}
  }
}

mikejcusack 2021-03-04T20:42:33.102500Z

Try renaming that file and try

{:aliases {:ion-dev {:extra-deps {com.datomic/ion-dev {:mvn/version "0.9.282"}}
                     :main-opts ["-m" "datomic.ion.dev"]}}
 :mvn/repos {"datomic-cloud" {:url "<s3://datomic-releases-1fc2183a/maven/releases>"}}}

esp1 2021-03-04T20:45:45.102700Z

same error πŸ˜“

mikejcusack 2021-03-04T20:45:57.102900Z

Did you copy/paste that directly?

esp1 2021-03-04T20:46:02.103100Z

yes

mikejcusack 2021-03-04T20:46:25.103400Z

Hmm, this isn't making sense at all to me

esp1 2021-03-04T20:47:42.103600Z

me either.. i really appreciate your taking the time to help tho!

πŸ‘ 1
mikejcusack 2021-03-04T20:48:35.103900Z

Do you have any custom settings in .m2/?

esp1 2021-03-04T20:48:41.104100Z

is that s3 url supposed to be public? i.e. if i have any s3 access should i be able to do aws s3 ls <s3://datomic-releases-1fc2183a/maven/releases>

mikejcusack 2021-03-04T20:49:10.104300Z

It should be. That's why the instructions are just to add the dep and repo

esp1 2021-03-04T20:49:22.104500Z

oh dang yes i do!

mikejcusack 2021-03-04T20:50:08.104700Z

That command doesn't work for me

esp1 2021-03-04T20:50:32.104900Z

that was it! i had an old datomic-cloud key in my ~/.m2/settings.xml - i removed it and now it works!

mikejcusack 2021-03-04T20:50:39.105100Z

There we go

esp1 2021-03-04T20:51:02.105300Z

thanks a ton @mike.j.cusack - i was going crazy πŸ˜…

πŸ‘ 1
mikejcusack 2021-03-04T20:51:08.105500Z

The one for dev-tools is still needed if you use it

πŸ‘ 1
2021-03-04T23:11:23.107500Z

I'm seeings this warning with exception when calling (d/shutdown true) at the end of a java process's life. It appears to be benign, but I'm curious if there's anything I can fix to prevent it:

2021-03-04T23:11:30.107600Z

2021-03-04T23:14:48.108100Z

We're on com.datomic/datomic-pro "0.9.6024" at the moment.

2021-03-04T23:47:03.108500Z

Oof -- pretty obvious. I needed to handle shutting down my clojure resources separately. So s/shutdown false no longer results in the warning.