quarkusio/quarkus · error · IOException

IOException(deploymentStatus)

Error message

IOException(deploymentStatus)

What it means

When a request/event arrives before the function finished starting (started == false), accept() throws an IOException carrying deploymentStatus, which describes why the deployment did not complete (e.g. a startup failure message recorded earlier). GCF invokes the function and gets a 500 with that status text.

Source

Thrown at extensions/google-cloud-functions/runtime/src/main/java/io/quarkus/gcp/functions/QuarkusBackgroundFunction.java:98

                Class<?> clazz = Class.forName(selectedRawDelegate, false, delegateClassLoader);
                rawDelegate = (RawBackgroundFunction) Arc.container().instance(clazz).get();
            } catch (ClassNotFoundException e) {
                throw new RuntimeException(e);
            }
        }
    }

    public static void clearState() {
        delegate = null;
        parameterType = null;
        rawDelegate = null;
        delegateClassLoader = null;
    }

    @Override
    public void accept(String event, Context context) throws Exception {
        if (!started) {
            throw new IOException(deploymentStatus);
        }

        // TODO maybe we can check this at static init
        if ((delegate == null && rawDelegate == null) || (delegate != null && rawDelegate != null)) {
            throw new IOException("We didn't found any BackgroundFunction or RawBackgroundFunction to run " +
                    "(or there is multiple one and none selected inside your application.properties)");
        }

        ClassLoader currentCl = Thread.currentThread().getContextClassLoader();
        try {
            Thread.currentThread().setContextClassLoader(delegateClassLoader);
            if (rawDelegate != null) {
                rawDelegate.accept(event, context);
            } else {
                Gson gson = new Gson();
                try {
                    Object eventObj = gson.fromJson(event, parameterType);
                    delegate.accept(eventObj, context);

View on GitHub (pinned to e1c734241f)

Solutions

  1. Read deploymentStatus (the IOException message) for the underlying startup failure and fix that error.
  2. Check function logs for the Quarkus startup exception that prevented started=true.
  3. Increase function memory/timeout if startup is timing out, or optimize startup.
  4. Redeploy after fixing the startup failure; configure GCF min-instances to reduce cold-start exposure.

Example fix

// no code fix; fix the underlying startup error shown in deploymentStatus
// e.g. fix CDI/config error then:
gcloud functions deploy myFn --source=. --entry-point=... 
Defensive patterns

Strategy: try-catch

Validate before calling

// client-side: check deployment health before sending events
// verify function is ready: gcloud functions describe myFn --format='value(state)'
# expect state == ACTIVE

Try / catch

try { invokeFunction(event); }
catch (IOException e) {
  log.error("Function not started, status: " + e.getMessage());
  retryWithBackoff(event);
}

Prevention

When it happens

Trigger: GCF sends an event/request while the Quarkus application startup failed or is not yet complete; deploymentStatus was set by the startup failure handler.

Common situations: Cold start hitting a function whose startup crashed (bean creation failure, port/config errors); GCF traffic arriving during a slow or failed init; earlier build/startup errors recorded into deploymentStatus.

Related errors


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