qiurunze123/miaosha · warning · GlobleException
30009
30009
Error message
账号不存在!
What it means
Thrown by MiaoShaUserService.updatePassword() (miaosha-v2) when getByNickName(nickName) returns null. Maps to ResultStatus.MOBILE_NOT_EXIST (code 30009, message '账号不存在!' — 'Account does not exist'). In v2 the message was corrected from the v1 wording ('手机号不存在!') to '账号不存在!' to accurately reflect that the lookup is by nickname, not phone number. The lookup path is Redis (MiaoShaUserKey.getByNickName) then miaoShaUserMapper.getByNickname().
Source
Thrown at miaosha-v2/miaosha-service/src/main/java/com/geekq/miaosha/service/MiaoShaUserService.java:83
MiaoshaUser user = redisService.get(MiaoShaUserKey.getByNickName, "" + nickName, MiaoshaUser.class);
if (user != null) {
return user;
}
//取数据库
user = miaoShaUserMapper.getByNickname(nickName);
if (user != null) {
redisService.set(MiaoShaUserKey.getByNickName, "" + nickName, user);
}
return user;
}
// http://blog.csdn.net/tTU1EvLDeLFq5btqiK/article/details/78693323
public boolean updatePassword(String token, String nickName, String formPass) {
//取user
MiaoshaUser user = getByNickName(nickName);
if (user == null) {
throw new GlobleException(MOBILE_NOT_EXIST);
}
//更新数据库
MiaoshaUser toBeUpdate = new MiaoshaUser();
toBeUpdate.setNickname(nickName);
toBeUpdate.setPassword(MD5Utils.formPassToDBPass(formPass, user.getSalt()));
miaoShaUserMapper.update(toBeUpdate);
//处理缓存
redisService.delete(MiaoShaUserKey.getByNickName, "" + nickName);
user.setPassword(toBeUpdate.getPassword());
redisService.set(MiaoShaUserKey.token, token, user);
return true;
}
public boolean register(String userName, String passWord,
HttpServletResponse response, HttpServletRequest request) {
MiaoshaUser miaoShaUser = new MiaoshaUser();
miaoShaUser.setNickname(userName);View on GitHub (pinned to e58017658e)
Solutions
- Verify the account exists via getByNickName() before allowing the user to reach the password-change step.
- Confirm the nickname corresponds to a miaosha_user row, not just an admin logininfo row.
- Check miaoShaUserMapper.getByNickname() SQL mapping points to the correct table and column.
- Re-register the user if the account was removed.
Defensive patterns
Strategy: validation
Validate before calling
// Verify user exists before password update (v2)
MiaoshaUser user = miaoShaUserService.getByNickName(nickName);
if (user == null) {
return ResultGeekQ.error(ResultStatus.MOBILE_NOT_EXIST);
}
miaoShaUserService.updatePassword(token, nickName, formPass); Try / catch
try {
miaoShaUserService.updatePassword(token, nickName, formPass);
} catch (GlobleException e) {
if (e.getStatus() == ResultStatus.MOBILE_NOT_EXIST) {
return ResultGeekQ.error(ResultStatus.MOBILE_NOT_EXIST);
}
throw e;
} Prevention
- Pre-validate user existence via getByNickName() before the password-reset step.
- Confirm the nickname maps to a miaosha_user row (not just admin logininfo).
- Check miaoShaUserMapper.getByNickname SQL mapping for correct table/column.
When it happens
Trigger: Calling updatePassword(token, nickName, formPass) where nickName has no matching miaosha_user row and is not in Redis cache. The v2 DAO is miaoShaUserMapper (MyBatis mapper) instead of the v1 miaoShaUserDao.
Common situations: Password reset for a deleted or never-registered account; Redis cache flushed exposing a missing DB row; nickname is from miaosha-admin's logininfo table (different schema) rather than miaosha_user; test environment without seed data.
Related errors
AI-assisted analysis of qiurunze123/miaosha@e58017658e (2026-08-14).
Data as JSON: /api/errors/d54d86cf58255989.
Report an issue: GitHub.