{"record":{"id":"7db62c528767e6c3","repo":"apache/pulsar","slug":"unrecognized-runtime","errorCode":null,"errorMessage":"Unrecognized runtime: ","messagePattern":"Unrecognized runtime: ","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionCommon.java","lineNumber":168,"sourceCode":"            } else {\n                return java.util.function.Function.class;\n            }\n        } else {\n            if (userClass.asErasure().isAssignableTo(Function.class)) {\n                return Function.class;\n            } else {\n                return java.util.function.Function.class;\n            }\n        }\n    }\n\n    public static Runtime convertRuntime(FunctionConfig.Runtime runtime) {\n        for (Runtime type : Runtime.values()) {\n            if (type.name().equals(runtime.name())) {\n                return type;\n            }\n        }\n        throw new RuntimeException(\"Unrecognized runtime: \" + runtime.name());\n    }\n\n    public static FunctionConfig.Runtime convertRuntime(Runtime runtime) {\n        for (FunctionConfig.Runtime type : FunctionConfig.Runtime.values()) {\n            if (type.name().equals(runtime.name())) {\n                return type;\n            }\n        }\n        throw new RuntimeException(\"Unrecognized runtime: \" + runtime.name());\n    }\n\n    public static ProcessingGuarantees convertProcessingGuarantee(\n            FunctionConfig.ProcessingGuarantees processingGuarantees) {\n        for (ProcessingGuarantees type :\n                ProcessingGuarantees\n                .values()) {\n            if (type.name().equals(processingGuarantees.name())) {\n                return type;","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionCommon.java#L150-L186","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\n\"runtime\": \"GOYAML\" // unrecognized\n// after\n\"runtime\": \"GO\" // supported in the deployed Pulsar version","handlingStrategy":"validation","validationCode":"// Check the runtime name is supported before submission\nSet<String> supported = Arrays.stream(FunctionCommon.Runtime.values())\n    .map(Enum::name).collect(Collectors.toSet());\nif (!supported.contains(config.getRuntime().name()))\n    throw new IllegalArgumentException(\"Runtime \" + config.getRuntime() + \" not supported by this broker version\");","typeGuard":"boolean isSupportedRuntime(FunctionConfig.Runtime r) {\n    return r == FunctionConfig.Runtime.JAVA\n        || r == FunctionConfig.Runtime.PYTHON\n        || r == FunctionConfig.Runtime.GO;\n}","tryCatchPattern":"try {\n    Runtime rt = FunctionCommon.convertRuntime(config.getRuntime());\n} catch (RuntimeException e) {\n    log.error(\"Config runtime not recognized by this worker build: \" + config.getRuntime(), e);\n    throw new IllegalArgumentException(\"Unsupported runtime; upgrade broker or use JAVA/PYTHON/GO\", e);\n}","preventionTips":["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"],"tags":["enum","runtime","mapping","version-compatibility"],"backgroundTag":"unsupported-enum-value","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"}