paascloud/paascloud-master · error · UacBizException
UAC10011037
UAC10011037
Error message
修改用户失败,userId=%s
What it means
UAC10011037 (message '修改用户失败,userId=%s' — failed to modify user) is thrown after updateUser(uacUser) returns fewer than 1 affected rows during the email-binding/update flow. The user row targeted by loginAuthDto.getUserId() was not updated — typically because it does not exist or was concurrently deleted.
Solutions
- Verify the userId in LoginAuthDto exists in uac_user before the update
- Re-authenticate/refresh the LoginAuthDto if the session may be stale
- Check for concurrent deletion or user-id mismatch between services and fix the data
- Catch UacBizException code UAC10011037 and surface 'update failed, please re-login'
Example fix
// before
loginAuthDto.setUserId(userIdMaybeStale);
uacUserService.modifyEmail(loginAuthDto, email);
// after
if (uacUserService.queryByUserId(loginAuthDto.getUserId()) != null) {
uacUserService.modifyEmail(loginAuthDto, email);
} Defensive patterns
Strategy: validation
Validate before calling
if (uacUserService.queryByUserId(loginAuthDto.getUserId()) == null) {
throw new IllegalStateException("user no longer exists, please re-login");
} Try / catch
try { uacUserService.modifyEmail(loginAuthDto, email); } catch (UacBizException e) { if ("UAC10011037".equals(e.getCode())) { /* force re-login / refresh session */ } } Prevention
- Refresh LoginAuthDto from the DB before write operations
- Watch for cross-service user-id desync; reconcile regularly
- Treat 0-row updates as explicit errors rather than silent success
When it happens
Trigger: Calling the email-update method (modifyEmail flow) with a LoginAuthDto whose userId has no matching row, so updateUser's UPDATE affects 0 rows.
Common situations: Stale session/token referencing a deleted user; userId mismatch between auth service and UAC DB; transaction rollback leaving expected row absent; data sync issues between services in the microservice deployment.
Related errors
AI-assisted analysis of paascloud/paascloud-master@781281a950 (2026-09-10).
Data as JSON: /api/errors/e0d76a974903c413.
Report an issue: GitHub.
Appendix: source
Thrown at paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacUserServiceImpl.java:645
return uacUserMapper.updateByPrimaryKeySelective(uacUser);
}
@Override
public void modifyUserEmail(String email, String emailCode, LoginAuthDto loginAuthDto) {
// 校验用户信息
Preconditions.checkArgument(!StringUtils.isEmpty(email), ErrorCodeEnum.UAC10011018.msg());
Preconditions.checkArgument(PubUtils.isEmail(email), "邮箱格式不正确");
UacUser uacUser = new UacUser();
uacUser.setId(loginAuthDto.getUserId());
uacUser.setEmail(email);
uacUser.setUpdateInfo(loginAuthDto);
int result = this.updateUser(uacUser);
if (result < 1) {
throw new UacBizException(ErrorCodeEnum.UAC10011037, loginAuthDto.getUserId());
}
}
@Override
public void resetLoginPwd(Long userId, LoginAuthDto loginAuthDto) {
if (userId == null) {
throw new UacBizException(ErrorCodeEnum.UAC10011001);
}
UacUser uacUser = this.queryByUserId(userId);
if (uacUser == null) {
logger.error("找不到用户. userId={}", userId);
throw new UacBizException(ErrorCodeEnum.UAC10011003, userId);
}
Preconditions.checkArgument(!StringUtils.isEmpty(uacUser.getEmail()), "邮箱地址不能为空");
String newLoginPwd = RandomUtil.createComplexCode(8);
UacUser update = new UacUser();View on GitHub (pinned to 781281a950)