paascloud/paascloud-master · error · UacBizException
UAC10011004
UAC10011004
Error message
找不到用户,email=%s
What it means
UAC10011004 is thrown by the activation flow after the token resolves to an email: the code builds a UacUser with that email and runs uacUserMapper.selectOne; if no row matches, the email has no user record and activation cannot set status=ENABLE. Logged as '找不到用户信息. email=...'.
Solutions
- Check SELECT * FROM uac_user WHERE email = '<email from redis key>'; re-register if the row is gone.
- Ensure user registration commits the row before sending/activating the email (verify transaction boundaries in the register flow).
- Normalize email case/trim before both insert and lookup so Redis and DB values match exactly.
- Align DB and Redis lifecycles in test environments — clear both together.
Example fix
// before
UacUser q = new UacUser(); q.setEmail(email);
UacUser uacUser = uacUserMapper.selectOne(q); // may be null -> UAC10011004
// after (defensive in caller)
if (uacUserService.countByEmail(email.trim().toLowerCase()) == 0) {
throw new BizException("no user for email " + email + ", please re-register");
} Defensive patterns
Strategy: validation
Validate before calling
UacUser q = new UacUser();
q.setEmail(email.trim().toLowerCase());
if (uacUserMapper.selectCount(q) == 0) {
throw new BizException("no user for email " + email + ", please re-register");
} Try / catch
try {
uacUserService.activeUser(token);
} catch (UacBizException e) {
if ("UAC10011004".equals(e.getCode())) { return Result.fail(404, "no account for this email; register again"); }
throw e;
} Prevention
- Normalize email case/trim on insert and on every lookup.
- Commit the user row before sending the activation email.
- Do not purge unactivated users while their activation links are still valid.
- Keep test-environment DB and Redis in sync (clear both together).
When it happens
Trigger: Activation token valid in Redis but the user row was deleted (or never committed) between registration and activation; email stored in Redis differs from the email persisted for the user (case mismatch or registration retry overwrote it); multi-environment mismatch where Redis has the token but the DB has no such user.
Common situations: Cleanup job removing unactivated accounts while the activation email is still valid; manually wiping DB data in test environments while Redis keys remain; registering twice with different emails and activating the old link.
Understand the failure class
Background: "User not found", "Invalid user", and "does not exist": what missing-user lookup errors mean across Rocket.Chat, LiteLLM, Phabricator, rustfs, and pnpm — this error's family across 10 libraries.
Related errors
AI-assisted analysis of paascloud/paascloud-master@781281a950 (2026-09-10).
Data as JSON: /api/errors/3df87e87b5140133.
Report an issue: GitHub.
Appendix: source
Thrown at paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacUserServiceImpl.java:768
@Override
public void activeUser(String activeUserToken) {
Preconditions.checkArgument(!StringUtils.isEmpty(activeUserToken), "激活用户失败");
String activeUserKey = RedisKeyUtil.getActiveUserKey(activeUserToken);
String email = redisService.getKey(activeUserKey);
if (StringUtils.isEmpty(email)) {
throw new UacBizException(ErrorCodeEnum.UAC10011030);
}
// 修改用户状态, 绑定访客角色
UacUser uacUser = new UacUser();
uacUser.setEmail(email);
uacUser = uacUserMapper.selectOne(uacUser);
if (uacUser == null) {
logger.error("找不到用户信息. email={}", email);
throw new UacBizException(ErrorCodeEnum.UAC10011004, email);
}
UacUser update = new UacUser();
update.setId(uacUser.getId());
update.setStatus(UacUserStatusEnum.ENABLE.getKey());
LoginAuthDto loginAuthDto = new LoginAuthDto();
loginAuthDto.setUserId(uacUser.getId());
loginAuthDto.setUserName(uacUser.getLoginName());
loginAuthDto.setLoginName(uacUser.getLoginName());
update.setUpdateInfo(loginAuthDto);
UacUser user = this.queryByUserId(uacUser.getId());
Map<String, Object> param = Maps.newHashMap();
param.put("loginName", user.getLoginName());
param.put("dateTime", DateUtil.formatDateTime(new Date()));
Set<String> to = Sets.newHashSet();View on GitHub (pinned to 781281a950)