{"record":{"id":"3df87e87b5140133","repo":"paascloud/paascloud-master","slug":"uac10011004-3df87e","errorCode":"UAC10011004","errorMessage":"找不到用户,email=%s","messagePattern":"找不到用户,email=(.+?)","errorType":"error_code","errorClass":"UacBizException","httpStatus":null,"severity":"error","filePath":"paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacUserServiceImpl.java","lineNumber":768,"sourceCode":"\t@Override\n\tpublic void activeUser(String activeUserToken) {\n\t\tPreconditions.checkArgument(!StringUtils.isEmpty(activeUserToken), \"激活用户失败\");\n\n\t\tString activeUserKey = RedisKeyUtil.getActiveUserKey(activeUserToken);\n\n\t\tString email = redisService.getKey(activeUserKey);\n\n\t\tif (StringUtils.isEmpty(email)) {\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10011030);\n\t\t}\n\t\t// 修改用户状态, 绑定访客角色\n\t\tUacUser uacUser = new UacUser();\n\t\tuacUser.setEmail(email);\n\n\t\tuacUser = uacUserMapper.selectOne(uacUser);\n\t\tif (uacUser == null) {\n\t\t\tlogger.error(\"找不到用户信息. email={}\", email);\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10011004, email);\n\t\t}\n\n\t\tUacUser update = new UacUser();\n\t\tupdate.setId(uacUser.getId());\n\t\tupdate.setStatus(UacUserStatusEnum.ENABLE.getKey());\n\t\tLoginAuthDto loginAuthDto = new LoginAuthDto();\n\t\tloginAuthDto.setUserId(uacUser.getId());\n\t\tloginAuthDto.setUserName(uacUser.getLoginName());\n\t\tloginAuthDto.setLoginName(uacUser.getLoginName());\n\t\tupdate.setUpdateInfo(loginAuthDto);\n\n\t\tUacUser user = this.queryByUserId(uacUser.getId());\n\n\t\tMap<String, Object> param = Maps.newHashMap();\n\t\tparam.put(\"loginName\", user.getLoginName());\n\t\tparam.put(\"dateTime\", DateUtil.formatDateTime(new Date()));\n\n\t\tSet<String> to = Sets.newHashSet();","sourceCodeStart":750,"sourceCodeEnd":786,"githubUrl":"https://github.com/paascloud/paascloud-master/blob/781281a9503332ed3cef44ea618349d14230a127/paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacUserServiceImpl.java#L750-L786","documentation":"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=...'.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nUacUser q = new UacUser(); q.setEmail(email);\nUacUser uacUser = uacUserMapper.selectOne(q); // may be null -> UAC10011004\n// after (defensive in caller)\nif (uacUserService.countByEmail(email.trim().toLowerCase()) == 0) {\n    throw new BizException(\"no user for email \" + email + \", please re-register\");\n}","handlingStrategy":"validation","validationCode":"UacUser q = new UacUser();\nq.setEmail(email.trim().toLowerCase());\nif (uacUserMapper.selectCount(q) == 0) {\n    throw new BizException(\"no user for email \" + email + \", please re-register\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    uacUserService.activeUser(token);\n} catch (UacBizException e) {\n    if (\"UAC10011004\".equals(e.getCode())) { return Result.fail(404, \"no account for this email; register again\"); }\n    throw e;\n}","preventionTips":["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)."],"tags":["user-management","not-found","email"],"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"}