ibuetler / docker-keycloak-traefik-workshop

Docker with Keycloak and Traefik Workshop
243 stars 43 forks source link

setup of keycloak fails #1

Closed jordo1138 closed 5 years ago

jordo1138 commented 5 years ago

Hi, nice guide you have on docker-keycloak-traefik-workshop I"m currently running into this issue in your guide. The key cloak setup cd /opt/git/docker-keycloak-traefik-workshop/keycloak docker-compose up -d

pulls the images as you describe, and once completes I follow the logs but find it has some issues and finally will exit

keycloak_1 | 20:37:48,615 WARN [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (ServerService Thread Pool -- 63) IJ000604: Throwable while attempting to get a new connection: null: javax.resource.ResourceException: IJ031084: Unable to create connection keycloak_1 | at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:345) keycloak_1 | at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:352) keycloak_1 | at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:287) keycloak_1 | at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool.createConnectionEventListener(SemaphoreConcurrentLinkedDequeManagedConnectionPool.java:1325) keycloak_1 | at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool.getConnection(SemaphoreConcurrentLinkedDequeManagedConnectionPool.java:499) keycloak_1 | at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getSimpleConnection(AbstractPool.java:632) keycloak_1 | at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getConnection(AbstractPool.java:604) keycloak_1 | at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:624) keycloak_1 | at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:440) keycloak_1 | at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:789) keycloak_1 | at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:138) keycloak_1 | at org.jboss.as.connector.subsystems.datasources.WildFlyDataSource.getConnection(WildFlyDataSource.java:64) keycloak_1 | at org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.getConnection(DefaultJpaConnectionProviderFactory.java:376) keycloak_1 | at org.keycloak.connections.jpa.updater.liquibase.lock.LiquibaseDBLockProvider.lazyInit(LiquibaseDBLockProvider.java:65) keycloak_1 | at org.keycloak.connections.jpa.updater.liquibase.lock.LiquibaseDBLockProvider.lambda$waitForLock$0(LiquibaseDBLockProvider.java:97) keycloak_1 | at org.keycloak.models.utils.KeycloakModelUtils.suspendJtaTransaction(KeycloakModelUtils.java:678) keycloak_1 | at org.keycloak.connections.jpa.updater.liquibase.lock.LiquibaseDBLockProvider.waitForLock(LiquibaseDBLockProvider.java:95) keycloak_1 | at org.keycloak.services.resources.KeycloakApplication$1.run(KeycloakApplication.java:144) keycloak_1 | at org.keycloak.models.utils.KeycloakModelUtils.runJobInTransaction(KeycloakModelUtils.java:227) keycloak_1 | at org.keycloak.services.resources.KeycloakApplication.<init>(KeycloakApplication.java:137) keycloak_1 | at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) keycloak_1 | at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) keycloak_1 | at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) keycloak_1 | at java.lang.reflect.Constructor.newInstance(Constructor.java:423) keycloak_1 | at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:152) keycloak_1 | at org.jboss.resteasy.spi.ResteasyProviderFactory.createProviderInstance(ResteasyProviderFactory.java:2750) keycloak_1 | at org.jboss.resteasy.spi.ResteasyDeployment.createApplication(ResteasyDeployment.java:364) keycloak_1 | at org.jboss.resteasy.spi.ResteasyDeployment.startInternal(ResteasyDeployment.java:277) keycloak_1 | at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:89) keycloak_1 | at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:119) keycloak_1 | at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36) keycloak_1 | at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117) keycloak_1 | at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:78) keycloak_1 | at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103) keycloak_1 | at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:303) keycloak_1 | at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:143) keycloak_1 | at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:583) keycloak_1 | at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:554) keycloak_1 | at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42) keycloak_1 | at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) keycloak_1 | at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105) keycloak_1 | at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502) keycloak_1 | at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502) keycloak_1 | at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502) keycloak_1 | at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502) keycloak_1 | at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:596) keycloak_1 | at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:97) keycloak_1 | at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:78) keycloak_1 | at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) keycloak_1 | at java.util.concurrent.FutureTask.run(FutureTask.java:266) keycloak_1 | at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) keycloak_1 | at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982) keycloak_1 | at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486) keycloak_1 | at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377) keycloak_1 | at java.lang.Thread.run(Thread.java:748) keycloak_1 | at org.jboss.threads.JBossThread.run(JBossThread.java:485) keycloak_1 | Caused by: org.postgresql.util.PSQLException: The connection attempt failed. keycloak_1 | at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:292) keycloak_1 | at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49) keycloak_1 | at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195) keycloak_1 | at org.postgresql.Driver.makeConnection(Driver.java:454) keycloak_1 | at org.postgresql.Driver.connect(Driver.java:256) keycloak_1 | at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:321) keycloak_1 | ... 55 more keycloak_1 | Caused by: java.net.UnknownHostException: keycloak_db keycloak_1 | at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184) keycloak_1 | at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) keycloak_1 | at java.net.Socket.connect(Socket.java:589) keycloak_1 | at org.postgresql.core.PGStream.<init>(PGStream.java:70) keycloak_1 | at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:91) keycloak_1 | at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:192) keycloak_1 | ... 60 more keycloak_1 | keycloak_1 | 20:37:48,623 INFO [org.jboss.as.server] (Thread-2) WFLYSRV0220: Server shutdown has been requested via an OS signal keycloak_1 | 20:37:48,642 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 63) MSC000001: Failed to start service jboss.deployment.unit."keycloak-server.war".undertow-deployment: org.jboss.msc.service.StartException in service jboss.deployment.unit."keycloak-server.war".undertow-deployment: java.lang.RuntimeException: RESTEASY003325: Failed to construct public org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher) keycloak_1 | at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:81) keycloak_1 | at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) keycloak_1 | at java.util.concurrent.FutureTask.run(FutureTask.java:266) keycloak_1 | at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) keycloak_1 | at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982) keycloak_1 | at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486) keycloak_1 | at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377) keycloak_1 | at java.lang.Thread.run(Thread.java:748) keycloak_1 | at org.jboss.threads.JBossThread.run(JBossThread.java:485) keycloak_1 | Caused by: java.lang.RuntimeException: RESTEASY003325: Failed to construct public org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher) keycloak_1 | at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:164) keycloak_1 | at org.jboss.resteasy.spi.ResteasyProviderFactory.createProviderInstance(ResteasyProviderFactory.java:2750) keycloak_1 | at org.jboss.resteasy.spi.ResteasyDeployment.createApplication(ResteasyDeployment.java:364) keycloak_1 | at org.jboss.resteasy.spi.ResteasyDeployment.startInternal(ResteasyDeployment.java:277) keycloak_1 | at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:89) keycloak_1 | at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:119) keycloak_1 | at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36) keycloak_1 | at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117) keycloak_1 | at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:78) keycloak_1 | at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103) keycloak_1 | at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:303) keycloak_1 | at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:143) keycloak_1 | at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:583) keycloak_1 | at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:554) keycloak_1 | at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42) keycloak_1 | at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) keycloak_1 | at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105) keycloak_1 | at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502) keycloak_1 | at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502) keycloak_1 | at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502) keycloak_1 | at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502) keycloak_1 | at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:596) keycloak_1 | at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:97) keycloak_1 | at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:78) keycloak_1 | ... 8 more keycloak_1 | Caused by: java.lang.RuntimeException: Failed to connect to database keycloak_1 | at org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.getConnection(DefaultJpaConnectionProviderFactory.java:382) keycloak_1 | at org.keycloak.connections.jpa.updater.liquibase.lock.LiquibaseDBLockProvider.lazyInit(LiquibaseDBLockProvider.java:65) keycloak_1 | at org.keycloak.connections.jpa.updater.liquibase.lock.LiquibaseDBLockProvider.lambda$waitForLock$0(LiquibaseDBLockProvider.java:97) keycloak_1 | at org.keycloak.models.utils.KeycloakModelUtils.suspendJtaTransaction(KeycloakModelUtils.java:678) keycloak_1 | at org.keycloak.connections.jpa.updater.liquibase.lock.LiquibaseDBLockProvider.waitForLock(LiquibaseDBLockProvider.java:95) keycloak_1 | at org.keycloak.services.resources.KeycloakApplication$1.run(KeycloakApplication.java:144) keycloak_1 | at org.keycloak.models.utils.KeycloakModelUtils.runJobInTransaction(KeycloakModelUtils.java:227) keycloak_1 | at org.keycloak.services.resources.KeycloakApplication.<init>(KeycloakApplication.java:137) keycloak_1 | at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) keycloak_1 | at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) keycloak_1 | at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) keycloak_1 | at java.lang.reflect.Constructor.newInstance(Constructor.java:423) keycloak_1 | at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:152) keycloak_1 | ... 31 more keycloak_1 | Caused by: java.sql.SQLException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:jboss/datasources/KeycloakDS keycloak_1 | at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:146) keycloak_1 | at org.jboss.as.connector.subsystems.datasources.WildFlyDataSource.getConnection(WildFlyDataSource.java:64) keycloak_1 | at org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.getConnection(DefaultJpaConnectionProviderFactory.java:376) keycloak_1 | ... 43 more keycloak_1 | Caused by: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:jboss/datasources/KeycloakDS keycloak_1 | at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:690) keycloak_1 | at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:440) keycloak_1 | at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:789) keycloak_1 | at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:138) keycloak_1 | ... 45 more keycloak_1 | Caused by: javax.resource.ResourceException: IJ031084: Unable to create connection keycloak_1 | at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:345) keycloak_1 | at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:352) keycloak_1 | at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:287) keycloak_1 | at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool.createConnectionEventListener(SemaphoreConcurrentLinkedDequeManagedConnectionPool.java:1325) keycloak_1 | at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool.getConnection(SemaphoreConcurrentLinkedDequeManagedConnectionPool.java:499) keycloak_1 | at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getSimpleConnection(AbstractPool.java:632) keycloak_1 | at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getConnection(AbstractPool.java:604) keycloak_1 | at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:624) keycloak_1 | ... 48 more keycloak_1 | Caused by: org.postgresql.util.PSQLException: The connection attempt failed. keycloak_1 | at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:292) keycloak_1 | at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49) keycloak_1 | at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195) keycloak_1 | at org.postgresql.Driver.makeConnection(Driver.java:454) keycloak_1 | at org.postgresql.Driver.connect(Driver.java:256) keycloak_1 | at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:321) keycloak_1 | ... 55 more keycloak_1 | Caused by: java.net.UnknownHostException: keycloak_db keycloak_1 | at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184) keycloak_1 | at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) keycloak_1 | at java.net.Socket.connect(Socket.java:589) keycloak_1 | at org.postgresql.core.PGStream.<init>(PGStream.java:70) keycloak_1 | at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:91) keycloak_1 | at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:192) keycloak_1 | ... 60 more keycloak_1 | keycloak_1 | 20:37:48,657 INFO [org.wildfly.extension.undertow] (MSC service thread 1-4) WFLYUT0008: Undertow AJP listener ajp suspending keycloak_1 | 20:37:48,658 INFO [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0008: Undertow HTTPS listener https suspending keycloak_1 | 20:37:48,659 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0019: Host default-host stopping keycloak_1 | 20:37:48,666 INFO [org.wildfly.extension.undertow] (MSC service thread 1-4) WFLYUT0007: Undertow AJP listener ajp stopped, was bound to 0.0.0.0:8009 keycloak_1 | 20:37:48,666 INFO [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0007: Undertow HTTPS listener https stopped, was bound to 0.0.0.0:8443 keycloak_1 | 20:37:48,676 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC service thread 1-3) ISPN000080: Disconnecting JGroups channel ejb keycloak_1 | 20:37:48,677 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC service thread 1-8) ISPN000080: Disconnecting JGroups channel ejb keycloak_1 | 20:37:48,677 INFO [org.jboss.modcluster] (ServerService Thread Pool -- 65) MODCLUSTER000002: Initiating mod_cluster shutdown keycloak_1 | 20:37:48,678 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-6) WFLYJCA0010: Unbound data source [java:jboss/datasources/KeycloakDS] keycloak_1 | 20:37:48,683 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC service thread 1-5) ISPN000080: Disconnecting JGroups channel ejb keycloak_1 | 20:37:48,693 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-5) WFLYJCA0010: Unbound data source [java:jboss/datasources/ExampleDS] keycloak_1 | 20:37:48,694 INFO [org.jboss.as.mail.extension] (MSC service thread 1-1) WFLYMAIL0002: Unbound mail session [java:jboss/mail/Default] keycloak_1 | 20:37:48,696 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-8) WFLYJCA0019: Stopped Driver service with driver-name = h2 keycloak_1 | 20:37:48,705 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-5) WFLYJCA0019: Stopped Driver service with driver-name = postgresql keycloak_1 | 20:37:48,706 INFO [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0008: Undertow HTTP listener default suspending keycloak_1 | 20:37:48,707 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 67) WFLYCLINF0003: Stopped authorization cache from keycloak container keycloak_1 | 20:37:48,712 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0028: Stopped deployment keycloak-server.war (runtime-name: keycloak-server.war) in 53ms keycloak_1 | 20:37:48,722 INFO [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0007: Undertow HTTP listener default stopped, was bound to 0.0.0.0:8080 keycloak_1 | 20:37:48,724 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 61) WFLYCLINF0003: Stopped users cache from keycloak container keycloak_1 | 20:37:48,724 INFO [org.wildfly.extension.undertow] (MSC service thread 1-8) WFLYUT0004: Undertow 2.0.19.Final stopping keycloak_1 | 20:37:48,724 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 58) WFLYCLINF0003: Stopped realms cache from keycloak container keycloak_1 | 20:37:48,730 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 64) WFLYCLINF0003: Stopped offlineSessions cache from keycloak container keycloak_1 | 20:37:48,732 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 73) WFLYCLINF0003: Stopped keys cache from keycloak container keycloak_1 | 20:37:48,737 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 59) WFLYCLINF0003: Stopped loginFailures cache from keycloak container keycloak_1 | 20:37:48,748 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 60) WFLYCLINF0003: Stopped authenticationSessions cache from keycloak container keycloak_1 | 20:37:48,751 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 68) WFLYCLINF0003: Stopped sessions cache from keycloak container keycloak_1 | 20:37:48,751 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 62) WFLYCLINF0003: Stopped actionTokens cache from keycloak container keycloak_1 | 20:37:48,753 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 66) WFLYCLINF0003: Stopped clientSessions cache from keycloak container keycloak_1 | 20:37:48,755 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 72) WFLYCLINF0003: Stopped work cache from keycloak container keycloak_1 | 20:37:48,753 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 71) WFLYCLINF0003: Stopped offlineClientSessions cache from keycloak container keycloak_1 | 20:37:48,756 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 67) WFLYCLINF0003: Stopped client-mappings cache from ejb container keycloak_1 | 20:37:48,758 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC service thread 1-8) ISPN000080: Disconnecting JGroups channel ejb keycloak_1 | 20:37:48,765 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC service thread 1-2) ISPN000080: Disconnecting JGroups channel ejb keycloak_1 | 20:37:48,789 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("subsystem" => "microprofile-metrics-smallrye")]): java.lang.NullPointerException keycloak_1 | at org.wildfly.extension.microprofile.metrics.MicroProfileMetricsSubsystemAdd$2.execute(MicroProfileMetricsSubsystemAdd.java:86) keycloak_1 | at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:999) keycloak_1 | at org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:743) keycloak_1 | at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:467) keycloak_1 | at org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1412) keycloak_1 | at org.jboss.as.controller.ModelControllerImpl.boot(ModelControllerImpl.java:521) keycloak_1 | at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:472) keycloak_1 | at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:434) keycloak_1 | at org.jboss.as.server.ServerService.boot(ServerService.java:435) keycloak_1 | at org.jboss.as.server.ServerService.boot(ServerService.java:394) keycloak_1 | at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:374) keycloak_1 | at java.lang.Thread.run(Thread.java:748) keycloak_1 | keycloak_1 | keycloak_keycloak_db_1 exited with code 1 keycloak_keycloak_1 exited with code 1

