{"record":{"id":"39daa82d0af36731","repo":"kestra-io/kestra","slug":"not-started-in-time","errorCode":null,"errorMessage":"{} not started in time","messagePattern":"(.+?) not started in time","errorType":"console","errorClass":"RuntimeException","httpStatus":null,"severity":"critical","filePath":"cli/src/main/java/io/kestra/cli/StandAloneRunner.java","lineNumber":111,"sourceCode":"            poolExecutor.execute(scheduler);\n            servers.add(scheduler);\n        }\n\n        if (indexerEnabled) {\n            Indexer indexer = indexerProvider.get();\n            poolExecutor.execute(indexer);\n            servers.add(indexer);\n        }\n\n        // start the embedded SystemWorker (always present in STANDALONE mode)\n        SystemWorker systemWorker = systemWorkerProvider.get();\n        poolExecutor.execute(systemWorker::start);\n        servers.add(systemWorker);\n\n        try {\n            Await.await().atMost(getRunningTimeout()).until(() -> servers.stream().allMatch(StandAloneRunner::isStarted));\n        } catch (ConditionTimeoutException e) {\n            throw new RuntimeException(\n                servers.stream().filter(s -> !isStarted(s))\n                    .map(s -> s.getClass().getSimpleName() + \" (state: \" + s.getState() + \")\")\n                    .toList() + \" not started in time\"\n            );\n        }\n    }\n\n    /**\n     * A service is only considered started once it reached RUNNING (or MAINTENANCE).\n     */\n    private static boolean isStarted(Service service) {\n        Service.ServiceState state = service.getState();\n        return Service.ServiceState.RUNNING == state || Service.ServiceState.MAINTENANCE == state;\n    }\n\n    private Duration getRunningTimeout() {\n        return Optional.ofNullable(serverConfig.standalone())\n            .map(ServerConfig.Standalone::running)","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/kestra-io/kestra/blob/823fada9274c4f9c251ea0a516460a4f7d958032/cli/src/main/java/io/kestra/cli/StandAloneRunner.java#L93-L129","documentation":"Thrown by StandAloneRunner when one or more embedded services (Controller, Worker, Scheduler, Indexer, SystemWorker) fail to reach RUNNING/MAINTENANCE state within the configured startup timeout (default 1 minute via ServerConfig.Standalone.Running.timeout). The message lists each lagging service with its simple class name and current ServiceState. It is a bare RuntimeException wrapping a ConditionTimeoutException from Awaitility.","triggerScenarios":"StandAloneRunner.run() submits all enabled services to the pool, then Await.await().atMost(timeout).until(allMatch(isStarted)) times out; the catch builds a list of services where isStarted is false and throws.","commonSituations":"Database (JDBC queue / repository) unreachable or slow to connect, Kafka/Elasticsearch backend down, port conflict on the worker/controller, a plugin failing during initialization blocks a service thread, low resources (CPU/memory) on cold start, or the standalone running timeout is set too low.","solutions":["Read the listed service(s) and their ServiceState in the message — that names which component is stuck.","Check the logs above this exception for the underlying cause (DB connection refused, port bind failure, plugin load error).","Verify all required backends (database, queue, search) are reachable and credentials are valid.","Increase kestra.server.standalone.running.timeout if the environment is legitimately slow (e.g. cold H2/Postgres).","Ensure no port conflict (default 8080) and that enough CPU/heap is available for startup."],"exampleFix":"// before: default 1 minute may be too short on cold start\nAwait.await().atMost(getRunningTimeout()).until(...);\n// after: raise the timeout in application.yml\n# kestra:\n#   server:\n#     standalone:\n#       running:\n#         timeout: PT2M","handlingStrategy":"try-catch","validationCode":"// Before run(): probe required backends\nif (!isDbReachable(datasourceUrl)) { throw new IllegalStateException('DB unreachable'); }","typeGuard":null,"tryCatchPattern":"try {\n  runner.run();\n} catch (RuntimeException e) {\n  if (e.getMessage() != null && e.getMessage().endsWith(\" not started in time\")) {\n    log.error('Startup timed out; stuck services: {}', e.getMessage());\n    dumpServiceStates();\n  }\n  throw e;\n}","preventionTips":["Verify DB/queue/search connectivity before launching standalone.","Tune kestra.server.standalone.running.timeout to the environment's cold-start budget.","Watch startup logs for the first failing service; the aggregate message hides the root cause.","Reserve enough CPU/heap so services reach RUNNING within the timeout."],"tags":["standalone","startup","runtime","services","infrastructure"],"backgroundTag":null,"analyzedSha":"823fada9274c4f9c251ea0a516460a4f7d958032","analyzedAt":"2026-08-14T06:15:17.947Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}