I am installing keycloak through a third party open source application called camunda. The installation is done through helm on k8s. Internally camunda uses bitnami keycloak helm chart for installation
With the below helm values file configuration (local) I am enabling keycloak, configuring an external postgres server and setting the admin user/password to admin/admin.
When we navigate to the keycloak page (http://localhost:18080) we see the keycloak welcome page. Accessing the “Administration Console” page navigates to the login screen. Logging in with admin/admin fails though with “Invalid username or password” error (screenshot attached).
The keycloak k8s pod does print the below logs indicating the login error.
Any inputs on what could be going wrong would be helpful? Thanks
We observed that this issue appears only if we configure an externalDatabase to keycloak. We could login with admin/admin if the database is internally created by keycloak helm installation.
Also without the externalDatabase configuration we observed that the keycloak instance does not restart if the helm chart is uninstalled and installed again. It fails to connect with the database container. The error logged is shared below
Any idea what could be reason and how could we configure admin user when we have an external postgres database for keycloak?
Why does the keycloak instance fail to connect to postgres on restart? What configuration is missing?
Thanks. Keycloak restart failure log
Caused by: org.postgresql.util.PSQLException: FATAL: password authentication failed for user "bn_keycloak"
at org.postgresql.jdbc@42.2.14//org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:525)
at org.postgresql.jdbc@42.2.14//org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:146)
at org.postgresql.jdbc@42.2.14//org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:197)
at org.postgresql.jdbc@42.2.14//org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
at org.postgresql.jdbc@42.2.14//org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:217)
at org.postgresql.jdbc@42.2.14//org.postgresql.Driver.makeConnection(Driver.java:458)
at org.postgresql.jdbc@42.2.14//org.postgresql.Driver.connect(Driver.java:260)
I was facing similar issue while install bitnami/keycloak helm chart. I first installed the chart using the default values which created the username: user and password:<random_value>. Then I had to remove all the tables from the postgres and then do the helm chart install with modified auth adminUser and adminPassword values.
I see your yaml the externalDatabase is inside keycloak.