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() {
            @Override

View on GitHub (pinned to e1c734241f)

Solutions

  1. Set quarkus.google-cloud-functions.function to the exact bean name of the function class.
  2. Annotate the function class with @Named("your-name") so it matches the configured value.
  3. 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

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


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