This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-02
Channels
- # announcements (9)
- # asami (5)
- # babashka (16)
- # beginners (134)
- # chlorine-clover (3)
- # cider (15)
- # clojure (75)
- # clojure-australia (3)
- # clojure-europe (29)
- # clojure-nl (2)
- # clojure-uk (15)
- # clojured (4)
- # clojurescript (34)
- # cursive (9)
- # datomic (16)
- # duct (7)
- # events (4)
- # fulcro (2)
- # helix (5)
- # honeysql (4)
- # jobs (9)
- # lsp (55)
- # malli (31)
- # music (3)
- # re-frame (3)
- # reitit (1)
- # remote-jobs (1)
- # ring (3)
- # sci (5)
- # shadow-cljs (46)
- # specter (3)
- # tools-deps (60)
- # vim (5)
- # xtdb (15)
I’m sure I’m missing something, but does anyone know what might be causing this? (It’s fine locally, but it fails on a EC2 instance)
Someone already asked this, so sharing it here since it might be helpful to others: https://ask.datomic.com/index.php/546/could-not-find-artifact-com-datomic-ion-jar-0-9-48-in-central
I added this EC2 to the same VPC as Datomic Cloud - I’m not sure this is the way to go, I’m trying to figure things out.
I added an SSH inbound rule, but that’s it, I didn’t mess with any other configuration.
(Clojure CLI version 1.10.3.855)
I create entities like so and put some values in those entities. So far there are no errors:
(d/transact conn [{:db/ident :carecoach/name
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one
:db/unique :db.unique/identity
:db/doc "name"}
{:db/ident :carecoach/number
:db/valueType :db.type/long
:db/cardinality :db.cardinality/many
:db/unique :db.unique/identity
:db/doc "number"}
])
(d/transact conn [{:carecoach/name "Prikshet" :carecoach/number 20}])
(d/transact conn [{:carecoach/name "Deepak" :carecoach/number 10}])
(d/transact conn [{:carecoach/name "Prikshet" :carecoach/number 30}])
(d/transact conn [{:carecoach/name "Deepak" :carecoach/number 20}])
(d/transact conn [{:carecoach/name "Prikshet" :carecoach/number 40}])
(d/transact conn [{:carecoach/name "Deepak" :carecoach/number 50}])
But when I try to do a pull, I get the following error:
(defn get-sum [name-string]
(d/pull db '[*] [:carecoach/name name-string])
#_(d/q '[:find ?number
:in $ ?name-string
:where
[?e :carecoach/name ?name-string]
[?e :carecoach/number ?number]
]
db name-string)
)
(get-sum "Deepak")
:db.error/not-an-entity Unable to resolve entity: :carecoach/name
{:entity :carecoach/name, :db/error :db.error/not-an-entity}
error.clj: 57 datomic.error/arg
error.clj: 52 datomic.error/arg
db.clj: 589 datomic.db/require-id
db.clj: -1 datomic.db/require-id
db.clj: 689 datomic.db/require-attrid
db.clj: 686 datomic.db/require-attrid
db.clj: 534 datomic.db/resolve-lookup-ref
db.clj: 526 datomic.db/resolve-lookup-ref
db.clj: 568 datomic.db/extended-resolve-id
db.clj: 564 datomic.db/extended-resolve-id
db.clj: 579 datomic.db/resolve-id
db.clj: 572 datomic.db/resolve-id
How to fix this?again: you should use the return value of transact
, and you should pass db
in to querying functions as an argument
db
is not a “database handle” like in a normal relational db. You can’t def it once. It’s an immutable value.
https://docs.datomic.com/on-prem/best-practices.html#consistent-db-value-for-unit-of-work
what’s the fastest way to fix this? I’m in a hurry