alibaba/spring-ai-alibaba · error · BizException
MISSING_PARAMS
MISSING_PARAMS
Error message
account
What it means
AccountController.createAccount throws BizException(MISSING_PARAMS, "account") when the @RequestBody Account is null. With Spring's @RequestBody a missing body normally yields 400 before the handler, so this guard mainly catches programmatic/internal calls or proxies that invoke the method with a null account. It names the missing parameter in the error.
Source
Thrown at spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/builder/controller/AccountController.java:70
public class AccountController {
/** Service for handling account-related business logic */
private final AccountService accountService;
public AccountController(AccountService accountService) {
this.accountService = accountService;
}
/**
* Creates a new user account
* @param account Account information including username and password
* @return Account ID of the created account
*/
@PostMapping()
public Result<String> createAccount(@RequestBody Account account) {
RequestContext context = RequestContextHolder.getRequestContext();
if (Objects.isNull(account)) {
throw new BizException(ErrorCode.MISSING_PARAMS.toError("account"));
}
if (StringUtils.isBlank(account.getUsername())) {
throw new BizException(ErrorCode.MISSING_PARAMS.toError("username"));
}
if (StringUtils.isBlank(account.getPassword())) {
throw new BizException(ErrorCode.MISSING_PARAMS.toError("password"));
}
String accountId = accountService.createAccount(account);
return Result.success(context.getRequestId(), accountId);
}
/**
* Updates an existing account's information
* @param accountId ID of the account to update
* @param account Updated account informationView on GitHub (pinned to f82da0b50f)
Solutions
- Send a JSON Account object as the request body with Content-Type: application/json.
- Verify the HTTP method is POST on the collection route and the body is not empty.
- Client-side, construct a non-null Account with at least username and password before calling.
- In tests, pass a populated Account instance rather than null.
Example fix
// before
null // empty request body
// after
{"username": "alice", "password": "s3cret"} Defensive patterns
Strategy: validation
Validate before calling
if (account == null) throw new IllegalArgumentException("account body is required"); Type guard
boolean hasAccount(Account a) { return a != null; } Try / catch
try {
id = accountApi.createAccount(account);
} catch (BizException e) {
if ("MISSING_PARAMS".equals(e.getCode()) && "account".equals(e.getMessage())) {
// send a populated Account body and retry once
}
} Prevention
- Always send a JSON body with Content-Type: application/json on POST /accounts.
- Build the Account object client-side and assert non-null before the call.
- Check proxies/gateways aren't dropping empty request bodies.
When it happens
Trigger: Invoking createAccount with a null Account object (internal call, test, or a deserialization path that produced null).
Common situations: Tests calling the controller method directly with null; gateway/proxy stripping the request body; content-type mismatches causing the body not to bind.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
AI-assisted analysis of alibaba/spring-ai-alibaba@f82da0b50f (2026-09-09).
Data as JSON: /api/errors/262df0697c06d7e2.
Report an issue: GitHub.