{"record":{"id":"bf6c9ef4fdc4664e","repo":"paascloud/paascloud-master","slug":"uac10011004","errorCode":"UAC10011004","errorMessage":"UAC10011004","messagePattern":"UAC10011004","errorType":"error_code","errorClass":"UacBizException","httpStatus":null,"severity":"error","filePath":"paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/EmailServiceImpl.java","lineNumber":70,"sourceCode":"\tprivate RedisTemplate<String, Object> redisTemplate;\n\t@Resource\n\tprivate UserManager userManager;\n\t@Resource\n\tprivate RedisService redisService;\n\n\tprivate static final String KEY_STR = \"om8q6fq#A0Yl@qJy\";\n\tprivate static final String IV_STR = \"0#86gzOcsv1bXyIx\";\n\n\t@Override\n\tpublic void submitResetPwdEmail(String email) {\n\t\tPreconditions.checkArgument(StringUtils.isNotEmpty(email), ErrorCodeEnum.UAC10011018.msg());\n\n\t\t// 获取用户名\n\t\tUacUser uacUser = new UacUser();\n\t\tuacUser.setEmail(email);\n\t\tuacUser = uacUserService.selectOne(uacUser);\n\t\tif (uacUser == null) {\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10011004, email);\n\t\t}\n\n\t\tString resetPwdKey = PubUtils.uuid() + UniqueIdGenerator.generateId();\n\t\tredisTemplate.opsForValue().set(RedisKeyUtil.getResetPwdTokenKey(resetPwdKey), uacUser, 7 * 24, TimeUnit.HOURS);\n\n\t\tMap<String, Object> param = Maps.newHashMap();\n\t\tparam.put(\"loginName\", uacUser.getLoginName());\n\t\tparam.put(\"email\", email);\n\t\tparam.put(\"resetPwdUrl\", resetPwdUrl + resetPwdKey);\n\t\tparam.put(\"dateTime\", DateUtil.formatDateTime(new Date()));\n\n\t\tSet<String> to = Sets.newHashSet();\n\t\tto.add(email);\n\t\tMqMessageData messageData = emailProducer.sendEmailMq(to, UacEmailTemplateEnum.RESET_PWD_SEND_MAIL, AliyunMqTopicConstants.MqTagEnum.FORGOT_PASSWORD_AUTH_CODE, param);\n\t\tuserManager.submitResetPwdEmail(messageData);\n\t}\n\n\t@Override","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/paascloud/paascloud-master/blob/781281a9503332ed3cef44ea618349d14230a127/paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/EmailServiceImpl.java#L52-L88","documentation":"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.","triggerScenarios":"Calling the forgot-password / submitResetPwdEmail API with an email that has no row in uac_user (query by email equality).","commonSituations":"User registered with a different email; typo in the submitted email; user account removed; testing against a different database without seed data.","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"],"exampleFix":"// before\nuacUser = uacUserService.selectOne(uacUser);\nif (uacUser == null) { throw new UacBizException(ErrorCodeEnum.UAC10011004, email); }\n// after (caller-side guard)\nif (userService.isEmailRegistered(email)) { emailService.submitResetPwdEmail(loginName, email); }","handlingStrategy":"validation","validationCode":"boolean emailBound = userService.countByEmail(email) > 0; // SELECT COUNT(*) FROM uac_user WHERE email = ?\nif (!emailBound) { emailService.submitResetPwdEmail(loginName, email); }","typeGuard":null,"tryCatchPattern":"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; }","preventionTips":["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"],"tags":["email","password-reset","user-not-found","validation"],"backgroundTag":"user-not-found","analyzedSha":"781281a9503332ed3cef44ea618349d14230a127","analyzedAt":"2026-09-10T10:59:02.070Z","contentChangedAt":"2026-09-10T10:59:02.070Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}