{"record":{"id":"90fabb95408b9a46","repo":"iflytek/astron-agent","slug":"workflow-feedback-failed","errorCode":"WORKFLOW_FEEDBACK_FAILED","errorMessage":"WORKFLOW_FEEDBACK_FAILED","messagePattern":"WORKFLOW_FEEDBACK_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":5594,"sourceCode":"            throw new BusinessException(ResponseEnum.WORKFLOW_NOT_EXIST);\n        }\n        assertTopLevelWorkflowExecutableByCurrentUser(workflow);\n        return workflow;\n    }\n\n    public void feedback(WorkflowFeedbackReq workflowFeedbackReq, HttpServletRequest request) {\n        try {\n            WorkflowFeedback workflowFeedback = new WorkflowFeedback();\n            BeanUtils.copyProperties(workflowFeedbackReq, workflowFeedback);\n            String uid = RequestContextUtil.getUID();\n            UserInfo userInfo = userInfoDataService.findByUid(uid).orElseThrow();\n            workflowFeedback.setUserName(userInfo.getNickname());\n            workflowFeedback.setUid(uid);\n            workflowFeedback.setCreateTime(new Date());\n            workflowFeedbackMapper.insert(workflowFeedback);\n        } catch (Exception ex) {\n            log.error(\"Workflow feedback failed, sid={}, error={}\", workflowFeedbackReq.getSid(), ex.getMessage(), ex);\n            throw new BusinessException(ResponseEnum.WORKFLOW_FEEDBACK_FAILED);\n        }\n\n    }\n\n    public List<WorkflowFeedback> getFeedbackList(String flowId) {\n        return workflowFeedbackMapper.selectList(Wrappers.lambdaQuery(WorkflowFeedback.class)\n                .eq(WorkflowFeedback::getFlowId, flowId)\n                .eq(WorkflowFeedback::getUid, UserInfoManagerHandler.getUserId())\n                .orderByDesc(WorkflowFeedback::getCreateTime));\n    }\n\n    private static void dealWithSearchPromptTemplate(String search, LambdaQueryWrapper<PromptTemplate> wrapper) {\n        try {\n            String decode = URLDecoder.decode(search, StandardCharsets.UTF_8.name());\n            String escaped = decode\n                    .replace(\"\\\\\", \"\\\\\\\\\")\n                    .replace(\"_\", \"\\\\_\")\n                    .replace(\"%\", \"\\\\%\");","sourceCodeStart":5576,"sourceCodeEnd":5612,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/workflow/WorkflowService.java#L5576-L5612","documentation":"This error is thrown by WorkflowService when persisting a user's workflow feedback fails. The service inserts a WorkflowFeedback record (with user info and create time) via workflowFeedbackMapper.insert(); any exception during that DB write is caught, logged with the sid, and rethrown as a generic WORKFLOW_FEEDBACK_FAILED BusinessException, so the original cause is hidden unless you check the logs.","triggerScenarios":"Calling the workflow feedback submission API when workflowFeedbackMapper.insert(workflowFeedback) throws — e.g. DB connection failure, duplicate/invalid sid, column constraint violation, or feedback payload exceeding column length.","commonSituations":"Database down or connection pool exhausted during feedback submission; feedback text longer than the DB column; missing required NOT NULL field in WorkflowFeedbackReq; schema drift between entity and table after a migration.","solutions":["Check the service logs for 'Workflow feedback failed, sid=...' to see the underlying exception message","Verify the database is reachable and the workflow_feedback table exists and matches the entity schema","Check that required fields in the feedback request (sid, content) are present and within column length limits","Retry the feedback submission after fixing DB/connectivity issues"],"exampleFix":"// before: insert without pre-validation\nworkflowFeedbackMapper.insert(workflowFeedback);\n// after: validate length before insert\nif (workflowFeedback.getContent() != null && workflowFeedback.getContent().length() > MAX_FEEDBACK_LENGTH) {\n    throw new BusinessException(ResponseEnum.WORKFLOW_QUERY_LENGTH_OUTRANGE);\n}\nworkflowFeedbackMapper.insert(workflowFeedback);","handlingStrategy":"try-catch","validationCode":"if (req.getSid() == null || req.getSid().isBlank()) throw new IllegalArgumentException(\"sid is required\");\nif (req.getContent() != null && req.getContent().length() > 500) throw new IllegalArgumentException(\"feedback content too long\");","typeGuard":null,"tryCatchPattern":"try {\n    workflowService.submitFeedback(req);\n} catch (BusinessException e) {\n    if (\"WORKFLOW_FEEDBACK_FAILED\".equals(e.getCode())) {\n    // show retryable error to user; check server logs for root cause\n    }\n}","preventionTips":["Validate required fields (sid, content length) client-side before submission","Ensure DB schema and entity stay in sync via migration checks","Monitor DB connectivity and pool saturation metrics"],"tags":["database","mybatis","workflow"],"backgroundTag":"database-write-failed","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"}