{"record":{"id":"5aebd3b383714ff6","repo":"alibaba/spring-ai-alibaba","slug":"unsupported-language-language","errorCode":null,"errorMessage":"Unsupported language: {language}","messagePattern":"Unsupported language: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"spring-boot-starters/spring-ai-alibaba-starter-builtin-nodes/src/main/java/com/alibaba/cloud/ai/graph/node/code/CodeExecutorNodeAction.java","lineNumber":84,"sourceCode":"\t\t\tCodeLanguage.PYTHON3.getValue(), CodeLanguage.PYTHON, CodeLanguage.PYTHON.getValue(), CodeLanguage.JAVA,\n\t\t\tCodeLanguage.JAVA.getValue());\n\n\tpublic CodeExecutorNodeAction(CodeExecutor codeExecutor, String codeLanguage, String code, CodeStyle style,\n\t\t\tCodeExecutionConfig config, List<CodeParam> params, String outputKey) {\n\t\tthis.codeExecutor = codeExecutor;\n\t\tthis.codeLanguage = codeLanguage;\n\t\tthis.style = style;\n\t\tthis.code = code;\n\t\tthis.codeExecutionConfig = config;\n\t\tthis.params = params;\n\t\tthis.outputKey = outputKey;\n\t}\n\n\tprivate Map<String, Object> executeWorkflowCodeTemplate(CodeLanguage language, String code,\n\t\t\tMap<String, Object> inputs) throws Exception {\n\t\tTemplateTransformer templateTransformer = CODE_TEMPLATE_TRANSFORMERS.get(language);\n\t\tif (templateTransformer == null) {\n\t\t\tthrow new RuntimeException(\"Unsupported language: \" + language);\n\t\t}\n\n\t\tRunnerAndPreload runnerAndPreload = templateTransformer.transformCaller(code, inputs, style);\n\t\tString response = executeCode(language, runnerAndPreload.preloadScript(), runnerAndPreload.runnerScript());\n\n\t\treturn templateTransformer.transformResponse(response);\n\t}\n\n\tprivate String executeCode(CodeLanguage language, String preloadScript, String code) throws Exception {\n\t\tList<CodeBlock> codeBlockList = new ArrayList<>(10);\n\t\tcodeBlockList.add(new CodeBlock(CODE_LANGUAGE_TO_RUNNING_LANGUAGE.get(language), code));\n\n\t\tCodeExecutionResult codeExecutionResult = codeExecutor.executeCodeBlocks(codeBlockList,\n\t\t\t\tthis.codeExecutionConfig);\n\t\tif (codeExecutionResult.exitCode() != 0) {\n\t\t\tthrow new RuntimeException(\"code execution failed, exit code: \" + codeExecutionResult.exitCode()\n\t\t\t\t\t+ \", logs: \" + codeExecutionResult.logs());\n\t\t}","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/alibaba/spring-ai-alibaba/blob/f82da0b50f35744c13968191be2b1cd2452ef550/spring-boot-starters/spring-ai-alibaba-starter-builtin-nodes/src/main/java/com/alibaba/cloud/ai/graph/node/code/CodeExecutorNodeAction.java#L66-L102","documentation":"CodeExecutorNodeAction.executeWorkflowCodeTemplate looks up a TemplateTransformer for the requested CodeLanguage in the CODE_TEMPLATE_TRANSFORMERS registry. If no transformer is registered for that language (meaning the executor can't prepare runner/preload scripts for it), it throws RuntimeException('Unsupported language: ' + language). The code-execution feature only supports languages present in the registry.","triggerScenarios":"Building/running CodeExecutorNodeAction with CodeLanguage value for which no template transformer was registered — e.g. a language enum value with no CODE_TEMPLATE_TRANSFORMERS mapping.","commonSituations":"Using a newly added enum constant not yet wired into the transformer map; misconfiguration of the node's language setting; copying an example with a language the current version doesn't support.","solutions":["Switch the node to a supported CodeLanguage (e.g. one known to have a registered transformer)","Check the supported-language list/registry in your library version and upgrade if a newer version adds your language","Confirm the language configured in your workflow matches the enum used by the executor"],"exampleFix":"// before\nnew CodeExecutorNodeAction(config, CodeLanguage.RUST, code, ...); // not registered\n// after\nnew CodeExecutorNodeAction(config, CodeLanguage.PYTHON, code, ...);","handlingStrategy":"validation","validationCode":"Set<CodeLanguage> supported = Set.of(CodeLanguage.PYTHON /* per registry */);\nif (!supported.contains(language)) { throw new IllegalArgumentException(\"language not supported: \" + language); }","typeGuard":"boolean isSupported(CodeLanguage l) { return l != null && registeredLanguages().contains(l); }","tryCatchPattern":"try { result = action.call(state); } catch (RuntimeException e) { if (e.getMessage().startsWith(\"Unsupported language\")) { log.error(e.getMessage()); } }","preventionTips":["Check CODE_TEMPLATE_TRANSFORMERS contents for your library version before choosing a language","Keep language settings in one config constant validated at startup","Upgrade the library if you need a language not yet registered"],"tags":["code-execution","unsupported-language"],"backgroundTag":"unsupported-enum-value","analyzedSha":"f82da0b50f35744c13968191be2b1cd2452ef550","analyzedAt":"2026-09-09T15:32:42.421Z","contentChangedAt":"2026-09-09T15:32:42.421Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}