iflytek/astron-agent · warning
messageCodeService not configured, or mobile number not…
Error message
messageCodeService not configured, or mobile number not provided, skipping verification code check
What it means
This is a WARN log, not an exception, emitted by deleteSpace when the verification-code check for deleting a space is skipped. It fires when messageCodeService is null (SMS/verify-code service not configured) or the request carried no mobile number. Space deletion then proceeds without the second-factor check, which is a security-relevant degradation.
Solutions
- Pass a non-blank mobile (and verifyCode) when calling deleteSpace so the verification check runs.
- Configure the MessageCodeService bean / SMS provider credentials in the environment so messageCodeService != null.
- If skipping is acceptable in a given env, treat this log as informational only; otherwise enforce mobile+code as required parameters at the controller level.
Example fix
// before spaceBizService.deleteSpace(spaceId, null, null); // after ApiResult<String> result = spaceBizService.deleteSpace(spaceId, mobile, verifyCode); // with controller-side validation: if (StringUtils.isBlank(mobile) || StringUtils.isBlank(verifyCode)) return ApiResult.error(PARAMETER_ERROR);
Defensive patterns
Strategy: validation
Validate before calling
if (StringUtils.isBlank(mobile) || StringUtils.isBlank(verifyCode)) {
throw new IllegalArgumentException("mobile and verifyCode are required to delete a space");
} Prevention
- Always pass mobile+verifyCode from the UI when deleting spaces.
- Ensure the SMS/MessageCodeService bean is configured in every production profile.
- Monitor for this WARN in production — it means two-factor deletion is disabled.
When it happens
Trigger: Calling DELETE space endpoint without a mobile/verifyCode; or deploying the hub service without a MessageCodeService bean (SMS integration disabled).
Common situations: Local/dev environments where the SMS provider (messageCodeService) is intentionally disabled; API clients calling deleteSpace without the mobile parameter; partially configured spring profiles.
Understand the failure class
Background: "X is required", "must be set", "cannot be empty": the missing-required-config error family, from Vertex AI project/location to WeChat keys — this error's family across 18 libraries.
Related errors
- messageCodeService not configured, skipping verification…
- CODE_EXECUTION_ERROR
- Outbound address is blocked
- Outbound address is not globally routable
- TOOLBOX_IP_IN_BLACKLIST
AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12).
Data as JSON: /api/errors/37a42fe394432c0c.
Report an issue: GitHub.
Appendix: source
Thrown at console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/space/impl/SpaceBizServiceImpl.java:140
}
/**
* Delete space
*
* @param spaceId
* @param mobile
* @param verifyCode
* @return
*/
@Override
@Transactional
public ApiResult<String> deleteSpace(Long spaceId, String mobile, String verifyCode) {
// Send verification code
if (messageCodeService != null && StringUtils.isNotBlank(mobile)) {
messageCodeService.checkVerifyCodeCommon(mobile, verifyCode,
MessageCodeService.DEL_SPACE_VERIFY_CODE_PREFIX);
} else {
log.warn("messageCodeService not configured, or mobile number not provided, skipping verification code check");
}
Space space = spaceService.getById(spaceId);
if (space == null) {
return ApiResult.error(ResponseEnum.SPACE_NOT_EXISTS);
}
String uid = RequestContextUtil.getUID();
// Enterprise space: verify user is enterprise admin via DB query (not header)
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);
}
} else {
// Personal space: verify current user is the ownerView on GitHub (pinned to 5e758547a8)