datahike

silian 2026-02-08T23:34:00.052109Z

Continued problems with Heroku db rotation and Configuration does not match stored configuration ... Heroku rotates db credentials. When this happens the Datahike instance retains the old db store; when my app tries to connect to an updated cfg I am receiving Configuration does not match stored configuration despite setting :allow-unsafe-config true (The old cfg did not have this flag.)

silian 2026-02-08T23:36:33.504049Z

I cannot perform export of old db because any attempt to connect is an attempt to connect to the Datahike instance, which returns the Configuration does not match error.

silian 2026-02-08T23:38:31.914249Z

Here is the error thrown:

clj꞉clojure-getting-started.configgy꞉> 
; 2026-02-08T23:37:15.757Z rmg-viralnet.lan DEBUG [datahike.connector:144] - Using config  {:keep-history? true, :search-cache-size 10000, :index :datahike.index/persistent-set, :store {:backend :jdbc, :scope "whatever3", :dbtype "postgresql", :host "....us-east-1.rds.amazonaws.com", :port 5432, :user "", :dbname ""}, :store-cache-size 1000, :attribute-refs? false, :writer {:backend :self}, :crypto-hash? false, :schema-flexibility :write, :allow-unsafe-config true, :branch :db}
; 2026-02-08T23:37:15.842Z rmg-viralnet.lan DEBUG [com.mchange.v2.c3p0.impl.NewProxyPreparedStatement:204] - com.mchange.v2.c3p0.impl.NewProxyPreparedStatement@53699cf4 [wrapping: select 1 from konserve limit 1] closed orphaned ResultSet: com.mchange.v2.c3p0.impl.NewProxyResultSet@d366564 [wrapping: null]
; 2026-02-08T23:37:15.919Z rmg-viralnet.lan DEBUG [com.mchange.v2.c3p0.impl.NewProxyPreparedStatement:204] - com.mchange.v2.c3p0.impl.NewProxyPreparedStatement@4cc8f722 [wrapping: SELECT 1 FROM konserve WHERE id = '0594e3b6-9635-5c99-8142-412accf3023b.ksv'] closed orphaned ResultSet: com.mchange.v2.c3p0.impl.NewProxyResultSet@3e43ca49 [wrapping: null]
; 2026-02-08T23:37:16.001Z rmg-viralnet.lan DEBUG [com.mchange.v2.c3p0.impl.NewProxyPreparedStatement:204] - com.mchange.v2.c3p0.impl.NewProxyPreparedStatement@3245af21 [wrapping: SELECT 1 FROM konserve WHERE id = '0594e3b6-9635-5c99-8142-412accf3023b.ksv'] closed orphaned ResultSet: com.mchange.v2.c3p0.impl.NewProxyResultSet@524d0225 [wrapping: null]
; 2026-02-08T23:37:16.077Z rmg-viralnet.lan DEBUG [com.mchange.v2.c3p0.impl.NewProxyPreparedStatement:204] - com.mchange.v2.c3p0.impl.NewProxyPreparedStatement@701b3c01 [wrapping: SELECT id, header, meta, val FROM konserve WHERE id = '0594e3b6-9635-5c99-8142-412accf3023b.ksv'] closed orphaned ResultSet: com.mchange.v2.c3p0.impl.NewProxyResultSet@5f1fa155 [wrapping: null]
; 2026-02-08T23:37:16.077Z rmg-viralnet.lan ERROR [datahike.connector:130] - Configuration does not match stored configuration. {:type :config-does-not-match-stored-db, :config {:keep-history? true, :search-cache-size 10000, :index :datahike.index/persistent-set, :store [:jdbc "postgresql" "d6uh4rmk9ll5eb" nil], :store-cache-size 1000, :attribute-refs? false, :crypto-hash? false, :schema-flexibility :write, :allow-unsafe-config true, :branch :db}, :stored-config {:keep-history? true, :search-cache-size 10000, :index :datahike.index/persistent-set, :store [:jdbc "postgresql" "dc6bbrav2u4lve" nil], :store-cache-size 1000, :attribute-refs? false, :crypto-hash? false, :schema-flexibility :write, :allow-unsafe-config true, :branch :db}, :diff ({:store [nil nil "d6uh4rmk9ll5eb"]} {:store [nil nil "dc6bbrav2u4lve"]} {:keep-history? true, :search-cache-size 10000, :index :datahike.index/persistent-set, :store [:jdbc "postgresql" nil nil], :store-cache-size 1000, :attribute-refs? false, :crypto-hash? false, :schema-flex
; ibility :write, :allow-unsafe-config true, :branch :db})}
; 
; Execution error (ExceptionInfo) at datahike.connector/ensure-stored-config-consistency (connector.cljc:130).
; Configuration does not match stored configuration.

