Fork me on GitHub

hi - we're trying to restore a backup of our datomic database (it's a tiny 9mb db, as a test), and it just seems to be hanging forever.. how do we go about figuring out what we're doing wrong? We've set the log level in the logback.xml for datomic to TRACE - and theres a tiny bit of logging (I'll attach that in thread), but nothing else


@U050CLJ53 Can you share what command you're using to run backup/restore?


If you'd like feel free to log a case to me by e-mailing <mailto:[email protected]|[email protected]> and we can dive further.


@U1QJACBUM we're doing this:

/storage/datomic/current/bin/datomic -Xmx1g -Xms1g restore-db "file:/storage/datomic/archive/restore/" "datomic:sql://...?jdbc:..."
if there's nothing we can really self diagnose at a high level, then sure, I'll send a mail on monday πŸ™‚


Try restoring locally using :dev protocol, just to see if it's underlying storage related. But if it couldn't write to storage due to perms I would expect an error not a hang.


I am trying to get started with datomic in a dev-local setup. Any idea why my dev-local db is not found? I can see can see db.log and log.idx files were created.

(ns flow.db
  (:require [datomic.client.api :as d]))

(let [dir     (str (System/getProperty "user.dir") "/var/datomic")
      db-name "flow"
      client  (d/client {:server-type :dev-local
                         :storage-dir dir
                         :system      "dev"})
      _       (d/create-database client db-name)
      conn    (d/connect client {:db-name db-name})]

;; Unhandled clojure.lang.ExceptionInfo
;; Db not found: flow
;; #:cognitect.anomalies{:category :cognitect.anomalies/not-found,
;;                       :message "Db not found: flow"}


Can you try testing with the absolute path of dir and just execute d/client without the let? Also does the absolute path already have a "dev" system folder?


then list-dbs on the client


(d/list-databases client {})



(def client (d/client {:server-type :dev-local
                       :storage-dir "/home/jam/src/flow/var/datomic"
                       :system      "dev"}))
(d/create-database client "flow")  ; => true
(d/list-databases client {})   ; => []


file system looks like this:

$ tree /home/jam/src/flow
β”œβ”€β”€ deps.edn
β”œβ”€β”€ src
β”‚Β Β  └── flow
β”‚Β Β      └── db.clj
└── var
    └── datomic
        └── dev
            β”œβ”€β”€ db.log
            └── log.idx


I created var/datomic. dev/ gets created by create-database fn


I tried setting :storage-dir in ~/.datomic/dev-local.edn and it has the same problem. Creates some files but no db found.


What version of Dev-local are you using?


Can you share the .datomic/dev-local.edn file in your home directory?


Might be best to just share your deps.edn and I will try to re-create. So I can see version of client and dev-local.


[email protected]:~/.datomic$ cat dev-local.edn 
{:storage-dir "/home/jam/var/datomic"}


[email protected]:~/opt$ java -version
openjdk version "11.0.8" 2020-07-14


@U071T1PT6 I don't see a version of client in your deps? Do you have datomic client in your .clojure/deps.edn? Could you include com.datomic/client-cloud "0.8.102"


Also worth testing with the latest dev-local and use 0.9.225


Ok. I was following instructions here: and didn't know about that additional dep. Unfortunately, adding it didn't make any difference. I will try updating to 0.9.225.


@U071T1PT6 I can't reproduce is there anything else I could be missing? Are you starting a new repl to do this? Can you try making a new system name to confirm you are local when a new dir is made? What OS are you using on your system?


look at the args for create-database


needs to be {:db-name "flow"} not "flow"

πŸ‘ 3

!!! Ghadi, great catch!


That's it


calling it with a raw string probably shouldn't return true


No it should not!


this bit me a few times initially. it would be very helpful to provide better error message for this situation.

πŸ‘ 3

Totally agree this seems to be a bug in using dev-local client and create DB. It should throw an error like in cloud for expected map. I've logged a bug and we'll look at fixing!


;Cloud client
(d/create-database client "testing")
Execution error (ExceptionInfo) at datomic.client.impl.shared/api->client-req (shared.clj:258).
Expected a map

;Dev local client
(d/create-database client "testing")
=> true


in either case no DB is created, but we should throw an error in both cases!


Thanks for all the help. Working as expected now.πŸ˜€

Drew Verlee17:10:58

What's the best way to report/ask about questions on the official datomic docs? e.g The docs for import-cloud on the docs: Don't match the docstring. I assume the docstring is correct as the documentation page lists the same value for source and dest.


I'll fix that!


Thanks for catching it.

Drew Verlee18:10:31

@U1QJACBUM thanks for fixing it. Do you know if there is a light weight way to get datomic cloud consulting? I run into little blockers here and there and I would rather shell some money then get stuck for a day off someone can easily help me trouble shoot things.


@U0DJ4T5U1 I am going to tag @U05120CBV on this. You can also e-mail him directly at <mailto:[email protected]|[email protected]>. He is running point on our Datomic consulting services along with a few other folks at Cognitect. I'll bring this up with him on Monday if you two don't connect here.


There’s a new ask.datomic site that probably fits the bill

πŸ‘ 9

should one be alarmed when periodically seeing an Unable to load index root ref <uuid> exception appear in Datomic Cloud logs? (from )


Do you often delete DBs? In general, you can see this error if a client or node is asking for a deleted db. The error would also correlate to an outage but these calls are retried so if you don't see this error often or repeatedly it's probably not a major issue.


As always, it is my support-person duty to recommend upgrading to the latest Cloud release CFT and if you'd like me to look more closely at your system logs I'd be happy to poke around with a Read-Only CloudWatch account. If you want to go down that path, log me a case at <mailto:[email protected]|[email protected]> and I can take a look.


thanks, Jaret. we haven't noticed any performance issues related to the exception, so i was mostly just curious. but since you mentioned that it could be related to often deleting DBs, which we very rarely do, then i'll just mention it in some future support ticket. it's a low priority for us. πŸ™‚

Drew Verlee22:10:58

When i try to use dev-tools to import a cloud locally it complains that it can't use the endpoint to connect/"name or service is not known". I'm connected and can query the databases though so i'm not sure what the issue is.