{"record":{"id":"842875a2327fc873","repo":"AlistGo/alist","slug":"copy-failed-s-842875","errorCode":null,"errorMessage":"copy failed: %s","messagePattern":"copy failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/guangyapan/driver.go","lineNumber":368,"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/copy_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(\"copy 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) Put(ctx context.Context, dstDir model.Obj, file model.FileStreamer, up driver.UpdateProgress) error {\n\tif err := d.ensureAccessToken(ctx); err != nil {\n\t\treturn err\n\t}\n\tif file == nil {\n\t\treturn errors.New(\"file is nil\")\n\t}\n\tif file.GetSize() < 0 {\n\t\treturn errors.New(\"invalid file size\")\n\t}","sourceCodeStart":350,"sourceCodeEnd":386,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/guangyapan/driver.go#L350-L386","documentation":"GuangYaPan Copy error: /file/copy_file returned non-success msg, surfaced as 'copy failed: <backend msg>'. Like Move, a successful copy returns a taskID which the driver polls; this error means the copy request itself was refused.","triggerScenarios":"Calling Copy where the backend rejects it: insufficient storage quota for the duplicate, destination invalid or read-only, file locked by a concurrent task, or too many files in the copy batch — msg != success.","commonSituations":"Account storage full so the duplicate cannot be created; copying into a deleted/stale destination folder; concurrent copy/move of the same source file; share-based destination without write permission.","solutions":["Read the backend msg — quota vs permission vs not-found have different fixes","Free space or choose a different destination if quota is the cause","Refresh destination listing and confirm write permission before copying","Retry once other server-side tasks on the source file complete"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := d.Copy(ctx, srcObj, dstDir)\nif err != nil && strings.HasPrefix(err.Error(), \"copy failed\") {\n  if strings.Contains(err.Error(), \"space\") || strings.Contains(err.Error(), \"空间\") {\n    // quota: stop and notify user instead of retrying\n  }\n}","preventionTips":["Check available storage before large copies","Confirm write access on the destination folder before queuing copies"],"tags":["guangyapan","copy","api","backend-error"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}