paascloud/paascloud-master · error · UacBizException

UAC10011029

UAC10011029

Error message

重置密码失败

What it means

UAC10011029 (message '重置密码失败' — reset password failed) is thrown when uacUserMapper.updateByPrimaryKeySelective(update) affects fewer than 1 rows during the token-based password reset, i.e. the UPDATE to set the new password did not modify any row. The token was valid in Redis, but persisting the new password failed.

Solutions

  1. Re-check that the user id embedded in the reset token still exists in uac_user; if deleted, invalidate the token and ask the user to re-register/re-request
  2. Retry the reset with a fresh token after confirming the account exists
  3. Inspect DB/transaction logs for update failures (connection, lock timeout)
  4. Catch UacBizException code UAC10011029 and surface a generic 'reset failed, please try again' with a new reset link

Example fix

// before
uacUserService.resetLoginPwdByRestPwdKey(token, newPwd, confirmPwd);
// after
try {
    uacUserService.resetLoginPwdByRestPwdKey(token, newPwd, confirmPwd);
} catch (UacBizException e) {
    if ("UAC10011029".equals(e.getCode())) {
        // invalidate token and prompt user to request a new reset link
    }
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (uacUserService.queryByUserId(userIdFromToken) == null) { /* account gone: invalidate token, request new reset */ }

Try / catch

try { uacUserService.resetLoginPwdByRestPwdKey(key, newPwd, confirmPwd); } catch (UacBizException e) { if ("UAC10011029".equals(e.getCode())) { /* generic 'reset failed', offer new reset link */ } }

Prevention

When it happens

Trigger: Calling resetLoginPwdByRestPwdKey(resetPwdKey, newPassword, confirmNewPassword) where the user record identified by the token's stored user id no longer exists or was concurrently modified/deleted between Redis token validation and the DB update.

Common situations: User account deleted while a reset token was outstanding; DB connectivity/transaction failures; primary-key mismatch between the user object cached in Redis and current table state; concurrent password changes invalidating the row.

Related errors


AI-assisted analysis of paascloud/paascloud-master@781281a950 (2026-09-10). Data as JSON: /api/errors/04679c91438da00c. Report an issue: GitHub.

Appendix: source

Thrown at paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacUserServiceImpl.java:717

		}

		LoginAuthDto loginAuthDto = new LoginAuthDto();
		loginAuthDto.setUserName(uacUser.getUserName());
		loginAuthDto.setLoginName(uacUser.getLoginName());
		loginAuthDto.setUserId(uacUser.getId());

		UacUser update = new UacUser();
		String salt = generateId() + "";
		update.setLoginPwd(Md5Util.encrypt(newPassword));
		update.setSalt(salt);
		update.setId(uacUser.getId());
		// 该用户已经修改过密码
		update.setIsChangedPwd((Short.valueOf("1")));
		update.setUpdateInfo(loginAuthDto);

		int result = uacUserMapper.updateByPrimaryKeySelective(update);
		if (result < 1) {
			throw new UacBizException(ErrorCodeEnum.UAC10011029);
		}
		redisTemplate.delete(resetPwdTokenKey);
	}

	@Override
	@Transactional(readOnly = true, rollbackFor = Exception.class)
	public UserBindRoleVo getUserBindRoleDto(Long userId) {
		UserBindRoleVo userBindRoleVo = new UserBindRoleVo();
		Set<Long> alreadyBindRoleIdSet = Sets.newHashSet();
		UacUser uacUser = this.queryByUserId(userId);
		if (uacUser == null) {
			logger.error("找不到userId={}, 的用户", userId);
			throw new UacBizException(ErrorCodeEnum.UAC10011003, userId);
		}

		// 查询所有角色包括该用户拥有的角色
		List<BindRoleDto> bindRoleDtoList = uacUserMapper.selectAllNeedBindRole(GlobalConstant.Sys.SUPER_MANAGER_ROLE_ID);
		// 该角色已经绑定的用户

View on GitHub (pinned to 781281a950)