{"record":{"id":"1b8edc1a56e268a9","repo":"alibaba/spring-ai-alibaba","slug":"missing-params","errorCode":"MISSING_PARAMS","errorMessage":"MISSING_PARAMS: request","messagePattern":"MISSING_PARAMS: request","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/base/service/impl/WorkflowServiceImpl.java","lineNumber":228,"sourceCode":"\t\telse if (err instanceof TimeoutException) {\n\t\t\terror = ErrorCode.WORKFLOW_EXECUTION_TIMEOUT.toError();\n\t\t}\n\t\telse {\n\t\t\terror = ErrorCode.WORKFLOW_EXECUTE_ERROR.toError(err.getMessage());\n\t\t}\n\t\tresponse.setError(error);\n\t\tLogUtils.monitor(context, \"WorkflowService\", \"handleThrowable\", context.getStartTime(), error.getCode(), null,\n\t\t\t\tresponse, err);\n\t\treturn Mono.just(response);\n\t}\n\n\tprivate void checkAndInitContext(WorkflowContext workflowContext, WorkflowRequest request) {\n\t\tLong start = System.currentTimeMillis();\n\t\tRequestContext context = RequestContextHolder.getRequestContext();\n\t\ttry {\n\t\t\t// check input params\n\t\t\tif (Objects.isNull(request)) {\n\t\t\t\tthrow new BizException(ErrorCode.MISSING_PARAMS.toError(\"request\"));\n\t\t\t}\n\n\t\t\tString uid = context.getAccountId();\n\t\t\tif (Objects.isNull(uid)) {\n\t\t\t\tthrow new BizException(ErrorCode.UNAUTHORIZED.toError());\n\t\t\t}\n\n\t\t\tString appId = request.getAppId();\n\t\t\tif (StringUtils.isBlank(appId)) {\n\t\t\t\tthrow new BizException(ErrorCode.MISSING_PARAMS.toError(\"appId\"));\n\t\t\t}\n\n\t\t\t// if (CollectionUtils.isEmpty(request.getMessages())) {\n\t\t\t// throw new BizException(ErrorCode.MISSING_PARAMS.toError(\"messages\"));\n\t\t\t// }\n\n\t\t\tif (Objects.isNull(context.getWorkspaceId())) {\n\t\t\t\tthrow new BizException(ErrorCode.MISSING_PARAMS.toError(\"workspace_id\"));","sourceCodeStart":210,"sourceCodeEnd":246,"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/base/service/impl/WorkflowServiceImpl.java#L210-L246","documentation":"MISSING_PARAMS with parameter 'request' is thrown by WorkflowServiceImpl.checkAndInitContext (invoked from streamCall) when the WorkflowRequest argument itself is null. It is the first guard in workflow stream initialization, before authentication and appId checks.","triggerScenarios":"Calling WorkflowService.streamCall(null, ...) or passing a null request body from a controller/endpooint that did not deserialize the payload.","commonSituations":"HTTP client POSTing an empty body; content-type mismatch so the request body binds to null; internal callers forgetting to build the WorkflowRequest object.","solutions":["Always construct and pass a non-null WorkflowRequest to streamCall.","Check the HTTP caller is sending a valid JSON body with correct Content-Type.","Catch BizException with code MISSING_PARAMS in the controller and return 400 with the parameter name.","Add client-side null/emptiness checks before invoking streamCall."],"exampleFix":"// before\nworkflowService.streamCall(context, null); // MISSING_PARAMS: request\n// after\nWorkflowRequest request = WorkflowRequest.builder().appId(appId).build();\nworkflowService.streamCall(context, request);","handlingStrategy":"validation","validationCode":"Objects.requireNonNull(request, \"WorkflowRequest must not be null\");","typeGuard":"if (request == null) { return badRequest(\"request body is required\"); }","tryCatchPattern":"try { workflowService.streamCall(ctx, request); } catch (BizException e) { if (\"MISSING_PARAMS\".equals(e.getCode())) { /* return 400 with e.getMessage() */ } }","preventionTips":["Send a JSON body with correct Content-Type on workflow calls","Reject empty bodies at the controller layer","Never call streamCall with a literal null in code","Add integration tests covering missing-body requests"],"tags":["validation","null-argument","workflow","admin-server"],"backgroundTag":"null-argument","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"}