quarkusio/quarkus · error · IOException

We didn't found any CloudEventsFunction to run (or there is

Error message

We didn't found any CloudEventsFunction to run (or there is multiple one and none selected inside your application.properties)

What it means

QuarkusCloudEventsFunction.accept throws this when the Quarkus app started but no CloudEventsFunction delegate bean was wired. The delegate is selected at deployment from the CDI beans implementing CloudEventsFunction; it is null when none exist or when several exist and no explicit selection was made.

Source

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

                throw new RuntimeException(e);
            }
        }
    }

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

    @Override
    public void accept(CloudEvent cloudEvent) throws Exception {
        if (!started) {
            throw new IOException(deploymentStatus);
        }

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

        ClassLoader currentCl = Thread.currentThread().getContextClassLoader();
        try {
            Thread.currentThread().setContextClassLoader(delegateClassLoader);
            delegate.accept(cloudEvent);
        } finally {
            Thread.currentThread().setContextClassLoader(currentCl);
        }
    }
}

View on GitHub (pinned to e1c734241f)

Solutions

  1. Implement exactly one CloudEventsFunction bean in the application, or
  2. If multiple exist, set the selection property (quarkus.google-cloud-functions.ce-function=<FQCN>) in application.properties
  3. Ensure the implementing class is a discoverable CDI bean (not abstract, has a bean-defining annotation or is unremovable)

Example fix

# before (multiple impls, no selection)
# nothing set
# after
quarkus.google-cloud-functions.ce-function=com.example.MyCloudEventsFunction
Defensive patterns

Strategy: validation

Validate before calling

// build-time check: exactly one CloudEventsFunction bean, or selection set
boolean hasDelegate = Arc.container().select(CloudEventsFunction.class)
        .stream().count() >= 1;
String selected = System.getProperty("quarkus.google-cloud-functions.ce-function", "");
if (!hasDelegate || selected.isBlank()) {
    throw new IllegalStateException("No CloudEventsFunction delegate configured");
}

Try / catch

try {
    function.accept(cloudEvent);
} catch (IOException e) {
    if (e.getMessage().contains("didn't found any CloudEventsFunction")) {
        throw new IllegalStateException("Set quarkus.google-cloud-functions.ce-function in application.properties");
    }
    throw e;
}

Prevention

When it happens

Trigger: Invoking the deployed function when the application contains zero CloudEventsFunction beans, or multiple implementations without setting the selection property in application.properties.

Common situations: Developer implements HttpFunction and CloudEventsFunction ambiguities across classes, removed the implementing class, or added a second CloudEventsFunction and forgot to disambiguate.

Related errors


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