Unfortunately, our release bot is currently on strike for datahike. Thanks to @uppfinnarjonas a new release of datahike is out which doubles the query performance on the benchmark suite of the Swedish government. Thanks to @timok’s work we also get native builds on github now. The dthk binary and babashka pod are already available for Linux amd64 and aarch64, but the Mac OS build still fails at a unit test.
That is an impressive performance improvement, looking forward to testing this release soon.
Heroku occasionally rotates database and provides new credentials. When trying to deploy with the new credentials, datahike is throwing the config-does-not-match-stored-db error.
I don't believe I specified :scope in my app in the older deployments but specifying it now (with the new db credentials) doesn't seem to help or override the error.
I can't even connect to the current deployment db to make a copy of it, because datahike will throw config-does-not-match-stored-db.
Somewhat at a loss. I don't want to destroy anything without making a copy but I can't access the db!
Which datahike version are you using?
I relaxed the config check in a recent version, but I might have to expand that.
How are the credentials passed? I assume as part of the store config.
just updated to most recent. Still failed
Same error
Ok
Yes, in the store config
Like so:
(def cfg
{:store {:backend :jdbc
:dbtype "postgresql"
:host ""
:port 5432
:user ""
:password ""
:dbname "dc6bbrav2u4lve"
:scope "already-set-this-huh"}})Is the dbname changing for you?
The store identity for JDBC should not depend on the password.
This is how the store is identified https://github.com/replikativ/datahike-jdbc/blob/main/src/datahike_jdbc/core.clj#L21
I assume that table stays the same, then the culprit should be dbname here.
@alekcz360 has worked with JDBC a lot, but I think not with Heroku yet.
We can relax that further, the config check is there to not accidentally corrupt a database.
By using the wrong configuration.
@feedmyinbox02_clojuri in the error it tells you what has changed. Is the dbname the culprit?
dbname does change, actually
Let me check the error report
:diff
({:store
{:dbname "dc6bbrav2u4lve",
:password "",
:user "u10ue9c465kc7o",
:host "c4[...]."}}
{:store
{:dbname "d3ldb5vhikjho2",
:password "",
:user "jhhyishypdwycq",
:host "ec2[...]."}}
{:keep-history? true,
:search-cache-size 10000,
:index :datahike.index/persistent-set,
:store {:port 5432, :dbtype "postgresql", :backend :jdbc}, :store-cache-size 1000, :attribute-refs? false, :crypto-hash? false, :schema-flexibility :write, :branch :db}) Ok, this is a bit odd, but I guess it is what it is.
Probably the best way to deal with oddities like this is to allow deactivation of the config check altogether at your own risk.
How would I do that?
That is a boolean I can set somewhere in the store?
I need to add an option for that.
I think I would probably add a field to the config itself to avoid dynamic bindings.
We'd have to update the datahike with a property like allow-unsafe-configor something along those lines
Alternatively it could be an environment variable, but then it is global.
Is there anything I can do at the moment less nuclear than reconstituting the entire production db?
... oh wait, I can't do a migration or copy. I don't know how to get a new conn. This is blocking me from making a new conn even
Wait, this is bad. How can I make a copy of the production db using Datahike tools if this error is blocking?
@whilo you want to work on a new cut? or should I pick it up? I can do it this evening?
@feedmyinbox02_clojuri try this PR https://github.com/replikativ/datahike/pull/693
Lmk whether it works. You need to set :allow-unsafe-config true in the configuration.
I might have to add stuff the config specification, I have not checked this fix yet.
Ok, trying now. Thank you
Hi whilo, it didn't seem to work. I am DM'ing you direct copy-paste of error
The PR (#693) provided by whio worked! 😊 Thank you
You are welcome! Lmk if there is anything else causing you issues.
This release contains a simple fix to deactivate our conservative configuration checks when connecting, as some people stumbled over those.
Thanks to @feedmyinbox02_clojuri for reporting this problem on Heroku.
Thanks to the team for being excellent, speedy and responsive! (Just like Datahike! ;-)