quarkusio/quarkus · critical · IllegalStateException

Quarkus failed to start up

Error message

Quarkus failed to start up

What it means

Thrown by Quarkus.manualStart() as an IllegalStateException when the manual state machine is in MANUAL_FAILURE, meaning a prior bootstrap/initialization step failed so startup cannot proceed. A RuntimeException variant with the bootstrap-failed message is also possible under race conditions inside the lock.

Source

Thrown at core/runtime/src/main/java/io/quarkus/runtime/Quarkus.java:301

        } catch (Exception e) {
            manualState = MANUAL_FAILURE;
            throw new RuntimeException("Quarkus manual initialization failed", e);
        }
    }

    /**
     * Manual startup of Quarkus runtime in cases where
     * Quarkus does not have control over main() i.e. Lambda or Azure Functions.
     *
     * This method will call Application.start() and register shutdown hook
     * It will fail if Quarkus.manualInitialize() has not been called.
     *
     *
     */
    public static void manualStart() {
        int tmpState = manualState;
        if (tmpState == MANUAL_FAILURE)
            throw new IllegalStateException("Quarkus failed to start up");
        if (tmpState >= MANUAL_STARTING)
            return;
        synchronized (manualLock) {
            tmpState = manualState;
            if (tmpState == MANUAL_FAILURE)
                throw new RuntimeException("Quarkus manual bootstrap failed");
            if (tmpState >= MANUAL_STARTING)
                return;
            if (tmpState != MANUAL_INITIALIZED)
                throw new IllegalStateException("Quarkus manual start cannot proceed as warmup did not run");
            manualState = MANUAL_STARTING;
        }
        try {
            String[] args = {};
            Runtime.getRuntime().addShutdownHook(new Thread() {
                @Override
                public void run() {
                    ShutdownRecorder.runShutdown();

View on GitHub (pinned to e1c734241f)

Solutions

  1. Ensure manualInitialize() completes successfully before calling manualStart().
  2. Inspect and fix the exception thrown by the earlier manualInitialize() call.
  3. Treat MANUAL_FAILURE as terminal: redeploy/recreate the runtime instead of retrying.

Example fix

// before
Quarkus.manualInitialize(); // exception swallowed upstream
Quarkus.manualStart();
// after
Quarkus.manualInitialize(); // let failures propagate
Quarkus.manualStart(); // only reached on success
Defensive patterns

Strategy: try-catch

Validate before calling

// ensure init ran successfully before start:
Objects.requireNonNull(initResult, "manualInitialize must complete first");

Try / catch

try { Quarkus.manualInitialize(); Quarkus.manualStart(); } catch (RuntimeException e) { log.error("manual lifecycle failed", e); throw e; }

Prevention

When it happens

Trigger: Calling Quarkus.manualStart() after manualInitialize() (or an earlier manualStart()) failed and set manualState to MANUAL_FAILURE.

Common situations: Serverless handler code that ignores the exception from manualInitialize() and still calls manualStart() on the next invocation; framework glue code invoking start without checking init success.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/7221a9bb575cd394. Report an issue: GitHub.