alibaba/spring-ai-alibaba · error · BizException

MissingParameter

MissingParameter

Error message

Required parameters [model_provider] missing, please check the request parameters.

What it means

Thrown by AppServiceImpl.publishApp when publishing a BASIC-type app whose versioned AgentConfig has a blank or missing modelProvider. The framework requires every basic app to declare which model provider (e.g. dashscope, openai) serves it before it can be published.

Source

Thrown at spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/base/service/impl/AppServiceImpl.java:345

		if (entity == null) {
			throw new BizException(ErrorCode.APP_NOT_FOUND.toError());
		}

		LambdaQueryWrapper<AppVersionEntity> queryWrapper = new LambdaQueryWrapper<>();
		queryWrapper.eq(AppVersionEntity::getAppId, appId)
			.eq(AppVersionEntity::getWorkspaceId, context.getWorkspaceId())
			.ne(AppVersionEntity::getStatus, AppStatus.DELETED.getStatus())
			.orderByDesc(AppVersionEntity::getId)
			.last("limit 1");
		AppVersionEntity versionEntity = appVersionMapper.selectOne(queryWrapper);
		if (versionEntity == null) {
			throw new BizException(ErrorCode.APP_VERSION_NOT_FOUND.toError());
		}

		if (entity.getType() == AppType.BASIC) {
			AgentConfig config = JsonUtils.fromJson(versionEntity.getConfig(), AgentConfig.class);
			if (StringUtils.isBlank(config.getModelProvider())) {
				throw new BizException(ErrorCode.MISSING_PARAMS.toError("model_provider"));
			}

			if (StringUtils.isBlank(config.getModel())) {
				throw new BizException(ErrorCode.MISSING_PARAMS.toError("model"));
			}
		}

		versionEntity.setStatus(AppStatus.PUBLISHED);
		versionEntity.setGmtModified(new Date());
		versionEntity.setModifier(context.getAccountId());
		appVersionMapper.updateById(versionEntity);

		entity.setStatus(AppStatus.PUBLISHED);
		entity.setGmtModified(new Date());
		entity.setModifier(context.getAccountId());
		this.updateById(entity);

		entity.setPublishedVersion(versionEntity);

View on GitHub (pinned to f82da0b50f)

Solutions

  1. Set modelProvider in the app version's AgentConfig (via the Studio UI model picker or by updating the version config) before publishing.
  2. Verify the version config JSON parses to an AgentConfig with a non-blank modelProvider: GET the app version and inspect the config field.
  3. If migrating data, backfill modelProvider for all BASIC app versions (e.g. default to dashscope) then republish.

Example fix

// before (version config JSON)
{"model": "qwen-max"}
// after
{"modelProvider": "dashscope", "model": "qwen-max"}
Defensive patterns

Strategy: validation

Validate before calling

AgentConfig config = JsonUtils.fromJson(versionJson, AgentConfig.class);
if (config == null || StringUtils.isBlank(config.getModelProvider())) {
    throw new IllegalArgumentException("model_provider must be set before publishing");
}

Type guard

boolean hasModelProvider(AgentConfig c) { return c != null && c.getModelProvider() != null && !c.getModelProvider().isBlank(); }

Prevention

When it happens

Trigger: Calling publishApp(appId) on a BASIC app whose latest version's config JSON lacks the modelProvider field or has it empty/whitespace. Typically the app version was created or imported without going through model selection.

Common situations: Importing an app definition from another environment, manually editing the version config JSON, creating app versions via API bypassing the UI wizard, or upgrading from an older schema that did not store modelProvider.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


AI-assisted analysis of alibaba/spring-ai-alibaba@f82da0b50f (2026-09-09). Data as JSON: /api/errors/e7af9fd4e55d3aff. Report an issue: GitHub.