{"record":{"id":"19367d5014ad5406","repo":"Tencent/WeKnora","slug":"failed-to-save-downloaded-file-w","errorCode":null,"errorMessage":"failed to save downloaded file: %w","messagePattern":"failed to save downloaded file: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/application/service/knowledge_process.go","lineNumber":3384,"sourceCode":"\n\t\tif resolvedFileName != \"\" && knowledge.FileName == \"\" {\n\t\t\tknowledge.FileName = resolvedFileName\n\t\t}\n\t\tif resolvedFileType != \"\" && knowledge.FileType == \"\" {\n\t\t\tknowledge.FileType = resolvedFileType\n\t\t\ts.repo.UpdateKnowledge(ctx, knowledge)\n\t\t}\n\n\t\tfileSvc := s.resolveFileService(ctx, kb)\n\t\tfilePath, err := fileSvc.SaveBytes(ctx, contentBytes, payload.TenantID, resolvedFileName, true)\n\t\tif err != nil {\n\t\t\tif isLastRetry {\n\t\t\t\tknowledge.ParseStatus = \"failed\"\n\t\t\t\tknowledge.ErrorMessage = err.Error()\n\t\t\t\tknowledge.UpdatedAt = time.Now()\n\t\t\t\ts.repo.UpdateKnowledge(ctx, knowledge)\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"failed to save downloaded file: %w\", err)\n\t\t}\n\n\t\tpayload.FilePath = filePath\n\t\tpayload.FileName = resolvedFileName\n\t\tpayload.FileType = resolvedFileType\n\t\tconvertResult, err = s.convert(ctx, payload, kb, knowledge, eff, isLastRetry)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif convertResult == nil {\n\t\t\treturn nil\n\t\t}\n\t} else if payload.URL != \"\" {\n\t\t// URL import\n\t\tconvertResult, err = s.convert(ctx, payload, kb, knowledge, eff, isLastRetry)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}","sourceCodeStart":3366,"sourceCodeEnd":3402,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/application/service/knowledge_process.go#L3366-L3402","documentation":"Thrown in ProcessDocument when fileSvc.SaveBytes fails to persist the downloaded file bytes to (tenant-resolved) storage before parsing. Fires on storage outage/quota; on the last retry the knowledge is marked failed with the underlying message.","triggerScenarios":"Thrown at internal/application/service/knowledge_process.go:3384 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check object storage availability and tenant credentials/quota","Retry the parse task once storage is healthy","Inspect knowledge.ErrorMessage for the storage-layer cause"],"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"}