{"record":{"id":"e6b1ec76c831148c","repo":"quarkusio/quarkus","slug":"no-function-named-functionname-did-you-fo","errorCode":null,"errorMessage":"No function named \" + functionName + \", did you forget to annotate your function with @Named ?","messagePattern":"No function named \" \\+ functionName \\+ \", did you forget to annotate your function with @Named \\?","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/google-cloud-functions/runtime/src/main/java/io/quarkus/gcp/functions/GoogleCloudFunctionRecorder.java","lineNumber":33,"sourceCode":"    public GoogleCloudFunctionRecorder(final RuntimeValue<GoogleCloudFunctionsConfig> runtimeConfig) {\n        this.runtimeConfig = runtimeConfig;\n    }\n\n    public void selectDelegate(List<GoogleCloudFunctionInfo> cloudFunctions,\n            ShutdownContext shutdownContext) {\n        Map<GoogleCloudFunctionInfo.FunctionType, String> delegates = new HashMap<>();\n        // if a function name is defined, check that it exists\n        if (runtimeConfig.getValue().function().isPresent()) {\n            String functionName = runtimeConfig.getValue().function().get();\n            boolean found = false;\n            for (GoogleCloudFunctionInfo info : cloudFunctions) {\n                if (functionName.equals(info.getBeanName())) {\n                    delegates.put(info.getFunctionType(), info.getClassName());\n                    found = true;\n                }\n            }\n            if (!found) {\n                throw new RuntimeException(\n                        \"No function named \" + functionName + \", did you forget to annotate your function with @Named ?\");\n            }\n        } else {\n            for (GoogleCloudFunctionInfo info : cloudFunctions) {\n                if (delegates.containsKey(info.getFunctionType())) {\n                    throw new RuntimeException(\n                            \"Multiple functions found, please use 'quarkus.google-cloud-functions.function' to select one\");\n                }\n                delegates.put(info.getFunctionType(), info.getClassName());\n            }\n        }\n        QuarkusHttpFunction.setDelegate(delegates.get(GoogleCloudFunctionInfo.FunctionType.HTTP));\n        QuarkusBackgroundFunction.setDelegates(delegates.get(GoogleCloudFunctionInfo.FunctionType.BACKGROUND),\n                delegates.get(GoogleCloudFunctionInfo.FunctionType.RAW_BACKGROUND));\n        QuarkusCloudEventsFunction.setDelegate(delegates.get(GoogleCloudFunctionInfo.FunctionType.CLOUD_EVENT));\n\n        shutdownContext.addShutdownTask(new Runnable() {\n            @Override","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/google-cloud-functions/runtime/src/main/java/io/quarkus/gcp/functions/GoogleCloudFunctionRecorder.java#L15-L51","documentation":"At startup, GoogleCloudFunctionRecorder.selectDelegate resolves which function bean to delegate to based on the configured quarkus.google-cloud-functions.function name. If the configured name matches no registered function bean, it throws a RuntimeException suggesting the function is missing @Named.","triggerScenarios":"quarkus.google-cloud-functions.function is set to a name that does not equal the bean name of any discovered function (functions are matched via info.getBeanName()).","commonSituations":"Typo in the quarkus.google-cloud-functions.function value; renamed function class/bean without updating config; multiple functions where the config names a non-existent one.","solutions":["Set quarkus.google-cloud-functions.function to the exact bean name of the function class.","Annotate the function class with @Named(\"your-name\") so it matches the configured value.","Remove the property if you only have one function."],"exampleFix":"// before (application.properties)\nquarkus.google-cloud-functions.function=myFn\n// class: public class Functions  (no @Named)\n// after\n@Named(\"myFn\")\npublic class Functions { /* ... */ }","handlingStrategy":"validation","validationCode":"// verify configured name matches a @Named function\nclass F { public static void main(String[] a) {\n  String configured = \"myFunction\";\n  // scan sources for @Named(configured) before deploy\n} }\n// simpler: grep -r \"@Named(\\\"$QUARKUS_GCF_FUNCTION\\\")\" src/main/java","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep quarkus.google-cloud-functions.function value identical to the @Named value","Rename function classes and config together","Add an integration test that boots with the production config","Omit the property when there is only one function"],"tags":["google-cloud-functions","configuration","cdi-naming"],"backgroundTag":"named-bean-not-found","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}