I will continue to troubleshoot to see if its related to my env. using latest osx and docker for mac Thanks,

jordo1138 commented 5 years ago

update: when I changed keycloak's docker-compose.yml to use postgres:latest everything worked Thanks,

ibuetler commented 5 years ago

Thank you for your feedback. Not sure if this happens only the first time when the docker images get pulled. That's why I have a clean.sh script in the repo. But with the second start, everything worked out for me. May you can verify this? Thank you Ivan

rbq commented 5 years ago

FYI: I repeatedly get the same error when I try to install the Helm chart version 5.1.1 (Keycloak 6.0.1) on Kubernetes.

utkarshgpta commented 5 years ago

I'm trying to run standalone.sh for Keycloak 7.0.0 on Ubuntu. Getting the same kind of error repeatedly(would run successfully sometimes). Is there any solution to this problem?

I'm getting the following error: [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (ServerService Thread Pool -- 68) IJ000604: Throwable while attempting to get a new connection

Full debug logs: Debug Log

ibuetler commented 5 years ago

I am sorry but I don't know this error.

jdellostritto commented 5 years ago

I ran into this issue moving from 4.8.3.Final to 6.0.1 and finally to 7.0.0. It looks to me like Keycloak would default to postgres in earlier versions. This is what my docker file looked like for 4.8.3.Final:

