{"record":{"id":"8489ba604146772b","repo":"AlistGo/alist","slug":"the-task-has-been-deleted-8489ba","errorCode":null,"errorMessage":"the task has been deleted","messagePattern":"the task has been deleted","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/offline_download/thunder/thunder.go","lineNumber":137,"sourceCode":"\t\tStatus:    \"the task has been deleted\",\n\t\tErr:       nil,\n\t}\n\tfor _, t := range tasks {\n\t\tif t.ID == task.GID {\n\t\t\ts.Progress = float64(t.Progress)\n\t\t\ts.Status = t.Message\n\t\t\ts.Completed = (t.Phase == \"PHASE_TYPE_COMPLETE\")\n\t\t\ts.TotalBytes, err = strconv.ParseInt(t.FileSize, 10, 64)\n\t\t\tif err != nil {\n\t\t\t\ts.TotalBytes = 0\n\t\t\t}\n\t\t\tif t.Phase == \"PHASE_TYPE_ERROR\" {\n\t\t\t\ts.Err = errors.New(t.Message)\n\t\t\t}\n\t\t\treturn s, nil\n\t\t}\n\t}\n\ts.Err = fmt.Errorf(\"the task has been deleted\")\n\treturn s, nil\n}\n\nfunc init() {\n\ttool.Tools.Add(&Thunder{})\n}\n","sourceCodeStart":119,"sourceCodeEnd":144,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/internal/offline_download/thunder/thunder.go#L119-L144","documentation":"Thunder.Status() returns a status pre-seeded with 'the task has been deleted' and s.Err set; it is only replaced when task.GID is found among the remote Thunder tasks. A fall-through return therefore marks the task as terminally failed because it no longer exists on Thunder's side.","triggerScenarios":"The Thunder offline task was deleted remotely (app/web cleanup), expired, or belongs to a re-linked account whose task IDs no longer match task.GID.","commonSituations":"Users deleting downloads from the Xunlei app; account re-login invalidating old task IDs; the platform pruning completed tasks after retention.","solutions":["Treat the terminal status as final and remove the local task record","Re-add the URL if the content is still required","Clear stale task records after re-authenticating the Thunder storage"],"exampleFix":"s, err := t.Status(task)\nif err == nil && s.Err != nil && strings.Contains(s.Err.Error(), \"has been deleted\") {\n    _ = deleteLocalTask(task.ID) // remote task gone, stop polling\n}","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"s, err := t.Status(task)\nif err != nil {\n    return err\n}\nif s.Err != nil && strings.Contains(s.Err.Error(), \"has been deleted\") {\n    markCompletedAndCleanup(task)\n}","preventionTips":["Check s.Err alongside err — deletion is reported via the status object","Avoid deleting tasks in the Xunlei app while tracked here","Clear stale records after Thunder account re-login"],"tags":["thunder","task-not-found","terminal-state","offline-download"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}