paascloud/paascloud-master · error · UacBizException
UAC10011004
UAC10011004
Error message
UAC10011004
What it means
EmailServiceImpl.submitResetPwdEmail throws UacBizException(UAC10011004, email) when no UacUser record matches the given email address (uacUserService.selectOne returns null). The error means a password-reset email cannot be sent because the email is not registered to any account; the offending email is passed as a message argument.
Solutions
- Verify the email exists: SELECT * FROM uac_user WHERE email = ?
- Return a neutral message to end users (don't leak account existence) but log the email server-side
- Check for whitespace/case differences and normalize the email before lookup
- If the user registered via loginName/mobile only, allow binding an email first
Example fix
// before
uacUser = uacUserService.selectOne(uacUser);
if (uacUser == null) { throw new UacBizException(ErrorCodeEnum.UAC10011004, email); }
// after (caller-side guard)
if (userService.isEmailRegistered(email)) { emailService.submitResetPwdEmail(loginName, email); } Defensive patterns
Strategy: validation
Validate before calling
boolean emailBound = userService.countByEmail(email) > 0; // SELECT COUNT(*) FROM uac_user WHERE email = ?
if (!emailBound) { emailService.submitResetPwdEmail(loginName, email); } Try / catch
try { emailService.submitResetPwdEmail(loginName, email); } catch (UacBizException e) { if (ErrorCodeEnum.UAC10011004.getCode().equals(e.getCode())) { showGeneric("If the email exists, a reset link was sent"); } throw e; } Prevention
- Require a verified email at registration so every account has one
- Normalize (trim, lowercase) emails before lookup and storage
- Return a generic message to users to avoid account enumeration
- Check which environment's DB you are querying when testing resets
When it happens
Trigger: Calling the forgot-password / submitResetPwdEmail API with an email that has no row in uac_user (query by email equality).
Common situations: User registered with a different email; typo in the submitted email; user account removed; testing against a different database without seed data.
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/bf6c9ef4fdc4664e.
Report an issue: GitHub.
Appendix: source
Thrown at paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/EmailServiceImpl.java:70
private RedisTemplate<String, Object> redisTemplate;
@Resource
private UserManager userManager;
@Resource
private RedisService redisService;
private static final String KEY_STR = "om8q6fq#A0Yl@qJy";
private static final String IV_STR = "0#86gzOcsv1bXyIx";
@Override
public void submitResetPwdEmail(String email) {
Preconditions.checkArgument(StringUtils.isNotEmpty(email), ErrorCodeEnum.UAC10011018.msg());
// 获取用户名
UacUser uacUser = new UacUser();
uacUser.setEmail(email);
uacUser = uacUserService.selectOne(uacUser);
if (uacUser == null) {
throw new UacBizException(ErrorCodeEnum.UAC10011004, email);
}
String resetPwdKey = PubUtils.uuid() + UniqueIdGenerator.generateId();
redisTemplate.opsForValue().set(RedisKeyUtil.getResetPwdTokenKey(resetPwdKey), uacUser, 7 * 24, TimeUnit.HOURS);
Map<String, Object> param = Maps.newHashMap();
param.put("loginName", uacUser.getLoginName());
param.put("email", email);
param.put("resetPwdUrl", resetPwdUrl + resetPwdKey);
param.put("dateTime", DateUtil.formatDateTime(new Date()));
Set<String> to = Sets.newHashSet();
to.add(email);
MqMessageData messageData = emailProducer.sendEmailMq(to, UacEmailTemplateEnum.RESET_PWD_SEND_MAIL, AliyunMqTopicConstants.MqTagEnum.FORGOT_PASSWORD_AUTH_CODE, param);
userManager.submitResetPwdEmail(messageData);
}
@OverrideView on GitHub (pinned to 781281a950)