version: '2.1'
services:
  keycloak:
    image: jboss/keycloak:4.8.3.Final
    healthcheck:
      test: "exit 0"
    ports:
        - 8080:8080
        - 8543:8543
        - 10090:10090
    environment:
      KEYCLOAK_USER: aaaaaaa
      KEYCLOAK_PASSWORD: xxxxxxxxx
      PROXY_ADDRESS_FORWARDING: "true"
    command: "-b 0.0.0.0 -Dkeycloak.import=/opt/jboss/keycloak/realm-api.json,/opt/jboss/keycloak/realm-app.json"
    volumes:
    - ./realm-api.json:/opt/jboss/keycloak/realm-api.json
    - ./realm-app.json:/opt/jboss/keycloak/realm-app.json
    - ../server/themes/mycompany:/opt/jboss/keycloak/themes/mycompany
    depends_on:
      - postgres

  postgres:
    image: postgres
    environment:
      POSTGRES_DB: keycloak
      POSTGRES_USER: aaaaaaaaa
      POSTGRES_PASSWORD: xxxxxxxxxxxxx

This worked fine until I updated to 6.0.1 and received this error: ("add") failed - address: ("subsystem" => "datasources"), keycloak_1 | ("data-source" => "KeycloakDS")

Turns out I was not specifying the DB_VENDOR. I had to include more environment variables in order to avoid it failing to find a KeycloakDS. I assumed this was a Keycloak data-source. The following fixed my issue.

