apache/pulsar · error · IllegalArgumentException
Function language runtime is either not set or cannot be det
Error message
Function language runtime is either not set or cannot be determined
What it means
validateNonJavaFunction dispatches to language-specific checks based on functionConfig.getRuntime(). This error is thrown when the runtime field is null or set to a runtime other than GO or PYTHON while the function is not a Java function (no className), so the framework cannot determine how to run it.
Source
Thrown at pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionConfigUtils.java:975
retval.addAll(functionConfig.getCustomSerdeInputs().keySet());
}
if (functionConfig.getCustomSchemaInputs() != null) {
retval.addAll(functionConfig.getCustomSchemaInputs().keySet());
}
if (functionConfig.getInputSpecs() != null) {
retval.addAll(functionConfig.getInputSpecs().keySet());
}
return retval;
}
public static void validateNonJavaFunction(FunctionConfig functionConfig) {
doCommonChecks(functionConfig);
if (functionConfig.getRuntime() == FunctionConfig.Runtime.GO) {
doGolangChecks(functionConfig);
} else if (functionConfig.getRuntime() == FunctionConfig.Runtime.PYTHON) {
doPythonChecks(functionConfig);
} else {
throw new IllegalArgumentException("Function language runtime is either not set or cannot be determined");
}
}
public static ExtractedFunctionDetails validateJavaFunction(FunctionConfig functionConfig,
ValidatableFunctionPackage validatableFunctionPackage) {
doCommonChecks(functionConfig);
return doJavaChecks(functionConfig, validatableFunctionPackage);
}
public static FunctionConfig validateUpdate(FunctionConfig existingConfig, FunctionConfig newConfig) {
FunctionConfig mergedConfig = existingConfig.toBuilder().build();
if (!existingConfig.getTenant().equals(newConfig.getTenant())) {
throw new IllegalArgumentException("Tenants differ");
}
if (!existingConfig.getNamespace().equals(newConfig.getNamespace())) {
throw new IllegalArgumentException("Namespaces differ");
}
if (!existingConfig.getName().equals(newConfig.getName())) {View on GitHub (pinned to 820761864e)
Solutions
- Set the runtime explicitly: functionConfig.setRuntime(FunctionConfig.Runtime.PYTHON) or FunctionConfig.Runtime.GO as appropriate.
- Verify the config file has a valid `runtime: ` key (GO_PYTHON style names must match the Runtime enum).
- If the function is Java, use the Java validation path and set className plus jar containing the function.
Example fix
// before
FunctionConfig config = FunctionConfig.builder().className("").build(); // runtime unset
// after
FunctionConfig config = FunctionConfig.builder()
.runtime(FunctionConfig.Runtime.PYTHON)
.py("/path/to/func.py")
.build(); Defensive patterns
Strategy: validation
Validate before calling
if (cfg.getRuntime() == null) {
throw new IllegalArgumentException("runtime must be explicitly set (GO or PYTHON) for non-Java functions");
} Type guard
boolean hasValidRuntime(FunctionConfig c) {
return c.getRuntime() == FunctionConfig.Runtime.GO || c.getRuntime() == FunctionConfig.Runtime.PYTHON;
} Try / catch
try {
FunctionConfigUtils.validateNonJavaFunction(config);
} catch (IllegalArgumentException e) {
if (e.getMessage().contains("language runtime")) {
throw new IllegalStateException("Set FunctionConfig.Runtime (PYTHON/GO) before submitting", e);
} else { throw e; }
} Prevention
- Always set runtime explicitly in builders and YAML configs.
- Use enum values, not strings, for runtime to catch typos at compile time.
- Route Java functions to the Java validation path (className + jar) instead.
When it happens
Trigger: Submitting/updating a non-Java function whose FunctionConfig has runtime == null, or runtime set to JAVA when className/jar are absent, or any value outside {GO, PYTHON} in the non-Java validation path.
Common situations: Config files created by hand that omit the `runtime: PYTHON|GO` field; programmatic builders that forget setRuntime(); tooling upgrades where the runtime enum name changed or a generic 'function' type was assumed.
Understand the failure class
Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.
Related errors
- Unsupported Runtime %s
- Log folder creation error
- Unsupported Runtime
- Thread Container only supports Java Runtime
- When effectively once processing guarantee is specified, ret
AI-assisted analysis of apache/pulsar@820761864e (2026-09-06).
Data as JSON: /api/errors/4d1d89566b100967.
Report an issue: GitHub.