quarkusio/quarkus · error · RuntimeException
No function named " + functionName + ", did you forget to an
Error message
No function named " + functionName + ", did you forget to annotate your function with @Named ?
What it means
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.
Source
Thrown at extensions/google-cloud-functions/runtime/src/main/java/io/quarkus/gcp/functions/GoogleCloudFunctionRecorder.java:33
public GoogleCloudFunctionRecorder(final RuntimeValue<GoogleCloudFunctionsConfig> runtimeConfig) {
this.runtimeConfig = runtimeConfig;
}
public void selectDelegate(List<GoogleCloudFunctionInfo> cloudFunctions,
ShutdownContext shutdownContext) {
Map<GoogleCloudFunctionInfo.FunctionType, String> delegates = new HashMap<>();
// if a function name is defined, check that it exists
if (runtimeConfig.getValue().function().isPresent()) {
String functionName = runtimeConfig.getValue().function().get();
boolean found = false;
for (GoogleCloudFunctionInfo info : cloudFunctions) {
if (functionName.equals(info.getBeanName())) {
delegates.put(info.getFunctionType(), info.getClassName());
found = true;
}
}
if (!found) {
throw new RuntimeException(
"No function named " + functionName + ", did you forget to annotate your function with @Named ?");
}
} else {
for (GoogleCloudFunctionInfo info : cloudFunctions) {
if (delegates.containsKey(info.getFunctionType())) {
throw new RuntimeException(
"Multiple functions found, please use 'quarkus.google-cloud-functions.function' to select one");
}
delegates.put(info.getFunctionType(), info.getClassName());
}
}
QuarkusHttpFunction.setDelegate(delegates.get(GoogleCloudFunctionInfo.FunctionType.HTTP));
QuarkusBackgroundFunction.setDelegates(delegates.get(GoogleCloudFunctionInfo.FunctionType.BACKGROUND),
delegates.get(GoogleCloudFunctionInfo.FunctionType.RAW_BACKGROUND));
QuarkusCloudEventsFunction.setDelegate(delegates.get(GoogleCloudFunctionInfo.FunctionType.CLOUD_EVENT));
shutdownContext.addShutdownTask(new Runnable() {
@OverrideView on GitHub (pinned to e1c734241f)
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.
Example fix
// before (application.properties)
quarkus.google-cloud-functions.function=myFn
// class: public class Functions (no @Named)
// after
@Named("myFn")
public class Functions { /* ... */ } Defensive patterns
Strategy: validation
Validate before calling
// verify configured name matches a @Named function
class F { public static void main(String[] a) {
String configured = "myFunction";
// scan sources for @Named(configured) before deploy
} }
// simpler: grep -r "@Named(\"$QUARKUS_GCF_FUNCTION\")" src/main/java Prevention
- 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
When it happens
Trigger: 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()).
Common situations: 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.
Related errors
- quarkus.funqy.export does not match a function: ${export}
- There are no functions to process lambda
- Too many functions. You need to set quarkus.funqy.export
- Multiple functions found, please use 'quarkus.google-cloud-f
- We didn't found any BackgroundFunction or RawBackgroundFunct
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/e6b1ec76c831148c.
Report an issue: GitHub.