-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Description
Description
H2 should never run on production!
Discussion
No response
Motivation
I met a very strange behavior while running keycloak image on GCP.
I was trying to connect KC to a managed postgres instance on google cloud SQL, which required setting the DB configurations using env variables.
The problem is, I missed setting KC_DB to postgres, this is not an issue by itself, as I expect KC to just fail at startup, instead, it just worked normally and used H2 to run !!!!
I believe this is really a confusing behavior, specially in a production environment where H2 should never run!
This can be disastrous if it happened undetected on production environment, because all the registered users will be wiped out when the instance is stopped.
This also costed me a lot of wasted time on debugging, and even was confusing when running a local dev environment on postgres, as I assumed KC was configured correctly while in fact it was running its own DB.
Details
Please stop H2 on production profile and it will be nice to show in the logs some info about the current DB to avoid such confusions.