romanigk / dezentrale-events

Events im Hackspace dezentrale in Leipzig
0 stars 0 forks source link

Fix database setup in docker compose runs #57

Open romanigk opened 1 year ago

romanigk commented 1 year ago

For some reason unknown to me, the database driver is currently not found after a build with Docker and subsequent start. The goal of this ticket is to use docker compose up to start a runnable server including the postgreSQL database without the following error occurring:

dezentrale-events-web-1  | 2023-07-02 11:29:37.046 [main] INFO  ktor.application - Autoreload is disabled because the development mode is off.
dezentrale-events-web-1  | Exception in thread "main" java.sql.SQLException: No suitable driver found for jdbc:h2:mem:test;DB_CLOSE_DELAY=-1
dezentrale-events-web-1  |      at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:706)
dezentrale-events-web-1  |      at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:229)
dezentrale-events-web-1  |      at space.dezentrale.plugins.DatabasesKt.connectToPostgres(Databases.kt:71)
dezentrale-events-web-1  |      at space.dezentrale.plugins.DatabasesKt.configureDatabases(Databases.kt:13)
dezentrale-events-web-1  |      at space.dezentrale.ApplicationKt.module(Application.kt:15)
dezentrale-events-web-1  |      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
dezentrale-events-web-1  |      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
dezentrale-events-web-1  |      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
dezentrale-events-web-1  |      at java.base/java.lang.reflect.Method.invoke(Method.java:568)
dezentrale-events-web-1  |      at kotlin.reflect.jvm.internal.calls.CallerImpl$Method.callMethod(CallerImpl.kt:97)
dezentrale-events-web-1  |      at kotlin.reflect.jvm.internal.calls.CallerImpl$Method$Static.call(CallerImpl.kt:106)
dezentrale-events-web-1  |      at kotlin.reflect.jvm.internal.KCallableImpl.call(KCallableImpl.kt:108)
dezentrale-events-web-1  |      at kotlin.reflect.jvm.internal.KCallableImpl.callDefaultMethod$kotlin_reflection(KCallableImpl.kt:159)
dezentrale-events-web-1  |      at kotlin.reflect.jvm.internal.KCallableImpl.callBy(KCallableImpl.kt:112)
dezentrale-events-web-1  |      at io.ktor.server.engine.internal.CallableUtilsKt.callFunctionWithInjection(CallableUtils.kt:119)
dezentrale-events-web-1  |      at io.ktor.server.engine.internal.CallableUtilsKt.executeModuleFunction(CallableUtils.kt:36)
dezentrale-events-web-1  |      at io.ktor.server.engine.ApplicationEngineEnvironmentReloading$launchModuleByName$1.invoke(ApplicationEngineEnvironmentReloading.kt:331)
dezentrale-events-web-1  |      at io.ktor.server.engine.ApplicationEngineEnvironmentReloading$launchModuleByName$1.invoke(ApplicationEngineEnvironmentReloading.kt:330)
dezentrale-events-web-1  |      at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.avoidingDoubleStartupFor(ApplicationEngineEnvironmentReloading.kt:355)
dezentrale-events-web-1  |      at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.launchModuleByName(ApplicationEngineEnvironmentReloading.kt:330)
dezentrale-events-web-1  |      at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.access$launchModuleByName(ApplicationEngineEnvironmentReloading.kt:32)
dezentrale-events-web-1  |      at io.ktor.server.engine.ApplicationEngineEnvironmentReloading$instantiateAndConfigureApplication$1.invoke(ApplicationEngineEnvironmentReloading.kt:318)
dezentrale-events-web-1  |      at io.ktor.server.engine.ApplicationEngineEnvironmentReloading$instantiateAndConfigureApplication$1.invoke(ApplicationEngineEnvironmentReloading.kt:309)
dezentrale-events-web-1  |      at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.avoidingDoubleStartup(ApplicationEngineEnvironmentReloading.kt:337)
dezentrale-events-web-1  |      at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.instantiateAndConfigureApplication(ApplicationEngineEnvironmentReloading.kt:309)
dezentrale-events-web-1  |      at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.createApplication(ApplicationEngineEnvironmentReloading.kt:150)
dezentrale-events-web-1  |      at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.start(ApplicationEngineEnvironmentReloading.kt:276)
dezentrale-events-web-1  |      at io.ktor.server.netty.NettyApplicationEngine.start(NettyApplicationEngine.kt:216)
dezentrale-events-web-1  |      at space.dezentrale.ApplicationKt.main(Application.kt:10)
dezentrale-events-web-1  |      at space.dezentrale.ApplicationKt.main(Application.kt)
dezentrale-events-web-1 exited with code 1
romanigk commented 1 year ago

It is also strange that it tries to call h2 even if I remove all h2 settings and calls.