{"record":{"id":"e0d76a974903c413","repo":"paascloud/paascloud-master","slug":"uac10011037","errorCode":"UAC10011037","errorMessage":"修改用户失败,userId=%s","messagePattern":"修改用户失败,userId=(.+?)","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":645,"sourceCode":"\n\t\treturn uacUserMapper.updateByPrimaryKeySelective(uacUser);\n\n\n\t}\n\n\t@Override\n\tpublic void modifyUserEmail(String email, String emailCode, LoginAuthDto loginAuthDto) {\n\t\t// 校验用户信息\n\t\tPreconditions.checkArgument(!StringUtils.isEmpty(email), ErrorCodeEnum.UAC10011018.msg());\n\t\tPreconditions.checkArgument(PubUtils.isEmail(email), \"邮箱格式不正确\");\n\n\t\tUacUser uacUser = new UacUser();\n\t\tuacUser.setId(loginAuthDto.getUserId());\n\t\tuacUser.setEmail(email);\n\t\tuacUser.setUpdateInfo(loginAuthDto);\n\t\tint result = this.updateUser(uacUser);\n\t\tif (result < 1) {\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10011037, loginAuthDto.getUserId());\n\t\t}\n\t}\n\n\t@Override\n\tpublic void resetLoginPwd(Long userId, LoginAuthDto loginAuthDto) {\n\t\tif (userId == null) {\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10011001);\n\t\t}\n\t\tUacUser uacUser = this.queryByUserId(userId);\n\t\tif (uacUser == null) {\n\t\t\tlogger.error(\"找不到用户. userId={}\", userId);\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10011003, userId);\n\t\t}\n\n\t\tPreconditions.checkArgument(!StringUtils.isEmpty(uacUser.getEmail()), \"邮箱地址不能为空\");\n\n\t\tString newLoginPwd = RandomUtil.createComplexCode(8);\n\t\tUacUser update = new UacUser();","sourceCodeStart":627,"sourceCodeEnd":663,"githubUrl":"https://github.com/paascloud/paascloud-master/blob/781281a9503332ed3cef44ea618349d14230a127/paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacUserServiceImpl.java#L627-L663","documentation":"UAC10011037 (message '修改用户失败,userId=%s' — failed to modify user) is thrown after updateUser(uacUser) returns fewer than 1 affected rows during the email-binding/update flow. The user row targeted by loginAuthDto.getUserId() was not updated — typically because it does not exist or was concurrently deleted.","triggerScenarios":"Calling the email-update method (modifyEmail flow) with a LoginAuthDto whose userId has no matching row, so updateUser's UPDATE affects 0 rows.","commonSituations":"Stale session/token referencing a deleted user; userId mismatch between auth service and UAC DB; transaction rollback leaving expected row absent; data sync issues between services in the microservice deployment.","solutions":["Verify the userId in LoginAuthDto exists in uac_user before the update","Re-authenticate/refresh the LoginAuthDto if the session may be stale","Check for concurrent deletion or user-id mismatch between services and fix the data","Catch UacBizException code UAC10011037 and surface 'update failed, please re-login'"],"exampleFix":"// before\nloginAuthDto.setUserId(userIdMaybeStale);\nuacUserService.modifyEmail(loginAuthDto, email);\n// after\nif (uacUserService.queryByUserId(loginAuthDto.getUserId()) != null) {\n    uacUserService.modifyEmail(loginAuthDto, email);\n}","handlingStrategy":"validation","validationCode":"if (uacUserService.queryByUserId(loginAuthDto.getUserId()) == null) {\n    throw new IllegalStateException(\"user no longer exists, please re-login\");\n}","typeGuard":null,"tryCatchPattern":"try { uacUserService.modifyEmail(loginAuthDto, email); } catch (UacBizException e) { if (\"UAC10011037\".equals(e.getCode())) { /* force re-login / refresh session */ } }","preventionTips":["Refresh LoginAuthDto from the DB before write operations","Watch for cross-service user-id desync; reconcile regularly","Treat 0-row updates as explicit errors rather than silent success"],"tags":["update-failed","user","database"],"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-16T04:17:20.429Z"}