apache/pulsar · error · RuntimeException

Unsupported Runtime %s

Error message

Unsupported Runtime %s

What it means

KubernetesRuntimeFactory.createContainer switches on the function's runtime type (JAVA, PYTHON, GO) to select the instance file to mount. Any runtime value other than these is unsupported on Kubernetes and produces a RuntimeException 'Unsupported Runtime <type>'.

Source

Thrown at pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/kubernetes/KubernetesRuntimeFactory.java:286

    @Override
    public KubernetesRuntime createContainer(InstanceConfig instanceConfig, String codePkgUrl,
                                             String originalCodeFileName,
                                             String transformFunctionPkgUrl,
                                             String originalTransformFunctionFileName,
                                             Long expectedHealthCheckInterval) throws Exception {
        String instanceFile = null;
        switch (instanceConfig.getFunctionDetails().getRuntime()) {
            case JAVA:
                instanceFile = javaInstanceJarFile;
                break;
            case PYTHON:
                instanceFile = pythonInstanceFile;
                break;
            case GO:
                break;
            default:
                throw new RuntimeException("Unsupported Runtime " + instanceConfig.getFunctionDetails().getRuntime());
        }

        // adjust the auth config to support auth
        if (authenticationEnabled) {
            authProvider.ifPresent(kubernetesFunctionAuthProvider ->
                    kubernetesFunctionAuthProvider.configureAuthenticationConfig(authConfig,
                            Optional.ofNullable(getFunctionAuthData(
                                    Optional.ofNullable(instanceConfig.getFunctionAuthenticationSpec())))));

        }

        Optional<KubernetesManifestCustomizer> manifestCustomizer = getRuntimeCustomizer();
        String overriddenNamespace = manifestCustomizer
                .map((customizer) -> customizer.customizeNamespace(instanceConfig.getFunctionDetails(), jobNamespace))
                .orElse(jobNamespace);
        String overriddenName = manifestCustomizer
                .map((customizer) -> customizer.customizeName(instanceConfig.getFunctionDetails(), jobName))
                .orElse(jobName);

View on GitHub (pinned to 820761864e)

Solutions

  1. Use a supported runtime: JAVA, PYTHON, or GO when submitting the function.
  2. Upgrade the functions worker to a Pulsar version that recognizes the runtime value submitted by the client.
  3. Re-submit the function via the admin API, explicitly specifying the correct --runtime flag.
  4. Inspect FunctionDetails of the failing function (pulsar-admin functions get) to confirm the runtime field value.

Example fix

// before
pulsar-admin functions create --runtime UNKNOWN ...
// after
pulsar-admin functions create --runtime JAVA ...
Defensive patterns

Strategy: validation

Validate before calling

FunctionDetails.Runtime rt = details.getRuntime();
if (rt != FunctionDetails.Runtime.JAVA && rt != FunctionDetails.Runtime.PYTHON && rt != FunctionDetails.Runtime.GO) {
    throw new IllegalArgumentException("Unsupported runtime for Kubernetes: " + rt);
}

Type guard

boolean isSupportedRuntime(FunctionDetails d) {
  switch (d.getRuntime()) { case JAVA: case PYTHON: case GO: return true; default: return false; }
}

Try / catch

try { submitFunction(details); } catch (RuntimeException e) { if (e.getMessage().startsWith("Unsupported Runtime")) { /* re-submit with JAVA/PYTHON/GO */ } throw e; }

Prevention

When it happens

Trigger: Submitting a FunctionDetails whose runtime (FunctionDetails.Runtime enum from the protobuf) resolves to an unhandled value in createContainer's switch — e.g. a proto runtime value added in a newer Pulsar version being processed by an older worker, or a corrupted/unset runtime field.

Common situations: Worker running an older Pulsar version than the client that submitted the function (new runtime enum value); manually crafted FunctionDetails via admin API with wrong runtime; submitter misusing the --runtime flag on a tool building function configs.

Related errors


AI-assisted analysis of apache/pulsar@820761864e (2026-09-06). Data as JSON: /api/errors/007585cbd2a218cf. Report an issue: GitHub.