{"record":{"id":"5ba3a235df22853e","repo":"alibaba/spring-ai-alibaba","slug":"workflow-execute-error-5ba3a2","errorCode":"WORKFLOW_EXECUTE_ERROR","errorMessage":"Failed to process local image: ${e.getMessage()}","messagePattern":"Failed to process local image: (.+?)","errorType":"error_code","errorClass":"BizException","httpStatus":null,"severity":"error","filePath":"spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/workflow/processor/impl/LLMExecuteProcessor.java","lineNumber":346,"sourceCode":"\t\tFile file = (File) value;\n\t\tString url = file.getUrl();\n\t\tString mimeType = file.getMimeType();\n\t\tif (StringUtils.isNotBlank(url)) {\n\t\t\tString source = file.getSource() == null ? File.SourceEnum.localFile.name() : file.getSource();\n\t\t\ttry {\n\t\t\t\tif (File.SourceEnum.localFile.name().equals(source)) {\n\t\t\t\t\tString storagePath = studioProperties.getStoragePath();\n\t\t\t\t\treturn new Media(MimeType.valueOf(mimeType),\n\t\t\t\t\t\t\tnew FileUrlResource(storagePath + java.io.File.separator + url));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tMediaType mediaType = fileManager.getMediaTypeFromUrl(url);\n\t\t\t\t\treturn Media.builder().mimeType(MimeType.valueOf(mediaType.toString())).data(new URL(url)).build();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tlog.error(\"Error processing local image: {}\", url, e);\n\t\t\t\tthrow new BizException(\n\t\t\t\t\t\tErrorCode.WORKFLOW_EXECUTE_ERROR.toError(\"Failed to process local image: \" + e.getMessage()));\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\t/**\n\t * Checks the node parameters for validity\n\t * @param graph The workflow graph\n\t * @param node The node to check\n\t * @return Result of the parameter check\n\t */\n\t@Override\n\tpublic CheckNodeParamResult checkNodeParam(DirectedAcyclicGraph<String, Edge> graph, Node node) {\n\t\tCheckNodeParamResult result = super.checkNodeParam(graph, node);\n\t\tNodeParam nodeParam = JsonUtils.fromMap(node.getConfig().getNodeParam(), NodeParam.class);\n\t\tModelConfig modelConfig = nodeParam.getModelConfig();\n\t\tif (modelConfig == null || StringUtils.isBlank(modelConfig.getModelId())) {","sourceCodeStart":328,"sourceCodeEnd":364,"githubUrl":"https://github.com/alibaba/spring-ai-alibaba/blob/f82da0b50f35744c13968191be2b1cd2452ef550/spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/workflow/processor/impl/LLMExecuteProcessor.java#L328-L364","documentation":"Wraps any exception raised while converting a local File value into a Spring AI Media object in LLMExecuteProcessor.constructMedia. After a non-blank URL is resolved, building Media (URL parsing, media-type lookup via fileManager) can fail; the original exception is logged and rethrown as WORKFLOW_EXECUTE_ERROR.","triggerScenarios":"The File value has a non-blank url that is malformed (new URL(url) throws MalformedURLException), or fileManager.getMediaTypeFromUrl(url) cannot determine/throws on the media type.","commonSituations":"Storing a URL with spaces or invalid characters in a file variable; pointing at a scheme the media-type resolver does not recognize; file records from older workflow versions with incomplete url fields; corrupted file entries after a DB migration.","solutions":["Inspect the logged 'Error processing local image' entry to see the underlying cause and the offending url.","Fix the file record's url so it is a well-formed absolute URL (proper scheme, no unencoded spaces).","Verify fileManager can resolve the media type for that url's extension/content type; store an explicit mimeType on the File.","Re-upload the file through the platform's file manager so a valid url and mimeType are generated."],"exampleFix":"// before\nfile.setUrl(\"http://example.com/my image.png\"); // unencoded space\n// after\nfile.setUrl(\"http://example.com/my%20image.png\");\nfile.setMimeType(\"image/png\");","handlingStrategy":"validation","validationCode":"try { new java.net.URL(file.getUrl()); } catch (MalformedURLException e) { throw new IllegalArgumentException(\"invalid file url: \" + file.getUrl()); }\nif (file.getMimeType() == null) { /* resolve mimeType up front */ }","typeGuard":null,"tryCatchPattern":"try {\n    processor.invoke(node, params);\n} catch (BizException e) {\n    if (\"WORKFLOW_EXECUTE_ERROR\".equals(e.getCode())) { log.error(\"media build failed\", e); }\n}","preventionTips":["Validate URL format (scheme, no unencoded spaces) when files are uploaded or registered.","Always store an explicit mimeType on File records so getMediaTypeFromUrl never has to guess.","Re-upload files after platform/version migrations rather than trusting legacy url fields."],"tags":["workflow","url","media","llm-node"],"backgroundTag":"invalid-url","analyzedSha":"f82da0b50f35744c13968191be2b1cd2452ef550","analyzedAt":"2026-09-09T15:32:42.421Z","contentChangedAt":"2026-09-09T15:32:42.421Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}