{"record":{"id":"a65027ef9bcf69a2","repo":"apache/pulsar","slug":"unknown-runtime-runtime","errorCode":null,"errorMessage":"Unknown runtime ${runtime}","messagePattern":"Unknown runtime (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionActioner.java","lineNumber":635,"sourceCode":"        }\n        String[] hierarchy = functionDetails.getClassName().split(\"\\\\.\");\n        String fileName;\n        if (hierarchy.length <= 0) {\n            fileName = functionDetails.getClassName();\n        } else if (hierarchy.length == 1) {\n            fileName =  hierarchy[0];\n        } else {\n            fileName = hierarchy[hierarchy.length - 2];\n        }\n        switch (functionDetails.getRuntime()) {\n            case JAVA:\n                return fileName + \".jar\";\n            case PYTHON:\n                return fileName + \".py\";\n            case GO:\n                return fileName + \".go\";\n            default:\n                throw new RuntimeException(\"Unknown runtime \" + functionDetails.getRuntime());\n        }\n    }\n\n    private void setupBatchSource(FunctionDetails functionDetails) {\n        if (isBatchSource(functionDetails)) {\n\n            String intermediateTopicName = SourceConfigUtils.computeBatchSourceIntermediateTopicName(\n              functionDetails.getTenant(), functionDetails.getNamespace(), functionDetails.getName()).toString();\n\n            String intermediateTopicSubscription = SourceConfigUtils.computeBatchSourceInstanceSubscriptionName(\n              functionDetails.getTenant(), functionDetails.getNamespace(), functionDetails.getName());\n            String fqfn = FunctionCommon.getFullyQualifiedName(\n              functionDetails.getTenant(), functionDetails.getNamespace(), functionDetails.getName());\n            try {\n                Actions.newBuilder()\n                  .addAction(\n                    Actions.Action.builder()\n                      .actionName(String.format(\"Creating intermediate topic\"","sourceCodeStart":617,"sourceCodeEnd":653,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionActioner.java#L617-L653","documentation":"FunctionActioner.getDownloadFileName maps a FunctionDetails runtime to the downloaded file extension (jar/py/go). Any runtime other than JAVA, PYTHON, or GO hits the default branch and a RuntimeException 'Unknown runtime <runtime>' is thrown.","triggerScenarios":"Resolving the package file name for a function whose FunctionDetails.runtime is an unrecognized/unsupported runtime value (e.g. new runtime enum value used by a newer client against an older worker).","commonSituations":"Submitting functions built with a newer Pulsar client that supports runtimes the deployed worker doesn't know; corrupted/mis-serialized runtime field; custom runtime experiments.","solutions":["Use JAVA, PYTHON, or GO as the function runtime","Upgrade the Pulsar functions worker to a version that supports the runtime being submitted","Inspect the submitted FunctionDetails protobuf for a corrupted runtime value"],"exampleFix":"// before\nFunctionDetails.newBuilder().setRuntime(FunctionDetails.Runtime.UNKNOWN)\n// after\nFunctionDetails.newBuilder().setRuntime(FunctionDetails.Runtime.JAVA)","handlingStrategy":"validation","validationCode":"int rt = functionDetails.getRuntime();\nif (rt != FunctionDetails.Runtime.JAVA_VALUE\n    && rt != FunctionDetails.Runtime.PYTHON_VALUE\n    && rt != FunctionDetails.Runtime.GO_VALUE) {\n    throw new IllegalArgumentException(\"unsupported runtime: \" + rt);\n}","typeGuard":"boolean isSupportedRuntime(FunctionDetails fd) {\n    switch (fd.getRuntime()) {\n        case JAVA: case PYTHON: case GO: return true;\n        default: return false;\n    }\n}","tryCatchPattern":"try {\n    functionActioner.startFunction(...);\n} catch (RuntimeException e) {\n    if (e.getMessage().startsWith(\"Unknown runtime\")) {\n        // resubmit with JAVA/PYTHON/GO or upgrade the worker\n    } else { throw e; }\n}","preventionTips":["Only submit functions with runtimes your worker version supports","Keep client and worker Pulsar versions aligned","Never hand-edit FunctionDetails protobuf values"],"tags":["pulsar-functions","worker","runtime","unsupported"],"backgroundTag":"unsupported-runtime","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}