This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-16
Channels
- # aleph (1)
- # aws (1)
- # beginners (23)
- # boot (33)
- # cider (15)
- # cljs-dev (4)
- # clojure (73)
- # clojure-dev (18)
- # clojure-italy (8)
- # clojure-russia (7)
- # clojure-serbia (1)
- # clojure-spec (8)
- # clojure-uk (118)
- # clojure-ukraine (3)
- # clojurescript (34)
- # code-art (1)
- # community-development (24)
- # cursive (21)
- # data-science (3)
- # datomic (72)
- # defnpodcast (1)
- # fulcro (77)
- # graphql (4)
- # hoplon (8)
- # jobs (3)
- # luminus (3)
- # lumo (7)
- # off-topic (3)
- # onyx (17)
- # other-languages (7)
- # pedestal (1)
- # perun (1)
- # protorepl (21)
- # re-frame (91)
- # ring (4)
- # ring-swagger (18)
- # shadow-cljs (22)
- # spacemacs (37)
- # specter (1)
- # sql (23)
- # test-check (4)
- # unrepl (29)
- # utah-clojurians (3)
- # vim (36)
- # yada (10)
Hi, I am getting a :db.error/not-an-entity Unable to resolve entity:
error and I have no idea how to debug this 😇, where should I start looking?
@thomas that usually means you're trying to resolve something that doesn't exist. e.g. a typo'd entity name in [:some-id "Fobar"]
You might have that in the wrong place I suppose? Does your code look like:
[:db/add ?e :some/param {order-no …}]
this is the full error as I get it: :message :db.error/not-an-entity Unable to resolve entity: {:order-no 1, :text "XS"} in datom [17592186047266 :choice/options {:order-no 1, :text "XS"}]
I am transacting a massive map of things I think (I didn't write the code nor do I really understand it either, sorry)
this is handy
(defn print-db-schema
"Prints all the attributes from :db.install/attribute"
[db]
(clojure.pprint/pprint
(map #(->> % first (d/entity db) d/touch)
(d/q '[:find ?v
:where [_ :db.install/attribute ?v]]
db))))
You can't add new data in the value position of a [:db/add ...]
. You must look it up with a lookup ref. Like so: [:db/add e a [:order-no 1]]
If you also want to transact new data then you can either use a tempid or a backwards ref
the problem is not perse in the DB... in this App we read in a Excel spreadsheet and use the data in that as well.. and the Excel spreadsheet is the only thing that has changed... and that has resulted in this error... I am looking at the excel at the moment for the text XS and see of that has changed.
Option instead of:
- [17592186047266 :choice/options {:order-no 1, :text "XS"}]
use:
- {:order-no 1, :text "XS", :choice/_options 17592186047266}
ok I am pretty sure I have found the cause of this problem. nothing datomic related...
and thank you for all your help. It certainly helped me point in the right direction and told me what I had to look for in the Excel spreadsheets!!!
What's the value of using Datomic's :db.type/uri
instead of putting a string in there? The only thing I'll ever do when pulling the data out again is to put it into cemerick/url
which is happy with strings
I have the same approach to UUIDs, seems wildly more convenient to just use a string since most of the time the UUID comes from a URL and is a string anyway. And then I don't have to convert it to an UUID, return 404 instead of 500 in my web API if it's an invalid UUID, etc
yep, that was my thinking. like how i used to put longs in SQL dbs to represent timestamps (as ms since the epoch) instead of using built-in timestamp types
UUIDs do have a more compact representation in datomic (really fressian) than strings. But for URIs there is really no difference except type.
I have a (still unrealized) plan to encode all the xsd date and time types into a long with canonical sorting
e.g. LocalDate LocalTime LocalDateTime, etc. where there is no time zone and it's not timestamp-resolution
we encoded dates (i.e. Y-M-D values) into a java util date, and that was a huge mistake. we should have just used strings
we were promised custom datatypes in datomic eventually. does anyone know how that is progressing?
Anyone know if this is expected behavior?
(d/q '[:find [(pull ?e [:some/attr]) ?e] :where [?e :some/attr]] db)
ArrayIndexOutOfBoundsException [trace missing]
whereas.. something like this works fine:
(d/q '[:find [(pull ?e [:some/attr]) ?tx] :where [?e :some/attr _ ?tx]] db)
@matthavener Yes, that is a known behavior; you can’t get both e and a pull on e in the same find spec
interesting! Thank you
right
I'm having troubles connecting console to my local datomic-pro running with a mysql storage. I'm using the following command from the datomic directory:
bin/console -p 8888 dev datomic:sql://\?jdbc:
I can use this same URI (with the addition of the DB name) to connect from a peer and query data. If I put the URI in quotes and remove the escapes it still doesn't work. Here's the error message: https://imgur.com/a/kf3i0
Any ideas?console live datomic:sql://\?jdbc:postgresql://${docker_postgres_datomic_host}:${docker_postgres_datomic_port}/${docker_postgres_datomic_db}\?user=${docker_postgres_datomic_user}\&password=${docker_postgres_datomic_pass}
@favila the mysql lib is in the lib folder and the transactor connects successfully? does it need to be somewhere else?
trying to setup health checking datomic using ping-host/ping-port configuration, but getting following stacktrace error: bin/transactor ~/projects/abraxas/transactor/config/dev-transactor.properties Launching with Java options -server -Xms1g -Xmx1g -XX:+UseG1GC -XX:MaxGCPauseMillis=50 Critical failure, cannot continue: Error starting transactor java.lang.RuntimeException: Unable to start ping endpoint localhost:9999 at datomic.transactor_ext$start_ping_endpoint.invokeStatic(transactor_ext.clj:42) at datomic.transactor_ext$start_ping_endpoint.invoke(transactor_ext.clj:25) at datomic.transactor_ext$start_pro.invokeStatic(transactor_ext.clj:63) at datomic.transactor_ext$start_pro.invoke(transactor_ext.clj:59) at clojure.lang.Var.invoke(Var.java:379) at datomic.transactor$run_STAR_.invokeStatic(transactor.clj:294) at datomic.transactor$run_STAR_.invoke(transactor.clj:220) at datomic.transactor$run$fn__23373.invoke(transactor.clj:347) at clojure.core$binding_conveyor_fn$fn__6757.invoke(core.clj:2020) at clojure.lang.AFn.call(AFn.java:18) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.IllegalStateException: Insufficient threads: max=3 < needed(acceptors=1 + selectors=2 + request=1) at org.eclipse.jetty.server.Server.doStart(Server.java:368) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at cognitect.http_endpoint.jetty$start.invokeStatic(jetty.clj:123) at cognitect.http_endpoint.jetty$start.invoke(jetty.clj:120) at cognitect.http_endpoint.jetty$server$fn__21184.invoke(jetty.clj:136) at cognitect.http_endpoint$create_endpoint.invokeStatic(http_endpoint.clj:292) at cognitect.http_endpoint$create_endpoint.invoke(http_endpoint.clj:217) at cognitect.nano_impl.server$create.invokeStatic(server.clj:172) at cognitect.nano_impl.server$create.invoke(server.clj:141) at cognitect.nano_impl$create.invokeStatic(nano_impl.clj:166) at cognitect.nano_impl$create.invoke(nano_impl.clj:96) at datomic.transactor_ext$start_ping_endpoint.invokeStatic(transactor_ext.clj:33) ... 13 more
that insufficient thread bug should have been fixed in http://docs.datomic.com/changes.html#0.9.5561.59
@fenton can you email <mailto:[email protected]|[email protected]> with your issue and your config files (redacted of any sensitive info) as well as the number of cores on your system (real & virtual)