{"record":{"id":"3238c37ff052591f","repo":"quarkusio/quarkus","slug":"ioexception-deploymentstatus","errorCode":null,"errorMessage":"IOException(deploymentStatus)","messagePattern":"IOException\\(deploymentStatus\\)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"extensions/google-cloud-functions/runtime/src/main/java/io/quarkus/gcp/functions/QuarkusBackgroundFunction.java","lineNumber":98,"sourceCode":"                Class<?> clazz = Class.forName(selectedRawDelegate, false, delegateClassLoader);\n                rawDelegate = (RawBackgroundFunction) Arc.container().instance(clazz).get();\n            } catch (ClassNotFoundException e) {\n                throw new RuntimeException(e);\n            }\n        }\n    }\n\n    public static void clearState() {\n        delegate = null;\n        parameterType = null;\n        rawDelegate = null;\n        delegateClassLoader = null;\n    }\n\n    @Override\n    public void accept(String event, Context context) throws Exception {\n        if (!started) {\n            throw new IOException(deploymentStatus);\n        }\n\n        // TODO maybe we can check this at static init\n        if ((delegate == null && rawDelegate == null) || (delegate != null && rawDelegate != null)) {\n            throw new IOException(\"We didn't found any BackgroundFunction or RawBackgroundFunction to run \" +\n                    \"(or there is multiple one and none selected inside your application.properties)\");\n        }\n\n        ClassLoader currentCl = Thread.currentThread().getContextClassLoader();\n        try {\n            Thread.currentThread().setContextClassLoader(delegateClassLoader);\n            if (rawDelegate != null) {\n                rawDelegate.accept(event, context);\n            } else {\n                Gson gson = new Gson();\n                try {\n                    Object eventObj = gson.fromJson(event, parameterType);\n                    delegate.accept(eventObj, context);","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/google-cloud-functions/runtime/src/main/java/io/quarkus/gcp/functions/QuarkusBackgroundFunction.java#L80-L116","documentation":"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.","triggerScenarios":"GCF sends an event/request while the Quarkus application startup failed or is not yet complete; deploymentStatus was set by the startup failure handler.","commonSituations":"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.","solutions":["Read deploymentStatus (the IOException message) for the underlying startup failure and fix that error.","Check function logs for the Quarkus startup exception that prevented started=true.","Increase function memory/timeout if startup is timing out, or optimize startup.","Redeploy after fixing the startup failure; configure GCF min-instances to reduce cold-start exposure."],"exampleFix":"// no code fix; fix the underlying startup error shown in deploymentStatus\n// e.g. fix CDI/config error then:\ngcloud functions deploy myFn --source=. --entry-point=... ","handlingStrategy":"try-catch","validationCode":"// client-side: check deployment health before sending events\n// verify function is ready: gcloud functions describe myFn --format='value(state)'\n# expect state == ACTIVE","typeGuard":null,"tryCatchPattern":"try { invokeFunction(event); }\ncatch (IOException e) {\n  log.error(\"Function not started, status: \" + e.getMessage());\n  retryWithBackoff(event);\n}","preventionTips":["Fix any startup errors surfaced in function logs before going live","Configure GCF min-instances to reduce cold-start failures","Set adequate memory/timeout so startup completes","Monitor function startup errors via Cloud Monitoring"],"tags":["google-cloud-functions","startup","cold-start"],"backgroundTag":"function-not-started","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}