version: '3.4'
services:
  keycloak:
    image: jboss/keycloak:7.0.0
    healthcheck:
      test: "exit 0"
    ports:
        - 8080:8080
        - 8543:8543
        - 10090:10090
    environment:
      KEYCLOAK_USER: aaaaaaaa
      KEYCLOAK_PASSWORD: xxxxxxxxxxx
      PROXY_ADDRESS_FORWARDING: "true"
      DB_VENDOR: POSTGRES
      DB_ADDR: postgres
      DB_PORT: 5432
      DB_DATABASE: keycloak
      DB_USER: aaaaaaaaaaaaa
      DB_PASSWORD: xxxxxxxxxxxx

    command: "-b 0.0.0.0 -Dkeycloak.import=/opt/jboss/keycloak/realm-api.json,/opt/jboss/keycloak/realm-app.json"
    volumes:
    - ./realm-api.json:/opt/jboss/keycloak/realm-api.json
    - ./realm-app.json:/opt/jboss/keycloak/realm-app.json
    - ../server/themes/mycompany:/opt/jboss/keycloak/themes/mycompany
    depends_on:
      - postgres

  postgres:
    image: postgres:latest
    environment:
      POSTGRES_DB: keycloak
      POSTGRES_USER: aaaaaaa
      POSTGRES_PASSWORD: xxxxxxxxx

Not entirely sure what is going on under the hood however i suspect that Keycloak defaults that were in place in previous versions are no longer in use.

thomase1993 commented 3 years ago

They used sometimes the H2 database maybe that's why it works sometimes. Here are some example compose files: https://github.com/keycloak/keycloak-containers/blob/master/docker-compose-examples/keycloak-postgres.yml