v26.2.13
v26.2.13
Detect mismatched database dialect at startup
Kratos, Hydra, Keto, and backoffice now verify at startup that the configured database dialect matches the actual database server.
The migrate sql and serve commands run a single SELECT version() query and refuse to start if the DSN scheme does not match
the server.
Previously, pointing a service at a CockroachDB cluster with a postgres:// DSN (or the reverse) silently applied the wrong
migrations and produced broken schemas. This is easy to do because CockroachDB speaks the PostgreSQL wire protocol and advertises
a postgres:// DSN itself.
If your DSN scheme is wrong, you will now see a clear error such as:
DSN scheme postgres:// declares a PostgreSQL database but the server is
CockroachDB. Replace the scheme with cockroach:// so that the service
picks the correct migrations and SQL dialect.
To fix it, change the DSN scheme from postgres:// to cockroach:// (or the reverse) and restart. MySQL and SQLite are
unaffected.
