iflytek/astron-agent · warning

User has not bound mobile number, cannot send verification…

Error message

User has not bound mobile number, cannot send verification code, uid: {}

What it means

WARN log from sendMessageCode: the user identified by uid has no mobile number bound in user_info, so the delete-space verification SMS cannot be sent. It is not an exception; the endpoint still returns success while no code was actually delivered.

Solutions

  1. Have the user bind a mobile number to their account (profile/bind-mobile endpoint) before requesting a verification code.
  2. Return an explicit error (e.g. MOBILE_NOT_BOUND) instead of ApiResult.success() so the client knows no SMS was sent.
  3. Check user info via findByUid and validate mobile presence before calling this API.

Example fix

// before
log.warn("User has not bound mobile number...");
return ApiResult.success();
// after
if (StringUtils.isBlank(userInfo.getMobile())) {
    return ApiResult.error(ResponseEnum.MOBILE_NOT_BOUND);
}
Defensive patterns

Strategy: validation

Validate before calling

UserInfo u = userInfoDataService.findByUid(uid).orElse(null);
if (u == null || StringUtils.isBlank(u.getMobile())) {
    return ApiResult.error(ResponseEnum.MOBILE_NOT_BOUND);
}

Prevention

When it happens

Trigger: Calling sendMessageCode for a user whose userInfo.getMobile() is blank/null, while messageCodeService is configured.

Common situations: Users who registered via email/WeChat and never bound a phone number trying to delete a space; users whose profile migration lost the mobile field.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/373a0b8774d821d6. Report an issue: GitHub.

Appendix: source

Thrown at console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/space/impl/SpaceBizServiceImpl.java:296

        }
        if (space.getEnterpriseId() != null) {
            EnterpriseUser enterpriseUser = enterpriseUserService.getEnterpriseUserByUid(space.getEnterpriseId(), uid);
            if (enterpriseUser == null) {
                return ApiResult.error(ResponseEnum.SPACE_USER_NOT_ENTERPRISE_USER);
            }
            if (!(Objects.equals(enterpriseUser.getRole(), EnterpriseRoleEnum.OFFICER.getCode()) ||
                    Objects.equals(enterpriseUser.getRole(), EnterpriseRoleEnum.GOVERNOR.getCode()))) {
                return ApiResult.error(ResponseEnum.SPACE_USER_NOT_ENTERPRISE_ADMIN);
            }
        }
        // Get user mobile number and send SMS
        if (messageCodeService != null) {
            UserInfo userInfo = userInfoDataService.findByUid(uid).orElseThrow();
            if (StringUtils.isNotBlank(userInfo.getMobile())) {
                messageCodeService.sendVerifyCodeCommon(userInfo.getMobile(),
                        MessageCodeService.DEL_SPACE_VERIFY_CODE_PREFIX);
            } else {
                log.warn("User has not bound mobile number, cannot send verification code, uid: {}", uid);
            }
        } else {
            log.warn("messageCodeService not configured, skipping verification code check");
        }

        return ApiResult.success();
    }

    @Override
    public ApiResult<Boolean> ossVersionUserUpgrade() {
        String uid = RequestContextUtil.getUID();
        return ApiResult.success(userInfoDataService.updateUserEnterpriseServiceType(uid, EnterpriseServiceTypeEnum.ENTERPRISE));
    }


}

View on GitHub (pinned to 5e758547a8)