{"record":{"id":"74dcd8493200e748","repo":"AlistGo/alist","slug":"the-task-has-been-deleted","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/guangyapan/guangyapan.go","lineNumber":125,"sourceCode":"\t\treturn nil, err\n\t}\n\tstatus := &tool.Status{\n\t\tStatus: \"the task has been deleted\",\n\t}\n\tfor _, t := range tasks {\n\t\tif t.TaskID != task.GID {\n\t\t\tcontinue\n\t\t}\n\t\tstatus.Progress = float64(t.Progress)\n\t\tstatus.TotalBytes = t.TotalSize\n\t\tstatus.Completed = t.Status == offlineStatusCompleted || t.Status == offlineStatusPartiallyCompleted\n\t\tstatus.Status = taskStatusText(t)\n\t\tif t.Status == offlineStatusFailed || t.Status == offlineStatusCanceled {\n\t\t\tstatus.Err = errors.New(status.Status)\n\t\t}\n\t\treturn status, nil\n\t}\n\tstatus.Err = errors.New(\"the task has been deleted\")\n\treturn status, nil\n}\n\nfunc init() {\n\ttool.Tools.Add(&GuangYaPan{})\n}\n","sourceCodeStart":107,"sourceCodeEnd":132,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/internal/offline_download/guangyapan/guangyapan.go#L107-L132","documentation":"When Status polls the provider with GetTasks(driver, task.GID) and the loop finds no task whose TaskID matches the GID, the task is assumed deleted server-side. The default status text 'the task has been deleted' is also used as the error. This is a synthesized terminal state, not a transport error.","triggerScenarios":"The provider's task list no longer contains the GID: task expired, was purged by the provider, or was deleted via DeleteOfflineTasks while the local record still exists. Also if the task cache was refreshed and the GID never appears.","commonSituations":"Provider prunes completed/failed tasks after a retention window; a race between Remove and Status; or GID mismatch after re-adding a task.","solutions":["Treat as terminal: remove the local task record (it cannot be resumed)","If the file was expected to exist, verify the destination directory for the downloaded output before cleanup","If tasks vanish immediately, check that the GID recorded at AddURL time matches the provider's TaskID format"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if st.Err != nil && st.Status == \"the task has been deleted\" {\n    // provider no longer knows this GID: terminal, clean up local state\n    dropTaskRecord(task.GID)\n    return\n}","preventionTips":["Persist both GID and TempDir so missing tasks are traceable","Verify provider task retention windows if tasks vanish quickly","Handle the deleted-task text as a first-class terminal state in your poller"],"tags":["offline-download","guangyapan","task-missing"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}