Hi! I just got a weird error where I start my Ktor...
# ktor
h
Hi! I just got a weird error where I start my Ktor server and it launches correctly and reads the config from my application.conf, but then it immediately shuts down with exit code 0. No errors printed or anything. This is how I start the server:
Copy code
embeddedServer(
                Netty,
                environment =
                    applicationEnvironment {
                        config = ApplicationConfig("application.conf")
                    },
                module = Application::startApp,
            )
            .start(wait = true)
Any idea what I'm doing wrong?
Application::startApp
is called. I have a log statements there that gets printed
a
It seems correct. Can you share the logs?
h
Copy code
2025-03-18 18:35:35.857 [main] DEBUG io.ktor.server.Application - Java Home: /Users/hellman/.sdkman/candidates/java
2025-03-18 18:35:35.906 [main] INFO  io.ktor.server.Application - Starting My App
2025-03-18 18:35:35.911 [main] INFO  io.ktor.server.Application - Installing Koin
2025-03-18 18:35:35.921 [main] INFO  [Koin] - Started 13 definitions in 1.375 ms
2025-03-18 18:35:35.929 [main] INFO  io.ktor.server.Application - Installing JWT Authentication 
2025-03-18 18:35:36.252 [main] INFO  io.ktor.server.Application - JWK Provider created. 2025-03-18 18:35:36.266 [main] INFO  io.ktor.server.Application - Application started in 0.513 seconds.
a
Can you check that the port isn't busy?
h
I checked any nothing else is running on that port. Also tried changing the port in application.conf
e
Anything in application.conf causing it to have a funky behaviour 😬?
h
Not that I can tell. Started removing things but now I'm down to no configuration and just a basic route that always responds with ok, and it still fails to start. I think my computer is haunted. 😅
😂 1