silian 2026-02-08T23:58:29.073939Z

Here is the cfg I am trying to use:

(def cfg2
  {:store {:backend :jdbc 
           :dbtype "postgresql"
           :host "...us-east-1.rds.amazonaws.com"
           :port 5432
           :user ""
           :password ""
           :dbname ""}
   :allow-unsafe-config true
   })

silian 2026-02-09T01:52:42.003969Z

I am re-visiting this thread: https://github.com/replikativ/datahike/issues/654

whilo 2026-02-09T04:33:03.654549Z

which version of datahike is this?

silian 2026-02-09T04:35:02.192979Z

0.6.1553

silian 2026-02-09T04:36:20.744459Z

I swapped for the latest 0.7.1642 and error persisted.

silian 2026-02-09T04:38:58.412899Z

I probably transacted last with 0.6.1553; then Heroku required update to their latest "stack", which requires update to postgres 17 (I believe) and forced a db and db cred rotation from their end. (Everything was working fine before they forced the postgres upgrade.)

whilo 2026-02-09T04:40:30.099919Z

Can you confirm that 0.7.1642 is actually used by checking your deps tree for the project?

whilo 2026-02-09T04:41:16.913869Z

With the latest version it shoudl complain that you need to set a UUID :id in the store config, which fixes the whole consistency check problem.

silian 2026-02-09T04:41:56.582329Z

Thanks whilo, I will check that now

silian 2026-02-09T04:48:17.705069Z

It looks like datahike-jdbc "0.3.47" is relying on 1554 even though I am requiring 0.7.1642 in the project ..

[io.replikativ/datahike-jdbc "0.3.47"]
   [io.replikativ/datahike "0.6.1554"]
     [io.replikativ/hasch "0.3.94" :exclusions [[org.clojure/clojurescript]]]
     [io.replikativ/hitchhiker-tree "0.2.222" :exclusions [[org.clojure/clojurescript]]]
       [com.taoensso/carmine "3.1.0"]
         [com.taoensso/nippy "3.1.1"] ; ...
while later:
[org.replikativ/datahike "0.7.1642"]
   [com.github.pkpkpk/cljs-cache "1.0.21"]
     [tailrecursion/cljs-priority-map "1.2.1"]
   [com.taoensso/timbre "6.8.0"]  ; ...

whilo 2026-02-09T04:48:44.808519Z

with the new datahike version you only need to require konserve-jdbc; datahike-jdbc is deprecated

silian 2026-02-09T04:48:56.051319Z

Thank you

whilo 2026-02-09T04:49:04.438029Z

makes things much simpler

silian 2026-02-09T04:50:58.776119Z

Is there a simple way to have alerted myself of this before swapping out? I suppose "reading the docs" always helps :))))

silian 2026-02-09T04:51:37.902669Z

I'm just wondering if there is a tool or programmatic method to try before swapping to avoid these snags.

whilo 2026-02-09T04:51:52.448659Z

for now just ask; i have tried to streamline things as much as possible; there are still a few things that can be improved, most importantly the full distributed programming model i am working on right now; but for you this is probably not critical right now

silian 2026-02-09T04:52:12.431989Z

You're doing a great job.

silian 2026-02-09T04:53:22.084569Z

Thanks whilo

silian 2026-02-09T04:53:38.086969Z

Thanks for chiming in today

whilo 2026-02-09T04:54:16.288309Z

no worries; lmk whether it works

silian 2026-02-09T05:06:51.192619Z

Hmm, attempting to conn ; Unsupported store backend: :jdbc

whilo 2026-02-09T05:07:09.684829Z

you need to require konserve-jdbc.core