hdimitrieski / e-shop

Sample Spring Cloud microservices e-shop.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

password authentication failed for user "keycloak"

akpatil opened this issue · comments

docker-authorization-service-1 | at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:646)
docker-authorization-service-1 | at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:180)
docker-authorization-service-1 | at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:235)
docker-authorization-service-1 | at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
docker-authorization-service-1 | at org.postgresql.jdbc.PgConnection.(PgConnection.java:223)
docker-authorization-service-1 | at org.postgresql.Driver.makeConnection(Driver.java:400)
docker-authorization-service-1 | at org.postgresql.Driver.connect(Driver.java:259)
docker-authorization-service-1 | at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677)
docker-authorization-service-1 | at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:228)
docker-authorization-service-1 | at org.postgresql.ds.common.BaseDataSource.getConnection(BaseDataSource.java:103)
docker-authorization-service-1 | at org.postgresql.xa.PGXADataSource.getXAConnection(PGXADataSource.java:49)
docker-authorization-service-1 | at org.postgresql.xa.PGXADataSource.getXAConnection(PGXADataSource.java:35)
docker-authorization-service-1 | at io.agroal.pool.ConnectionFactory.createConnection(ConnectionFactory.java:216)
docker-authorization-service-1 | at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:513)
docker-authorization-service-1 | at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:494)
docker-authorization-service-1 | at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
docker-authorization-service-1 | at io.agroal.pool.util.PriorityScheduledExecutor.beforeExecute(PriorityScheduledExecutor.java:75)
docker-authorization-service-1 | at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1126)
docker-authorization-service-1 | at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
docker-authorization-service-1 | at java.base/java.lang.Thread.run(Thread.java:829)
docker-authorization-service-1 |
docker-authorization-service-1 | 2022-11-08 10:20:14,441 WARN [org.infinispan.PERSISTENCE] (keycloak-cache-init) ISPN000554: jboss-marshalling is deprecated and planned for removal

docker-postgres-1 | 2022-11-08 11:20:14.649 CET [49] FATAL: password authentication failed for user "keycloak"
docker-postgres-1 | 2022-11-08 11:20:14.649 CET [49] DETAIL: Role "keycloak" does not exist.
docker-postgres-1 | Connection matched pg_hba.conf line 99: "host all all all md5"
docker-authorization-service-1 | 2022-11-08 10:20:14,650 WARN [io.agroal.pool] (agroal-11) Datasource '': FATAL: password authentication failed for user "keycloak"
docker-authorization-service-1 | 2022-11-08 10:20:14,665 WARN [org.infinispan.CONFIG] (keycloak-cache-init) ISPN000569: Unable to persist Infinispan internal caches as no global state enabled
docker-authorization-service-1 | 2022-11-08 10:20:14,703 INFO [org.infinispan.CONTAINER] (keycloak-cache-init) ISPN000556: Starting user marshaller 'org.infinispan.jboss.marshalling.core.JBossUserMarshaller'
docker-authorization-service-1 | 2022-11-08 10:20:14,981 INFO [org.infinispan.CONTAINER] (keycloak-cache-init) ISPN000128: Infinispan version: Infinispan 'Triskaidekaphobia' 13.0.9.Final
docker-authorization-service-1 | 2022-11-08 10:20:15,921 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Failed to start server in (development) mode
docker-authorization-service-1 | 2022-11-08 10:20:15,921 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Failed to obtain JDBC connection
docker-authorization-service-1 | 2022-11-08 10:20:15,922 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: FATAL: password authentication failed for user "keycloak"
docker-authorization-service-1 | 2022-11-08 10:20:15,923 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) For more details run the same command passing the '--verbose' option. Also you can use '--help' to see the details about the usage of the particular command.
docker-authorization-service-1 exited with code 1

Hi, Ive been trying to get the infrastructure components up using docker-compose up but im unable to do so. Is there anything i'm missing or you'd like me to look at to fix this?

Hi @akpatil, try running docker-compose up --build. Looks like the database is not initialized.

Dear @hdimitrieski,
The issue was with the line ending character added by Windows which Unix fails to interpret while running the scripts from postgres build.
I was able to fix it by modifying the Dockerfile inside the postgres folder.

**
FROM postgres:13.3

ENV TZ=Europe/Amsterdam

RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

COPY scripts/ /docker-entrypoint-initdb.d/

RUN sed -i -e "s/\r$//" /docker-entrypoint-initdb.d/*
**

Thanks for reporting this issue. I updated the .editorconfig, fixed the line ending.