iflytek/astron-agent · error · BusinessException

DATABASE_CREATE_FAILED

DATABASE_CREATE_FAILED

Error message

DATABASE_CREATE_FAILED

What it means

Generic catch-all in DatabaseService.create: any exception raised during the create flow (duplicate check query, coreSystemService.createDatabase RPC, DB insert) is converted into DATABASE_CREATE_FAILED. The original exception is logged with the request params. Because the BusinessException itself is caught by the same catch, even validation failures get re-wrapped as this error.

Solutions

  1. Inspect the log line 'Failed to create database, params:' for the root-cause stack trace
  2. Verify the core system service is up and reachable
  3. Check database connectivity and the db_info table constraints
  4. Note the catch also masks DATABASE_NAME_EXIST/NAME_NOT_EMPTY — check cause chain for BusinessException
Defensive patterns

Strategy: try-catch

Try / catch

try { databaseService.create(dto); } catch (BusinessException e) { log.error("create failed", e); /* inspect cause: core-system RPC or DB insert */ showGenericCreateFailure(); }

Prevention

When it happens

Trigger: coreSystemService.createDatabase fails (core service down, HTTP error); dbInfoMapper.insert fails (constraint violation, connection issue); any unexpected RuntimeException inside the try block, including rethrown BusinessExceptions from validation above.

Common situations: Core service unreachable or returning 5xx; DB connection pool exhausted; space quota exceeded downstream; null pointer from BeanUtils copy when a DTO field is missing.

Related errors


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

Appendix: source

Thrown at console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/database/DatabaseService.java:144

            if (count > 0) {
                throw new BusinessException(ResponseEnum.DATABASE_NAME_EXIST);
            }
            // Call core system to create database
            Long dbId = coreSystemService.createDatabase(databaseDto.getName(), userId, spaceId, databaseDto.getDescription());
            // Save record
            DbInfo database = new DbInfo();
            BeanUtils.copyProperties(databaseDto, database);
            database.setUid(userId);
            database.setAppId(commonConfig.getAppId());
            database.setDbId(dbId);
            database.setCreateTime(new Date());
            database.setUpdateTime(new Date());
            database.setSpaceId(spaceId);
            dbInfoMapper.insert(database);
            return database;
        } catch (Exception ex) {
            log.info("Failed to create database, params:{}", databaseDto.toString(), ex);
            throw new BusinessException(ResponseEnum.DATABASE_CREATE_FAILED);
        }
    }

    @Transactional
    public void updateDateBase(DatabaseDto databaseDto) {
        try {
            dataPermissionCheckTool.checkDbUpdateBelong(databaseDto.getId());
            // Name validation
            DbInfo dbInfo = dbInfoMapper.selectById(databaseDto.getId());
            if (StringUtils.isNotBlank(databaseDto.getDescription())) {
                if (!databaseDto.getDescription().equals(dbInfo.getDescription())) {
                    coreSystemService.modifyDataBase(dbInfo.getDbId(), UserInfoManagerHandler.getUserId(), databaseDto.getDescription());
                }
                dbInfo.setDescription(databaseDto.getDescription());
            }
            dbInfoMapper.updateById(dbInfo);
        } catch (Exception ex) {
            log.error("Failed to update database, params={}", JSONObject.toJSONString(databaseDto), ex);

View on GitHub (pinned to 5e758547a8)