{"record":{"id":"73b8270c816df19b","repo":"paascloud/paascloud-master","slug":"uac10011038","errorCode":"UAC10011038","errorMessage":"UAC10011038","messagePattern":"UAC10011038","errorType":"error_code","errorClass":"UacBizException","httpStatus":null,"severity":"error","filePath":"paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/manager/UserManager.java","lineNumber":79,"sourceCode":"\t}\n\n\t@MqProducerStore\n\tpublic void resetLoginPwd(final MqMessageData mqMessageData, final UacUser update) {\n\t\tlog.info(\"重置密码. mqMessageData={}, user={}\", mqMessageData, update);\n\t\tint updateResult = uacUserMapper.updateByPrimaryKeySelective(update);\n\t\tif (updateResult < 1) {\n\t\t\tlog.error(\"用户【 {} 】重置密码失败\", update.getLoginName());\n\t\t} else {\n\t\t\tlog.info(\"用户【 {} 】重置密码失败\", update.getLoginName());\n\t\t}\n\t}\n\n\t@MqProducerStore\n\tpublic void activeUser(final MqMessageData mqMessageData, final UacUser uacUser, final String activeUserKey) {\n\t\tlog.info(\"激活用户. mqMessageData={}, user={}\", mqMessageData, uacUser);\n\t\tint result = uacUserMapper.updateByPrimaryKeySelective(uacUser);\n\t\tif (result < 1) {\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10011038, uacUser.getId());\n\t\t}\n\n\t\t// 绑定一个访客角色默认值roleId=10000\n\t\tfinal Long userId = uacUser.getId();\n\t\tPreconditions.checkArgument(userId != null, \"用戶Id不能爲空\");\n\n\t\tfinal Long roleId = 10000L;\n\n\t\tUacRoleUser roleUser = new UacRoleUser();\n\t\troleUser.setUserId(userId);\n\t\troleUser.setRoleId(roleId);\n\t\tuacRoleUserMapper.insertSelective(roleUser);\n\t\t// 绑定一个组织\n\t\tUacGroupUser groupUser = new UacGroupUser();\n\t\tgroupUser.setUserId(userId);\n\t\tgroupUser.setGroupId(GlobalConstant.Sys.SUPER_MANAGER_GROUP_ID);\n\t\tuacGroupUserMapper.insertSelective(groupUser);\n\t\t// 删除 activeUserToken","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/paascloud/paascloud-master/blob/781281a9503332ed3cef44ea618349d14230a127/paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/manager/UserManager.java#L61-L97","documentation":"UAC10011038 means the database update to activate a user affected zero rows. UserManager.activeUser throws it when uacUserMapper.updateByPrimaryKeySelective returns < 1, i.e. no user with the given id was updated.","triggerScenarios":"Calling activeUser with a UacUser id that doesn't exist, or with a record that no longer matches (deleted before activation).","commonSituations":"Activation link used after the user row was removed or re-created with a new id; activation request replayed after completion with status filters making the update a no-op; cross-environment id.","solutions":["Verify the user id exists before activation (selectByPrimaryKey first).","Check whether the update includes status conditions that make a re-activation a no-op; treat 0 rows idempotently if desired.","Confirm the request runs against the correct environment/database.","Reissue activation from the admin flow if the user record was replaced."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"UacUser existing = uacUserMapper.selectByPrimaryKey(uacUser.getId());\nif (existing == null) {\n    throw new IllegalStateException(\"User \" + uacUser.getId() + \" does not exist; cannot activate\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    userManager.activeUser(mqMessageData, uacUser, activeUserKey);\n} catch (UacBizException e) {\n    if (\"UAC10011038\".equals(String.valueOf(e.getCode()))) { /* treat as already-deleted user */ }\n    throw e;\n}","preventionTips":["Verify the user row exists before activation","Make activation idempotent for already-activated users","Guard against replaying stale activation requests after user deletion"],"tags":["user","activation","database-update","not-found"],"backgroundTag":"database-write-failed","analyzedSha":"781281a9503332ed3cef44ea618349d14230a127","analyzedAt":"2026-09-10T10:59:02.070Z","contentChangedAt":"2026-09-10T10:59:02.070Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}