apache/pulsar · error · RuntimeException
Unrecognized runtime:
Error message
Unrecognized runtime:
What it means
FunctionCommon.convertRuntime(FunctionConfig.Runtime) maps the functions-config runtime enum to the internal Runtime enum by matching enum constant names. If the config's runtime name matches no internal Runtime constant, this RuntimeException naming the runtime is thrown. In practice both enums are normally aligned, so this fires mainly when they drift apart across versions.
Source
Thrown at pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionCommon.java:168
} else {
return java.util.function.Function.class;
}
} else {
if (userClass.asErasure().isAssignableTo(Function.class)) {
return Function.class;
} else {
return java.util.function.Function.class;
}
}
}
public static Runtime convertRuntime(FunctionConfig.Runtime runtime) {
for (Runtime type : Runtime.values()) {
if (type.name().equals(runtime.name())) {
return type;
}
}
throw new RuntimeException("Unrecognized runtime: " + runtime.name());
}
public static FunctionConfig.Runtime convertRuntime(Runtime runtime) {
for (FunctionConfig.Runtime type : FunctionConfig.Runtime.values()) {
if (type.name().equals(runtime.name())) {
return type;
}
}
throw new RuntimeException("Unrecognized runtime: " + runtime.name());
}
public static ProcessingGuarantees convertProcessingGuarantee(
FunctionConfig.ProcessingGuarantees processingGuarantees) {
for (ProcessingGuarantees type :
ProcessingGuarantees
.values()) {
if (type.name().equals(processingGuarantees.name())) {
return type;View on GitHub (pinned to 820761864e)
Solutions
- Upgrade the broker/functions-worker so its Runtime enum supports the config's runtime value
- Resubmit the function with a supported runtime (JAVA, PYTHON, GO as available in your version)
- Regenerate the function config with a matching CLI/server version
Example fix
// before "runtime": "GOYAML" // unrecognized // after "runtime": "GO" // supported in the deployed Pulsar version
Defensive patterns
Strategy: validation
Validate before calling
// Check the runtime name is supported before submission
Set<String> supported = Arrays.stream(FunctionCommon.Runtime.values())
.map(Enum::name).collect(Collectors.toSet());
if (!supported.contains(config.getRuntime().name()))
throw new IllegalArgumentException("Runtime " + config.getRuntime() + " not supported by this broker version"); Type guard
boolean isSupportedRuntime(FunctionConfig.Runtime r) {
return r == FunctionConfig.Runtime.JAVA
|| r == FunctionConfig.Runtime.PYTHON
|| r == FunctionConfig.Runtime.GO;
} Try / catch
try {
Runtime rt = FunctionCommon.convertRuntime(config.getRuntime());
} catch (RuntimeException e) {
log.error("Config runtime not recognized by this worker build: " + config.getRuntime(), e);
throw new IllegalArgumentException("Unsupported runtime; upgrade broker or use JAVA/PYTHON/GO", e);
} Prevention
- Match the pulsar-functions CLI version to the broker version when generating configs
- Only use runtimes documented for your Pulsar release (JAVA, PYTHON, GO)
- Check broker logs/release notes after upgrades for new runtime enum values
- Avoid hand-editing the runtime field in serialized configs
When it happens
Trigger: Calling convertRuntime with a FunctionConfig.Runtime value whose name() has no counterpart in the internal Runtime enum — e.g. JAVA/PYTHON handled but a newer runtime (GO) missing in the deployed build, or a config enum with an extra/renamed constant.
Common situations: Configs generated by a newer CLI/client (introducing a new runtime type) submitted to an older broker/worker; renamed enum constants during upgrades; hand-constructed configs with unusual runtime values.
Related errors
- Unknown producer crypto failure action
- Unknown consumer crypto failure action
- Unrecognized processing guarantee:
- Unsupported Runtime
- Unknown producer protobuf failure action
AI-assisted analysis of apache/pulsar@820761864e (2026-09-06).
Data as JSON: /api/errors/7db62c528767e6c3.
Report an issue: GitHub.