{"record":{"id":"f8ee76b9f75b0daf","repo":"AlistGo/alist","slug":"move-failed-s-f8ee76","errorCode":null,"errorMessage":"move failed: %s","messagePattern":"move failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/guangyapan/driver.go","lineNumber":340,"sourceCode":"\tif err := d.ensureAccessToken(ctx); err != nil {\n\t\treturn err\n\t}\n\n\tfileID := strings.TrimSpace(srcObj.GetID())\n\tif fileID == \"\" {\n\t\treturn errors.New(\"file id is empty\")\n\t}\n\tparentID := dstDir.GetID()\n\n\tvar out deleteResp\n\tif err := d.postAPI(ctx, \"/nd.bizuserres.s/v1/file/move_file\", map[string]any{\n\t\t\"fileIds\":  []string{fileID},\n\t\t\"parentId\": parentID,\n\t}, &out); err != nil {\n\t\treturn err\n\t}\n\tif !strings.EqualFold(strings.TrimSpace(out.Msg), \"success\") {\n\t\treturn fmt.Errorf(\"move failed: %s\", strings.TrimSpace(out.Msg))\n\t}\n\ttaskID := strings.TrimSpace(out.Data.TaskID)\n\tif taskID == \"\" {\n\t\treturn nil\n\t}\n\treturn d.waitTaskDone(ctx, taskID)\n}\n\nfunc (d *GuangYaPan) Copy(ctx context.Context, srcObj, dstDir model.Obj) error {\n\tif err := d.ensureAccessToken(ctx); err != nil {\n\t\treturn err\n\t}\n\n\tfileID := strings.TrimSpace(srcObj.GetID())\n\tif fileID == \"\" {\n\t\treturn errors.New(\"file id is empty\")\n\t}\n\tparentID := dstDir.GetID()","sourceCodeStart":322,"sourceCodeEnd":358,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/guangyapan/driver.go#L322-L358","documentation":"GuangYaPan Move error: /file/move_file returned non-success msg, surfaced as 'move failed: <backend msg>'. On success the driver then polls a taskID; this error indicates the move was rejected before a task was created.","triggerScenarios":"Calling Move where the backend rejects moving the fileIds into parentId: destination not a folder or deleted, file locked by another async task, same source and destination, or permission limits — msg != success.","commonSituations":"Moving into a folder that was just removed; concurrent move/copy of the same file; moving into a shared folder without write rights; destination ID copied from stale cache.","solutions":["Read the backend msg for the exact rejection reason","Refresh the destination listing and confirm parentID is an existing writable folder","Serialize move/copy operations on the same file to avoid backend task locks","Retry after the previous async task on that file completes"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := d.Move(ctx, srcObj, dstDir)\nif err != nil && strings.HasPrefix(err.Error(), \"move failed\") {\n  // inspect backend msg; refresh destination before retrying\n}","preventionTips":["Validate dstDir still exists in a fresh listing right before moving","Serialize move/copy tasks per file to avoid backend lock rejections"],"tags":["guangyapan","move","api","backend-error"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}