{"record":{"id":"e9d0c06163213821","repo":"Tencent/WeKnora","slug":"failed-to-update-knowledge-w","errorCode":null,"errorMessage":"failed to update knowledge: %w","messagePattern":"failed to update knowledge: %w","errorType":"exception","errorClass":null,"httpStatus":500,"severity":"error","filePath":"internal/application/service/knowledge_faq_import.go","lineNumber":2854,"sourceCode":"\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to parse FAQ import result: %w\", err)\n\t}\n\n\tif result == nil {\n\t\treturn werrors.NewNotFoundError(\"no FAQ import result found\")\n\t}\n\n\t// 更新显示状态\n\tresult.DisplayStatus = displayStatus\n\n\t// 保存更新后的结果\n\tif err := faqKnowledge.SetLastFAQImportResult(result); err != nil {\n\t\treturn fmt.Errorf(\"failed to set FAQ import result: %w\", err)\n\t}\n\n\t// 更新数据库\n\tif err := s.repo.UpdateKnowledge(ctx, faqKnowledge); err != nil {\n\t\treturn fmt.Errorf(\"failed to update knowledge: %w\", err)\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":2836,"sourceCodeEnd":2859,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/application/service/knowledge_faq_import.go#L2836-L2859","documentation":"Thrown by UpdateLastFAQImportResultDisplayStatus when repo.UpdateKnowledge fails to persist the knowledge after toggling DisplayStatus on the last FAQ import result. A database write failure at the final step of the status toggle.","triggerScenarios":"Thrown at internal/application/service/knowledge_faq_import.go:2854 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check database connectivity and retry","Ensure the knowledge row was not concurrently modified (optimistic-lock conflict)","Inspect the wrapped error for constraint or timeout causes"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}