quarkusio/quarkus · error · IllegalStateException
Either function, assistantFunction or runtimeValue must be…
Error message
Either function, assistantFunction or runtimeValue must be provided
What it means
Thrown by BuildTimeActionBuildItem.ActionBuilder.build when an action is registered with neither a function, an assistantFunction, nor a runtimeValue. Every build-time action must be backed by exactly one implementation — an in-deployment BiFunction, an AI-assistant function, or a recorded runtime value invoked via a recorder — so a contribution providing none of them is rejected at build time as incomplete.
Solutions
- Add one of .runtime(...), .function(...), or .assistantFunction(...) before build()
- If the action is intentionally empty, remove it instead of building it
Example fix
// before
BuildTimeActionBuildItem item = new BuildTimeActionBuildItem("ext")
.methodName("getInfo")
.build();
// after
BuildTimeActionBuildItem item = new BuildTimeActionBuildItem("ext")
.methodName("getInfo")
.function(map -> Map.of("version", "1.0"))
.build(); Defensive patterns
Strategy: validation
Validate before calling
boolean hasImpl = function != null || assistantFunction != null || runtimeValue != null;
if (!hasImpl) { throw new IllegalArgumentException("Provide function, assistantFunction or runtimeValue"); } Try / catch
try {
item = actionBuilder.build();
} catch (IllegalStateException e) {
if (e.getMessage().contains("must be provided")) { /* attach an implementation */ }
else throw e;
} Prevention
- Never leave an implementation setter commented out in committed code
- Each ActionBuilder must end with exactly one implementation call
When it happens
Trigger: Building an ActionBuilder with only methodName/description set and no implementation setter called.
Common situations: Commenting out the implementation line during debugging and forgetting to restore it.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- Either function or runtimeValue must be provided
- methodName must be provided
- Only one of runtimeValue, function or assistantFunction is…
- FileName is mandatory, for example 'index.html'
- Invalid build time data key, can not be empty
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/aeed1125d08029c6.
Report an issue: GitHub.
Appendix: source
Thrown at extensions/devui/deployment-spi/src/main/java/io/quarkus/devui/spi/buildtime/BuildTimeActionBuildItem.java:209
if (parameters.isEmpty())
parameters = null;
if (function != null) {
return addAction(
new DeploymentJsonRpcMethod(methodName, description, parameters, autoUsage(usage, description),
mcpEnabledByDefault,
function));
} else if (runtimeValue != null) {
return addAction(
new RecordedJsonRpcMethod(methodName, description, autoUsage(usage, description),
mcpEnabledByDefault,
runtimeValue));
} else if (assistantFunction != null) {
return addAction(
new DeploymentJsonRpcMethod(methodName, description, parameters, autoUsage(usage, description),
mcpEnabledByDefault,
assistantFunction));
} else {
throw new IllegalStateException("Either function, assistantFunction or runtimeValue must be provided");
}
}
}
public final class SubscriptionBuilder {
private String methodName;
private String description;
private Map<String, AbstractJsonRpcMethod.Parameter> parameters = new LinkedHashMap<>();;
private EnumSet<Usage> usage;
private boolean mcpEnabledByDefault = false;
private Function<Map<String, String>, ?> function;
private RuntimeValue<?> runtimeValue;
public SubscriptionBuilder methodName(String methodName) {
this.methodName = methodName;
return this;
}
View on GitHub (pinned to e1c734241f)