iflytek/astron-agent · warning · BusinessException
USER_APP_NAME_REPEAT
USER_APP_NAME_REPEAT
Error message
USER_APP_NAME_REPEAT
What it means
USER_APP_NAME_REPEAT is thrown by createApp when appMstService.exist() finds an existing app with the same app name for the user. App names must be unique, so duplicate-name creation is rejected before the tenant service is called.
Solutions
- Choose a different, unique app name and retry.
- Check existing apps first (list apps / appMstService.exist) and reuse the existing app instead of creating a new one.
- If the name was left over from a failed previous creation, delete the stale app then recreate.
- Make automated naming unique (suffix with timestamp/UUID).
Example fix
// before
publishApiService.createApp(new CreateAppVo("my-app", "desc")); // may throw if name taken
// after
String name = "my-app";
if (appMstService.exist(name)) {
name = name + "-" + System.currentTimeMillis();
}
publishApiService.createApp(new CreateAppVo(name, "desc")); Defensive patterns
Strategy: validation
Validate before calling
if (appMstService.exist(appName)) { throw new BusinessException(ResponseEnum.USER_APP_NAME_REPEAT); } Try / catch
try { publishApiService.createApp(vo); }
catch (BusinessException e) { if (e.getCode() == ResponseEnum.USER_APP_NAME_REPEAT) { showNameTakenMessage(); } else throw e; } Prevention
- Check name availability asynchronously as the user types.
- Use unique suffixes in automated/CI app creation.
- Reuse existing apps instead of recreating with the same name.
When it happens
Trigger: Calling the create-app API with an appName that already exists in app_mst; retrying a create that actually succeeded earlier (client didn't see the response).
Common situations: User re-submits a form after a timeout; automation scripts create apps in a loop without unique names; copy-pasting an existing app's name.
Understand the failure class
Background: "already exists" / EEXIST / FileAlreadyExistsException: what the 'file already exists' error means and how to fix it — this error's family across 37 libraries.
Related errors
AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12).
Data as JSON: /api/errors/20b90b730ee81b5c.
Report an issue: GitHub.
Appendix: source
Thrown at console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/publish/impl/PublishApiServiceImpl.java:92
@Autowired
private UserLangChainDataService userLangChainDataService;
@Autowired
private MaasUtil maasUtil;
@Autowired
private ReleaseManageClientService releaseManageClientService;
private static final String PUBLISH_API = "publish_api";
private static final String BOT_API_MAAS_URL = "/workflow/v1/chat/completions";
@Override
public Boolean createApp(CreateAppVo createAppVo) {
String uid = RequestContextUtil.getUID();
if (appMstService.exist(createAppVo.getAppName())) {
throw new BusinessException(ResponseEnum.USER_APP_NAME_REPEAT);
}
String appId = tenantService.createApp(uid, createAppVo.getAppName(), createAppVo.getAppDescribe());
if (StringUtils.isBlank(appId)) {
throw new BusinessException(ResponseEnum.USER_APP_ID_CREATE_ERROR);
}
TenantAuth tenantAuth = tenantService.getAppDetail(appId);
if (Objects.isNull(tenantAuth)) {
throw new BusinessException(ResponseEnum.USER_APP_ID_CREATE_ERROR);
}
appMstService.insert(uid, appId, createAppVo.getAppName(), createAppVo.getAppDescribe(), tenantAuth.getApiKey(), tenantAuth.getApiSecret());
return true;
}
@Override
public List<AppListDTO> getAppList() {
String uid = RequestContextUtil.getUID();View on GitHub (pinned to 5e758547a8)