{"record":{"id":"0567c50d760cc424","repo":"iflytek/astron-agent","slug":"prompt-group-save-failed","errorCode":"PROMPT_GROUP_SAVE_FAILED","errorMessage":"PROMPT_GROUP_SAVE_FAILED","messagePattern":"PROMPT_GROUP_SAVE_FAILED","errorType":"error_code","errorClass":"BusinessException","httpStatus":null,"severity":"error","filePath":"console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/workflow/WorkflowService.java","lineNumber":5132,"sourceCode":"    }\n\n    public Object addComparisons(WorkflowComparisonReq workflowComparisonReq) {\n        try {\n            // A comparison row is later addressed only by workflow group + caller-supplied version.\n            // Authorize the top-level workflow before creating that executable snapshot.\n            loadWorkflowForDebugExecution(workflowComparisonReq.getFlowId());\n            // Workflow protocol conversion\n            WorkflowReq workflowReq = new WorkflowReq();\n            workflowReq.setData(workflowComparisonReq.getData());\n            workflowReq.setName(workflowComparisonReq.getName());\n            FlowProtocol protocol = buildWorkflowData(workflowReq, workflowComparisonReq.getFlowId());\n            // Call core system to add comparison group protocol\n            coreSystemService.addComparisons(protocol, workflowComparisonReq.getFlowId(), workflowComparisonReq.getVersion());\n        } catch (BusinessException ex) {\n            throw ex;\n        } catch (Exception ex) {\n            log.error(\"Failed to add comparison group protocol, flowId={}, version={}, error={}\", workflowComparisonReq.getFlowId(), workflowComparisonReq.getVersion(), ex.getMessage(), ex);\n            throw new BusinessException(ResponseEnum.PROMPT_GROUP_SAVE_FAILED);\n        }\n        return ApiResult.success();\n    }\n\n    public Object deleteComparisons(WorkflowComparisonReq workflowComparisonReq) {\n        try {\n            requireOwnedWorkflow(workflowComparisonReq.getFlowId());\n            // Call core system to delete comparison group protocol\n            coreSystemService.deleteComparisons(workflowComparisonReq.getFlowId(), workflowComparisonReq.getVersion());\n        } catch (BusinessException ex) {\n            throw ex;\n        } catch (Exception ex) {\n            log.error(\"Failed to delete comparison group protocol, flowId={}, version={}, error={}\", workflowComparisonReq.getFlowId(), workflowComparisonReq.getVersion(), ex.getMessage(), ex);\n            throw new BusinessException(ResponseEnum.RESPONSE_FAILED, \"Failed to delete comparison group protocol: \" + ex.getMessage());\n        }\n        return ApiResult.success();\n    }\n","sourceCodeStart":5114,"sourceCodeEnd":5150,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/workflow/WorkflowService.java#L5114-L5150","documentation":"Generic failure wrapper for WorkflowService.addComparisons: any non-BusinessException thrown while calling coreSystemService.addComparisons (the core system that persists the comparison-group protocol) is converted to PROMPT_GROUP_SAVE_FAILED. BusinessException from the core path is rethrown unchanged; everything else is masked behind this stable business code.","triggerScenarios":"The remote call coreSystemService.addComparisons throws — core service unreachable, core returned an error, network timeout, or a serialization/DB error inside the core system while saving the comparison protocol for the given flowId/version.","commonSituations":"Core workflow service is down or being redeployed; wrong core-system base URL configured for this environment; core rejects the protocol payload; transient network failure between console backend and core.","solutions":["Read the server log line 'Failed to add comparison group protocol' for the wrapped root-cause exception.","Verify the core service is up and reachable (health check, configured endpoint).","Retry the addComparisons call after fixing the root cause; if persistent, fix the core-side error indicated in the log."],"exampleFix":"// before\ncoreSystemService.addComparisons(protocol, flowId, version);\n// after\ntry {\n    coreSystemService.addComparisons(protocol, flowId, version);\n} catch (BusinessException e) {\n    throw e;\n} catch (Exception e) {\n    log.error(\"addComparisons failed flowId={} version={}\", flowId, version, e);\n    throw new BusinessException(ResponseEnum.PROMPT_GROUP_SAVE_FAILED);\n}","handlingStrategy":"try-catch","validationCode":"boolean coreHealthy = coreHealthEndpoint.ping(); // check core service reachability first\nif (!coreHealthy) throw new IllegalStateException(\"core service unavailable\");","typeGuard":null,"tryCatchPattern":"try {\n    workflowService.addComparisons(req);\n} catch (BusinessException e) {\n    if (\"PROMPT_GROUP_SAVE_FAILED\".equals(e.getCode())) {\n        // retry with backoff; inspect server logs for root cause\n    } else { throw e; }\n}","preventionTips":["Monitor core-system endpoint health and latency.","Configure and verify the core base URL per environment.","Retry idempotent adds with exponential backoff on transient failures."],"tags":["java","workflow","upstream","save-failed"],"backgroundTag":"upstream-api-error","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}