# Keycloak server not able to start with the postgres DB server

**URL:** <https://forum.keycloak.org/t/keycloak-server-not-able-to-start-with-the-postgres-db-server/13519>\
**Category:** Configuring the server\
**Created:** [February 9, 2022, 12:00pm UTC](https://forum.keycloak.org/t/keycloak-server-not-able-to-start-with-the-postgres-db-server/13519 "2022-02-09T12:00:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jb22](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@jb22](https://forum.keycloak.org/u/jb22)\
**Post date:** [February 9, 2022, 12:00pm UTC](https://forum.keycloak.org/t/keycloak-server-not-able-to-start-with-the-postgres-db-server/13519/1 "2022-02-09T12:00:06Z")

</div>

Hello,  
i’m not able to start the keycloak with the postgres server using docker image.  
when i tried it with local postgres database it seems to work fine  
but when i tried with different postgres database it gives error and didn’t start the keycloak server

Some of the error logs i found were

```auto

12:07:19,017 ERROR [org.jboss.as.controller.client] (Controller Boot Thread) WFLYCTL0190: Step handler org.jboss.as.controller.AbstractControllerService$ModelControllerServiceInitializationBootStepHandler$1@8bee669 for operation boottime-controller-initializer-step at address [] failed -- java.util.concurrent.TimeoutException

12:07:19,238 ERROR [org.keycloak.connections.jpa.updater.liquibase.LiquibaseJpaUpdaterProvider] (ServerService Thread Pool -- 65) Error has occurred while updating the database: liquibase.exception.MigrationFailedException: Migration failed for change set META-INF/jpa-changelog-3.4.0.xml::3.4.0::keycloak:

12:07:19,242 ERROR [org.keycloak.connections.jpa.updater.liquibase.lock.CustomLockService] (ServerService Thread Pool -- 65) Database error during release lock: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: java.sql.SQLException: IJ031040: Connection is not associated with a managed connection: org.jboss.jca.adapters.jdbc.jdk8.WrappedConnectionJDK8@14b1ec6

12:07:19,246 WARN [com.arjuna.ats.arjuna] (ServerService Thread Pool -- 65) ARJUNA012077: Abort called on already aborted atomic action 0:ffffac140002:-2864376c:62025bb6:13

12:07:19,329 WARN [org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory] (ServerService Thread Pool -- 33) IJ030022: Lock owned during cleanup: ServerService Thread Pool -- 65: java.lang.Throwable: Lock owned during cleanup: ServerService Thread Pool -- 65

```

above logs are red lined in the server start logs  
is there any workaround for this issue, as per the logs its due to database connection issue  
i also added the connectionTimeout in the keycloak image environments like below  
`JDBC_PARAMS: 'connectTimeout=900'`  
after `docker-compose up -d` command executed, i also checked database it created all tables, but didn’t start the keycloak server.

---

<div class="post-metadata">

**Author:** ![jb22](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@jb22](https://forum.keycloak.org/u/jb22)\
**Post date:** [April 20, 2022, 11:50am UTC](https://forum.keycloak.org/t/keycloak-server-not-able-to-start-with-the-postgres-db-server/13519/2 "2022-04-20T11:50:39Z")

</div>

Any Update on this issues???

Still facing the same issues with Postgres database  
I tried setting up the environment variables in docker yaml file for increasing the timeout but still getting same issue  
JDBC\_PARAMS: “useSSL=false&allowPublicKeyRetrieval=true”  
JAVA\_OPTS\_APPEND: “-Djboss.as.management.blocking.timeout=10000”

---

<div class="post-metadata">

**Author:** ![pavanreddy07385](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/pavanreddy07385/32/6587_2.png) [@pavanreddy07385](https://forum.keycloak.org/u/pavanreddy07385)\
**Post date:** [September 17, 2022, 6:52am UTC](https://forum.keycloak.org/t/keycloak-server-not-able-to-start-with-the-postgres-db-server/13519/3 "2022-09-17T06:52:14Z")

</div>

@jb22 Did u find the solution?
