{"record":{"id":"0227103a009c22ca","repo":"floci-io/floci","slug":"boot-hook-execution-interrupted","errorCode":null,"errorMessage":"Boot hook execution interrupted","messagePattern":"Boot hook execution interrupted","errorType":"panic","errorClass":"IllegalStateException","httpStatus":null,"severity":"critical","filePath":"src/main/java/io/github/hectorvent/floci/lifecycle/EmulatorLifecycle.java","lineNumber":167,"sourceCode":"        this.initLifecycleState = initLifecycleState;\n        this.schemaCreationWorker = schemaCreationWorker;\n        this.containerTeardowns = containerTeardowns;\n        this.persistentPathValidator = persistentPathValidator;\n    }\n\n    void onStart(@Observes StartupEvent ignored) {\n        LOG.infof(\"=== AWS Local Emulator %s Starting ===\", appVersion.orElse(\"\"));\n        LOG.infof(\"Endpoint:  http://0.0.0.0:%d\", config.port());\n        LOG.infof(\"Region:    %s  Account: %s\", config.defaultRegion(), config.defaultAccountId());\n        LOG.infov(\"Storage:   {0}  Path: {1}\", config.storage().mode(), config.storage().persistentPath());\n        LOG.infov(\"TLS:       {0}\", config.tls().enabled() ? \"enabled (HTTPS + HTTP dual mode)\" : \"disabled (HTTP only)\");\n\n        // BOOT hooks run before service initialization — scripts cannot use AWS APIs yet.\n        try {\n            initializationHooksRunner.run(InitializationHook.BOOT);\n        } catch (InterruptedException e) {\n            Thread.currentThread().interrupt();\n            throw new IllegalStateException(\"Boot hook execution interrupted\", e);\n        } catch (IOException e) {\n            throw new IllegalStateException(\"Boot hook execution failed\", e);\n        }\n        initLifecycleState.markBootCompleted();\n\n        persistentPathValidator.validateAtBoot();\n\n        serviceRegistry.logEnabledServices();\n        storageFactory.loadAll();\n        schemaCreationWorker.recoverOrphans();\n        schemaCreationWorker.rehydrateSchemas();\n\n        sqsPoller.startPersistedPollers();\n        kinesisPoller.startPersistedPollers();\n        dynamodbStreamsPoller.startPersistedPollers();\n        pipesService.startPersistedPollers();\n        rdsService.restorePersistedRuntime();\n        if (config.services().elbv2().enabled()) {","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/floci-io/floci/blob/62ff490619e7bd3554597c28c704081b4c15add5/src/main/java/io/github/hectorvent/floci/lifecycle/EmulatorLifecycle.java#L149-L185","documentation":"Thrown by EmulatorLifecycle.onStart when running BOOT-phase initialization hooks is interrupted (the runner threw InterruptedException). The thread's interrupt flag is restored before failing, and startup aborts because BOOT hooks must complete before service initialization. The IllegalStateException fails Quarkus startup.","triggerScenarios":"A BOOT hook script/process is interrupted: emulator shutdown signaled while boot hooks run, container/VM killed gracefully, or a hook runner thread interrupted by thread-pool shutdown. Distinguishable from an IOException-based hook failure by this interrupted variant.","commonSituations":"Kubernetes/docker stop or CI timeout arriving during slow boot hooks; health-check-driven restarts killing the pod mid-boot; long-running bootstrap scripts exceeding orchestration patience.","solutions":["Make BOOT hooks fast and non-blocking so startup completes before shutdown signals arrive","If the emulator was deliberately stopped mid-boot, no fix is needed — just start it again","Increase the orchestrator's stop grace period / startup timeout so hooks can finish","Check logs above this error to see which hook was running when interrupted"],"exampleFix":"# before: slow boot hook\nfloci.init-hooks.boot[0].script = ./import-large-dataset.sh\n\n# after: move heavy work to a post-start phase or batch job\nfloci.init-hooks.post-start[0].script = ./import-large-dataset.sh","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// startup failure: catch at the process/orchestrator level\ncatch (IllegalStateException e) when e.cause is InterruptedException -> {\n    log(\"boot interrupted; emulator was likely shutting down — restart cleanly\")\n}","preventionTips":["Keep BOOT hooks short; move heavy work post-start","Give the container adequate stop-grace and startup timeouts","Don't kill the emulator during its startup window"],"tags":["startup","boot-hooks","interruption","lifecycle"],"backgroundTag":null,"analyzedSha":"62ff490619e7bd3554597c28c704081b4c15add5","analyzedAt":"2026-08-14T14:25:23.764Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}