{"record":{"id":"2a1b414428e50bfb","repo":"iflytek/astron-agent","slug":"workflow-version-publish-failed-2a1b41","errorCode":"WORKFLOW_VERSION_PUBLISH_FAILED","errorMessage":"WORKFLOW_VERSION_PUBLISH_FAILED","messagePattern":"WORKFLOW_VERSION_PUBLISH_FAILED","errorType":"error_code","errorClass":"BusinessException","httpStatus":null,"severity":"error","filePath":"console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/publish/impl/ReleaseManageClientServiceImpl.java","lineNumber":57,"sourceCode":"\n        WorkflowVersion query = new WorkflowVersion();\n        query.setFlowId(flowId);\n        ApiResult<JSONObject> response = versionService.getVersionNameForBoundBotPublish(query);\n        JSONObject data = response == null ? null : response.data();\n        String versionName = data == null ? null : data.getString(\"workflowVersionName\");\n        if (response == null || response.code() != 0 || StrUtil.isBlank(versionName)) {\n            log.error(\"getVersionNameByBotId - Failed to get version name, botId={}, flowId={}, spaceId={}\",\n                    botId, flowId, spaceId);\n            throw new BusinessException(ResponseEnum.WORKFLOW_VERSION_GET_NAME_FAILED);\n        }\n        return versionName;\n    }\n\n    @Override\n    public void releaseBotApi(Integer botId, String flowId, String versionName, String executionUid,\n            Long spaceId, HttpServletRequest request) {\n        if (botId == null || StrUtil.isBlank(flowId) || StrUtil.isBlank(versionName)) {\n            throw new BusinessException(ResponseEnum.WORKFLOW_VERSION_PUBLISH_FAILED);\n        }\n        String boundFlowId = userLangChainDataService.findFlowIdByBotId(botId);\n        if (!StrUtil.equals(boundFlowId, flowId)) {\n            log.error(\"releaseBotApi - FlowId does not match bot binding, botId={}, flowId={}, boundFlowId={}\",\n                    botId, flowId, boundFlowId);\n            throw new BusinessException(ResponseEnum.WORKFLOW_VERSION_PUBLISH_FAILED);\n        }\n\n        WorkflowVersion workflowVersion = new WorkflowVersion();\n        workflowVersion.setBotId(botId.toString());\n        workflowVersion.setFlowId(flowId);\n        workflowVersion.setPublishChannel(Long.valueOf(ReleaseTypeEnum.BOT_API.getCode()));\n        workflowVersion.setPublishResult(RELEASE_SUCCESS);\n        workflowVersion.setDescription(\"\");\n        workflowVersion.setName(versionName);\n\n        ApiResult<JSONObject> response = versionService.createForBoundBotPublish(\n                workflowVersion, executionUid, spaceId);","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/publish/impl/ReleaseManageClientServiceImpl.java#L39-L75","documentation":"WORKFLOW_VERSION_PUBLISH_FAILED is thrown when releasing a bot API fails validation of the publish request. In releaseBotApi it is thrown when required parameters (botId, flowId, versionName) are missing or blank. It signals the workflow version could not even be initiated because the request was malformed.","triggerScenarios":"Calling releaseBotApi with a null botId, an empty/whitespace flowId, or an empty/whitespace versionName.","commonSituations":"Frontend submit buttons that post incomplete publish forms; API integrations omitting versionName; deserialization dropping null/blank fields; bots created without a bound flow.","solutions":["Check that botId, flowId and versionName are all non-null and non-blank before calling releaseBotApi","Verify the publish request payload from the client includes all three fields","Trace upstream to the controller that invokes releaseBotApi and log the incoming request"],"exampleFix":"// before\nreleaseBotApi(null, \"\", \"v1\", uid, spaceId, request);\n// after\nif (botId != null && StrUtil.isNotBlank(flowId) && StrUtil.isNotBlank(versionName)) {\n    releaseBotApi(botId, flowId, versionName, uid, spaceId, request);\n}","handlingStrategy":"validation","validationCode":"if (botId == null || flowId == null || flowId.isBlank() || versionName == null || versionName.isBlank()) { throw new IllegalArgumentException(\"botId, flowId and versionName are required\"); }","typeGuard":null,"tryCatchPattern":"try { releaseBotApi(botId, flowId, versionName, uid, spaceId, request); } catch (BusinessException e) { if (\"WORKFLOW_VERSION_PUBLISH_FAILED\".equals(e.getMessage())) { /* show field-required validation error */ } }","preventionTips":["Validate required fields at the controller/DTO layer with @NotNull/@NotBlank","Disable the publish button until all required fields are filled in the UI","Add unit tests covering blank-parameter cases"],"tags":["validation","workflow","publish"],"backgroundTag":"missing-required-argument","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}