{"record":{"id":"497a511f775a1e8e","repo":"alibaba/spring-ai-alibaba","slug":"chatclient-successfully-returned-but-the-returned-497a51","errorCode":null,"errorMessage":"ChatClient successfully returned, but the returned data is invalid.","messagePattern":"ChatClient successfully returned, but the returned data is invalid\\.","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/ParameterParsingNode.java","lineNumber":208,"sourceCode":"\t\t\t\t.getOutput()\n\t\t\t\t.getText();\n\t\t\t// Remove Markdown markers\n\t\t\tif (rawJson != null) {\n\t\t\t\trawJson = rawJson.replace(\"```json\", \"\").replace(\"```\", \"\").trim();\n\t\t\t}\n\n\t\t\tMap<String, Object> result = new HashMap<>();\n\t\t\tResponse responseJson;\n\t\t\ttry {\n\t\t\t\tresponseJson = OBJECT_MAPPER.readValue(rawJson, Response.class);\n\t\t\t}\n\t\t\tcatch (JsonProcessingException e) {\n\t\t\t\tthrow new RuntimeException(\"ChatClient successfully returned, but the returned json is invalid.\");\n\t\t\t}\n\n\t\t\tif (responseJson.isSuccess()) {\n\t\t\t\tif (responseJson.data() == null) {\n\t\t\t\t\tthrow new RuntimeException(\"ChatClient successfully returned, but the returned data is invalid.\");\n\t\t\t\t}\n\t\t\t\tresult.put(successKey, true);\n\t\t\t\tresult.put(dataKey, responseJson.data());\n\t\t\t\tresult.put(reasonKey, \"success\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tresult.put(successKey, false);\n\t\t\t\tresult.put(reasonKey, Optional.ofNullable(responseJson.reason()).orElse(\"reason is empty\"));\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\treturn Map.of(successKey, false, reasonKey, e.getMessage());\n\t\t}\n\t}\n\n\tpublic record Param(String name, String type, String description) {","sourceCodeStart":190,"sourceCodeEnd":226,"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/ParameterParsingNode.java#L190-L226","documentation":"After ParameterParsingNode successfully parses the LLM JSON into a Response record, if isSuccess() is true but the data field is null it throws RuntimeException('ChatClient successfully returned, but the returned data is invalid.'). The model claimed success (success=true) but provided no extracted data payload, which the node treats as an inconsistent/invalid response.","triggerScenarios":"The LLM returns {\"success\": true} (or omits data) without a populated data field, so responseJson.isSuccess() is true while responseJson.data() is null.","commonSituations":"Prompt schema example mismatch so the model fills success but leaves data empty; parameters list empty or unextractable from the input text; model returning null data for edge-case inputs.","solutions":["Inspect the raw LLM output to confirm data was truly absent","Improve the instruction with explicit examples showing a populated data field on success","Validate inputText contains extractable content for the declared parameters","Retry the call or treat success-without-data as failure in downstream handling"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { out = node.apply(state); } catch (RuntimeException e) { if (e.getMessage().contains(\"returned data is invalid\")) { log.warn(\"LLM reported success without data\"); retryOrFallback(); } }","preventionTips":["Show explicit success examples with a filled data field in the instruction","Ensure the declared parameter list matches what the text can contain","Treat success-without-data as a retryable LLM response in your workflow"],"tags":["llm-output","schema","inconsistent-response"],"backgroundTag":"unexpected-api-response-shape","analyzedSha":"f82da0b50f35744c13968191be2b1cd2452ef550","analyzedAt":"2026-09-09T15:32:42.421Z","contentChangedAt":"2026-09-09T15:32:42.421Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}