conduktor / kafka-stack-docker-compose

docker compose files to create a fully working kafka stack
Apache License 2.0
3.28k stars 1.27k forks source link

FATAL: database "conduktor-console" does not exist #151

Closed colega closed 3 months ago

colega commented 3 months ago

I tried running docker compose -f full-stack.yml up on Apple Silicon Mac with Docker for Desktop.

It consistently fails as:

postgresql             | 2024-07-22 16:30:48.142 UTC [38] FATAL:  database "conduktor-console" does not exist
conduktor-console      | 2024-07-22 16:30:49,324 DEBG 'console' stdout output:
conduktor-console      | 2024-07-22T16:30:49,288Z [console:ZScheduler-Worker-10] ERROR zio-slf4j-logger -
conduktor-console      | org.postgresql.util.PSQLException: FATAL: database "conduktor-console" does not exist
conduktor-console      |    at org.postgresql.Driver$ConnectThread.getResult(Driver.java:397)
conduktor-console      |    at org.postgresql.Driver.connect(Driver.java:305)
conduktor-console      |    at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:681)
conduktor-console      |    at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:229)
conduktor-console      |    at org.postgresql.ds.common.BaseDataSource.getConnection(BaseDataSource.java:104)
conduktor-console      |    at org.postgresql.ds.common.BaseDataSource.getConnection(BaseDataSource.java:88)
conduktor-console      |    at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:360)
conduktor-console      |    at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:202)
conduktor-console      |    at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:461)
conduktor-console      |    at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:550)
conduktor-console      |    ... 21 common frames omitted
conduktor-console      | Wrapped by: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: FATAL: database "conduktor-console" does not exist
conduktor-console      |    at com.zaxxer.hikari.pool.HikariPool.throwPoolInitializationException(HikariPool.java:584)
conduktor-console      |    at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:571)
conduktor-console      |    at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:98)
conduktor-console      |    at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:80)
conduktor-console      |    at io.conduktor.database.datasource.SharedDataSource$.postgresDatasource$$anonfun$1$$anonfun$1$$anonfun$2(SharedDataSource.scala:27)
conduktor-console      |    at scala.util.ChainingOps$.pipe$extension(ChainingOps.scala:64)
conduktor-console      |    at io.conduktor.database.datasource.SharedDataSource$.postgresDatasource$$anonfun$1$$anonfun$1(SharedDataSource.scala:27)
conduktor-console      |    at zio.ZIOCompanionVersionSpecific.attempt$$anonfun$1(ZIOCompanionVersionSpecific.scala:100)
conduktor-console      |    at zio.ZIO$.suspendSucceed$$anonfun$1(ZIO.scala:4694)
conduktor-console      |    at zio.UnsafeVersionSpecific.implicitFunctionIsFunction$$anonfun$1(UnsafeVersionSpecific.scala:27)
conduktor-console      |    at zio.Unsafe$.unsafe(Unsafe.scala:37)
conduktor-console      |    at zio.ZIOCompanionVersionSpecific.succeed$$anonfun$1(ZIOCompanionVersionSpecific.scala:178)
conduktor-console      |    at zio.internal.FiberRuntime.runLoop(FiberRuntime.scala:960)
conduktor-console      |    at zio.internal.FiberRuntime.runLoop(FiberRuntime.scala:1025)
conduktor-console      |    at zio.internal.FiberRuntime.runLoop(FiberRuntime.scala:1053)
conduktor-console      |    at zio.internal.FiberRuntime.runLoop(FiberRuntime.scala:1025)
conduktor-console      |    at zio.internal.FiberRuntime.evaluateEffect(FiberRuntime.scala:403)
conduktor-console      |    at zio.internal.FiberRuntime.evaluateMessageWhileSuspended(FiberRuntime.scala:477)
conduktor-console      |    at zio.internal.FiberRuntime.drainQueueOnCurrentThread(FiberRuntime.scala:249)
conduktor-console      |    at zio.internal.FiberRuntime.run(FiberRuntime.scala:143)
conduktor-console      |    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
conduktor-console      |    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
conduktor-console      |    at java.base/java.lang.Thread.run(Thread.java:840)
conduktor-console      | Wrapped by: zio.FiberFailure: Interrupted by thread "zio-fiber-1785778537"
conduktor-console      |    at io.conduktor.console.Server.run(Server.scala:71)
conduktor-console      |
conduktor-console      | 2024-07-22 16:30:49,943 DEBG fd 7 closed, stopped monitoring <POutputDispatcher at 281473726279744 for <Subprocess at 281473726279648 with name console in state RUNNING> (stdout)>
conduktor-console      | 2024-07-22 16:30:50,947 INFO exited: console (exit status 1; not expected)
conduktor-console      | 2024-07-22 16:30:50,948 DEBG received SIGCHLD indicating a child quit

Looks like PostgreSQL is not provisioned properly. Should that happen on start?

colega commented 3 months ago

Fixed: looks like there was a volume containing Postgres data from a previous run, so Postgres didn't create the new database after updating git repository.

I listed the volumes (docker volume ls) and removed the ones for this docker-compse, especially pg_data.