{"record":{"id":"e7af9fd4e55d3aff","repo":"alibaba/spring-ai-alibaba","slug":"missingparameter-e7af9f","errorCode":"MissingParameter","errorMessage":"Required parameters [model_provider] missing, please check the request parameters.","messagePattern":"Required parameters \\[model_provider\\] missing, please check the request parameters\\.","errorType":"validation","errorClass":"BizException","httpStatus":400,"severity":"error","filePath":"spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/base/service/impl/AppServiceImpl.java","lineNumber":345,"sourceCode":"\t\tif (entity == null) {\n\t\t\tthrow new BizException(ErrorCode.APP_NOT_FOUND.toError());\n\t\t}\n\n\t\tLambdaQueryWrapper<AppVersionEntity> queryWrapper = new LambdaQueryWrapper<>();\n\t\tqueryWrapper.eq(AppVersionEntity::getAppId, appId)\n\t\t\t.eq(AppVersionEntity::getWorkspaceId, context.getWorkspaceId())\n\t\t\t.ne(AppVersionEntity::getStatus, AppStatus.DELETED.getStatus())\n\t\t\t.orderByDesc(AppVersionEntity::getId)\n\t\t\t.last(\"limit 1\");\n\t\tAppVersionEntity versionEntity = appVersionMapper.selectOne(queryWrapper);\n\t\tif (versionEntity == null) {\n\t\t\tthrow new BizException(ErrorCode.APP_VERSION_NOT_FOUND.toError());\n\t\t}\n\n\t\tif (entity.getType() == AppType.BASIC) {\n\t\t\tAgentConfig config = JsonUtils.fromJson(versionEntity.getConfig(), AgentConfig.class);\n\t\t\tif (StringUtils.isBlank(config.getModelProvider())) {\n\t\t\t\tthrow new BizException(ErrorCode.MISSING_PARAMS.toError(\"model_provider\"));\n\t\t\t}\n\n\t\t\tif (StringUtils.isBlank(config.getModel())) {\n\t\t\t\tthrow new BizException(ErrorCode.MISSING_PARAMS.toError(\"model\"));\n\t\t\t}\n\t\t}\n\n\t\tversionEntity.setStatus(AppStatus.PUBLISHED);\n\t\tversionEntity.setGmtModified(new Date());\n\t\tversionEntity.setModifier(context.getAccountId());\n\t\tappVersionMapper.updateById(versionEntity);\n\n\t\tentity.setStatus(AppStatus.PUBLISHED);\n\t\tentity.setGmtModified(new Date());\n\t\tentity.setModifier(context.getAccountId());\n\t\tthis.updateById(entity);\n\n\t\tentity.setPublishedVersion(versionEntity);","sourceCodeStart":327,"sourceCodeEnd":363,"githubUrl":"https://github.com/alibaba/spring-ai-alibaba/blob/f82da0b50f35744c13968191be2b1cd2452ef550/spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/base/service/impl/AppServiceImpl.java#L327-L363","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Set modelProvider in the app version's AgentConfig (via the Studio UI model picker or by updating the version config) before publishing.","Verify the version config JSON parses to an AgentConfig with a non-blank modelProvider: GET the app version and inspect the config field.","If migrating data, backfill modelProvider for all BASIC app versions (e.g. default to dashscope) then republish."],"exampleFix":"// before (version config JSON)\n{\"model\": \"qwen-max\"}\n// after\n{\"modelProvider\": \"dashscope\", \"model\": \"qwen-max\"}","handlingStrategy":"validation","validationCode":"AgentConfig config = JsonUtils.fromJson(versionJson, AgentConfig.class);\nif (config == null || StringUtils.isBlank(config.getModelProvider())) {\n    throw new IllegalArgumentException(\"model_provider must be set before publishing\");\n}","typeGuard":"boolean hasModelProvider(AgentConfig c) { return c != null && c.getModelProvider() != null && !c.getModelProvider().isBlank(); }","tryCatchPattern":null,"preventionTips":["Always populate modelProvider when creating app versions","Validate AgentConfig fields before publishing","Backfill config schema on upgrades"],"tags":["app-publish","missing-parameter","config"],"backgroundTag":"missing-required-config-field","analyzedSha":"f82da0b50f35744c13968191be2b1cd2452ef550","analyzedAt":"2026-09-09T15:32:42.421Z","contentChangedAt":"2026-09-09T15:32:42.421Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}