Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop using H2 DB in prod environment #14811

Open
deathwaiting opened this issue Oct 9, 2022 · 0 comments
Open

Stop using H2 DB in prod environment #14811

deathwaiting opened this issue Oct 9, 2022 · 0 comments
Labels
kind/enhancement Categorizes a PR related to an enhancement status/triage

Comments

@deathwaiting
Copy link

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.

@deathwaiting deathwaiting added kind/enhancement Categorizes a PR related to an enhancement status/triage labels Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Categorizes a PR related to an enhancement status/triage
Projects
None yet
Development

No branches or pull requests

1 participant