iflytek/astron-agent · warning

messageCodeService not configured, skipping verification…

Error message

messageCodeService not configured, skipping verification code check

What it means

WARN log from sendMessageCode when messageCodeService is null: the SMS verification service is not configured, so no code can be sent. The endpoint still returns success even though nothing was sent, which can mislead callers.

Solutions

  1. Configure the SMS provider so the MessageCodeService bean is registered (check application.yml/profile for SMS credentials).
  2. Return an explicit error or feature-not-available response instead of success when messageCodeService == null.
  3. Add a startup check that fails fast (or logs an ERROR) if space deletion requires SMS but the service is absent.

Example fix

// before
} else {
    log.warn("messageCodeService not configured, skipping verification code check");
}
return ApiResult.success();
// after
} else {
    log.error("messageCodeService not configured");
    return ApiResult.error(ResponseEnum.SMS_SERVICE_NOT_CONFIGURED);
}
Defensive patterns

Strategy: fallback

Validate before calling

// deployment check
// assert messageCodeService != null at startup when sms enabled:
ApplicationRunner checker = ctx -> { if (ctx.getBeanProvider(MessageCodeService.class).getIfAvailable() == null) log.error("MessageCodeService missing: SMS verification disabled"); };

Prevention

When it happens

Trigger: Calling the send-message-code endpoint in an environment where MessageCodeService is not wired (no SMS provider config).

Common situations: Dev/test/staging deployments without SMS credentials; feature-flagged SMS integration left disabled in production by config mistake.

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


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

Appendix: source

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

            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)