datomic

Ask questions on the official Q&A site at https://ask.datomic.com!
zendevil 2021-03-15T05:41:09.311600Z

@lanejo01 after starting the proxy, it works and I get the following outputs:

(def client (starter/get-client))
#'user/client
(starter/ensure-sample-dataset)
:loaded
(def conn (starter/get-connection))
#'user/conn
@(def db (d/db conn))
{:t 16, :next-t 17, :db-name "datomic-docs-tutorial", :database-id "b04916cd-b8d8-4d84-b933-90ec6affc30a", :type :datomic.client/db}
(starter/get-schema db)
(#:db{:id 39, :ident :fressian/tag, :valueType :db.type/keyword, :cardinality :db.cardinality/one, :doc "Keyword-valued attribute of a value type that specifies the underlying fressian type used for serialization."} #:db{:id 73, :ident :inv/sku, :valueType :db.type/string, :cardinality :db.cardinality/one, :unique #:db{:id 38, :ident :db.unique/identity}} #:db{:id 74, :ident :inv/color, :valueType :db.type/keyword, :cardinality :db.cardinality/one} #:db{:id 75, :ident :inv/size, :valueType :db.type/keyword, :cardinality :db.cardinality/one} #:db{:id 76, :ident :inv/type, :valueType :db.type/keyword, :cardinality :db.cardinality/one} #:db{:id 77, :ident :order/items, :valueType :db.type/ref, :cardinality :db.cardinality/many, :isComponent true} #:db{:id 78, :ident :item/id, :valueType :db.type/ref, :cardinality :db.cardinality/one} #:db{:id 79, :ident :item/count, :valueType :db.type/long, :cardinality :db.cardinality/one} #:db{:id 80, :ident :inv/count, :valueType :db.type/long, :cardinality :db.cardinality/one})
(starter/get-items-by-type db :shirt '[:inv/sku :inv/color :inv/size])
[[#:inv{:sku "SKU-0", :color :red, :size :small}] [#:inv{:sku "SKU-4", :color :red, :size :medium}] [#:inv{:sku "SKU-8", :color :red, :size :large}] [#:inv{:sku "SKU-12", :color :red, :size :xlarge}] [#:inv{:sku "SKU-16", :color :green, :size :small}] [#:inv{:sku "SKU-20", :color :green, :size :medium}] [#:inv{:sku "SKU-24", :color :green, :size :large}] [#:inv{:sku "SKU-28", :color :green, :size :xlarge}] [#:inv{:sku "SKU-32", :color :blue, :size :small}] [#:inv{:sku "SKU-36", :color :blue, :size :medium}] [#:inv{:sku "SKU-40", :color :blue, :size :large}] [#:inv{:sku "SKU-44", :color :blue, :size :xlarge}] [#:inv{:sku "SKU-48", :color :yellow, :size :small}] [#:inv{:sku "SKU-52", :color :yellow, :size :medium}] [#:inv{:sku "SKU-56", :color :yellow, :size :large}] [#:inv{:sku "SKU-60", :color :yellow, :size :xlarge}]]
user=> 

zendevil 2021-03-15T06:39:03.311900Z

So it seems like the ion-starter works

zendevil 2021-03-15T06:39:33.312500Z

But in my project, when I run the repl, I get this error:

Execution error (ExceptionInfo) at datomic.client.api.async/ares (async.clj:58).
profile file cannot be null

jaret 2021-03-15T12:16:09.312600Z

@dgonsalves22 What video were you following? Just curious as we're always looking at creating updated similar resources.

jaret 2021-03-15T12:27:58.315500Z

@ps I believe that error indicates that you do not have AWS credentials. Your REPL also needs AWS credentials when launched. And in trying to follow along from your first post... I want to remind you that you will need to remove all the on-prem client usage and replace with cloud usage (i.e. update your deps and confirm all of your connections are using the datomic client Cloud config you used in the ion-starter project). Datomic on prem client will not work in cloud.

jaret 2021-03-15T12:29:48.316400Z

In your ~/.aws/credentials do you have a [default] profile or any profiles configured?

zendevil 2021-03-15T12:31:50.316900Z

@jaret yes I have two profiles. [default] and [humboi]. The credentials for both are exactly the same though

jaret 2021-03-15T12:41:17.317700Z

and you are ensuring that the profile is used when launching the repl or manually sourcing aws credentials before launching the repl?

zendevil 2021-03-15T12:42:44.318200Z

I don’t know how to make sure that that profile is used

jaret 2021-03-15T12:43:00.318900Z

How are you launching the REPL? CLJ tools?

zendevil 2021-03-15T12:43:16.319300Z

In ion-starter yes

zendevil 2021-03-15T12:43:23.319600Z

In my project using lien

jaret 2021-03-15T12:46:49.320600Z

Do you have AWS credentials in ~/.lein/profiles.clj? what version of lein are you using? Can you share your complete project.clj redacted of any sensitive information?

zendevil 2021-03-15T13:14:40.321300Z

@jaret here’s the project.clj:

(defproject humboiserver "0.1.0-SNAPSHOT"

  :description "FIXME: write description"
  :url "<http://example.com/FIXME>"

  :dependencies [[ch.qos.logback/logback-classic "1.2.3"]
                 [cheshire "5.10.0"]
                 [clojure.java-time "0.3.2"]
                 [com.google.guava/guava "27.0.1-jre"]
                 [com.novemberain/monger "3.1.0" :exclusions [com.google.guava/guava]]
                 [cprop "0.1.17"]
                 [expound "0.8.7"]
                 [funcool/struct "1.4.0"]
                 [luminus-aleph "0.1.6"]
                 [luminus-transit "0.1.2"]
                 [luminus/ring-ttl-session "0.3.3"]
                 [markdown-clj "1.10.5"]
                 [metosin/muuntaja "0.6.7"]
                 [metosin/reitit "0.5.10"]
                 [metosin/ring-http-response "0.9.1"]
                 [mount "0.1.16"]
                 [nrepl "0.8.3"]
                 [org.clojure/clojure "1.10.1"]
                 [org.clojure/tools.cli "1.0.194"]
                 [org.clojure/tools.logging "1.1.0"]
                 [org.webjars.npm/bulma "0.9.1"]
                 [org.webjars.npm/material-icons "0.3.1"]
                 [org.webjars/webjars-locator "0.40"]
                 [ring-webjars "0.2.0"]
                 [ring/ring-core "1.8.2"]
                 [ring/ring-defaults "0.3.2"]
                 [amazonica "0.3.153"]
                 [selmer "1.12.31"]
                 [com.datomic/client-cloud "0.8.105"]
                 ]

  :min-lein-version "2.0.0"
  
  :source-paths ["src/clj"]
  :test-paths ["test/clj"]
  :resource-paths ["resources"]
  :target-path "target/%s/"
  :main ^:skip-aot humboiserver.core

  :plugins [] 

  :profiles
  {:uberjar {:omit-source true
             :aot :all
             :uberjar-name "humboiserver.jar"
             :source-paths ["env/prod/clj" ]
             :resource-paths ["env/prod/resources"]}

   :dev           [:project/dev :profiles/dev]
   :test          [:project/dev :project/test :profiles/test]

   :project/dev  {:jvm-opts ["-Dconf=dev-config.edn" ]
                  :dependencies [[pjstadig/humane-test-output "0.10.0"]
                                 [prone "2020-01-17"]
                                 [ring/ring-devel "1.8.2"]
                                 [ring/ring-mock "0.4.0"]]
                  :plugins      [[com.jakemccrary/lein-test-refresh "0.24.1"]
                                 [jonase/eastwood "0.3.5"]] 
                  
                  :source-paths ["env/dev/clj" ]
                  :resource-paths ["env/dev/resources"]
                  :repl-options {:init-ns user
                                 :timeout 120000}
                  :injections [(require 'pjstadig.humane-test-output)
                               (pjstadig.humane-test-output/activate!)]}
   :project/test {:jvm-opts ["-Dconf=test-config.edn" ]
                  :resource-paths ["env/test/resources"] }
   :profiles/dev {}
   :profiles/test {}})

zendevil 2021-03-15T13:14:47.321500Z

I don’t use .lein/profiles

jaret 2021-03-15T13:19:12.322Z

and are you just running lein repl or are you passing a particular alias here ^?

zendevil 2021-03-15T13:48:01.322300Z

@jaret I’m using cider-jack-in

zendevil 2021-03-15T13:48:10.322600Z

I don’t know what an alias is in this context

zendevil 2021-03-15T15:24:12.323400Z

@jaret is there a way to pass in the credentials from the project.clj?

FlavaDave 2021-03-15T16:34:26.324700Z

@jaret https://www.youtube.com/watch?v=ao7xEwCjrWQ&amp;t=2026s I gravitated towards this because some of his other videos were very helpful for me. I should have been paying more attention to how old it was though. lol

simongray 2021-03-15T17:12:02.325Z

I think alias is the deps.edn term. Think they're called profiles in leiningen.

zendevil 2021-03-15T17:29:15.325800Z

or alternatively, is there a way to put the credentials directly in the code rather than depending on ~/.aws?