{"record":{"id":"01216f06866406cf","repo":"AlistGo/alist","slug":"the-task-has-been-deleted-01216f","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/pikpak/pikpak.go","lineNumber":136,"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 = fmt.Errorf(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(&PikPak{})\n}\n","sourceCodeStart":118,"sourceCodeEnd":143,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/internal/offline_download/pikpak/pikpak.go#L118-L143","documentation":"PikPak.Status() initializes a status with the terminal message 'the task has been deleted' and only overwrites it when the task's ID is found in the cached task list. If the loop finishes without a match, that status (with s.Err set) is returned as-is, marking the task finished-with-error. The task no longer exists on PikPak's side.","triggerScenarios":"The remote PikPak offline task was deleted (web UI, expiry, or another client) while the local record still polls it; GetTasks cache returned a list that does not contain task.GID.","commonSituations":"Users cleaning up their PikPak download list from the phone app; tasks whose IDs changed after account re-linking; finished tasks auto-purged by the platform.","solutions":["Accept the terminal status: remove the local task record since the remote task is gone","If the download is still needed, re-add the URL to create a fresh task","After re-linking the PikPak account, clear stale task records whose GIDs reference the old account"],"exampleFix":"// caller handling\ns, err := p.Status(task)\nif err == nil && s.Err != nil && strings.Contains(s.Err.Error(), \"has been deleted\") {\n    // terminal: remote task no longer exists\n    _ = deleteLocalTask(task.ID)\n}","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"s, err := p.Status(task)\nif err != nil {\n    return err\n}\nif s.Err != nil && strings.Contains(s.Err.Error(), \"has been deleted\") {\n    // terminal: remote task gone, remove local record and stop\n    markCompletedAndCleanup(task)\n}","preventionTips":["Check s.Err as well as err — this tool reports deletion via s.Err","Do not delete PikPak tasks from other clients while OpenList tracks them","Clear task records when re-linking the PikPak account"],"tags":["pikpak","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"}