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.)
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.
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.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
})I am re-visiting this thread: https://github.com/replikativ/datahike/issues/654
which version of datahike is this?
0.6.1553
I swapped for the latest 0.7.1642 and error persisted.
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.)
Can you confirm that 0.7.1642 is actually used by checking your deps tree for the project?
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.
Thanks whilo, I will check that now
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"] ; ...with the new datahike version you only need to require konserve-jdbc; datahike-jdbc is deprecated
Thank you
makes things much simpler
Is there a simple way to have alerted myself of this before swapping out? I suppose "reading the docs" always helps :))))
I'm just wondering if there is a tool or programmatic method to try before swapping to avoid these snags.
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
You're doing a great job.
Thanks whilo
Thanks for chiming in today
no worries; lmk whether it works
Hmm, attempting to conn ; Unsupported store backend: :jdbc
you need to require konserve-jdbc.core