{"record":{"id":"991484491a12d356","repo":"AlistGo/alist","slug":"copy-merge-list-source-folder-failed-w","errorCode":null,"errorMessage":"copy merge: list source folder failed: %w","messagePattern":"copy merge: list source folder failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/sjtu_netdisk/driver.go","lineNumber":496,"sourceCode":"\t} else {\n\t\t// folder copy\n\t\tinfoURL := fmt.Sprintf(\"%s/directory/%s/%s/%s\", API_URL, d.libraryId, d.spaceId, d.encodePath(targetPath))\n\n\t\tresp, err := d.newClient().R().\n\t\t\tSetContext(ctx).\n\t\t\tSetQueryParam(\"access_token\", d.accessToken).\n\t\t\tSetQueryParam(\"conflict_resolution_strategy\", \"ask\").\n\t\t\tSetBody(map[string]interface{}{\"copyFrom\": srcPath}).\n\t\t\tExecute(http.MethodPut, infoURL)\n\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif resp.StatusCode() == http.StatusConflict {\n\t\t\tchildren, listErr := d.List(ctx, srcObj, model.ListArgs{})\n\t\t\tif listErr != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"copy merge: list source folder failed: %w\", listErr)\n\t\t\t}\n\n\t\t\ttargetDirObj := &model.Object{\n\t\t\t\tPath:     targetPath,\n\t\t\t\tName:     srcObj.GetName(),\n\t\t\t\tIsFolder: true,\n\t\t\t}\n\n\t\t\tfor _, child := range children {\n\t\t\t\tchildSrcPath := path.Join(srcPath, child.GetName())\n\n\t\t\t\tif child.IsDir() {\n\t\t\t\t\tchildObj := &model.Object{\n\t\t\t\t\t\tName:     child.GetName(),\n\t\t\t\t\t\tPath:     childSrcPath,\n\t\t\t\t\t\tSize:     child.GetSize(),\n\t\t\t\t\t\tIsFolder: true,\n\t\t\t\t\t}","sourceCodeStart":478,"sourceCodeEnd":514,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/sjtu_netdisk/driver.go#L478-L514","documentation":"During a folder Copy that got 409 (target name exists), the SJTU driver merges by copying each child. This error means the List call to enumerate the source children failed, aborting the copy-merge before any child was copied. The wrapped error is the real List failure.","triggerScenarios":"Copy folder onto an existing folder of the same name; the subsequent d.List(ctx, srcObj) errors (expired token, source removed mid-copy, transient failure).","commonSituations":"Source folder deleted or moved by another client during the copy; token expiry mid-operation; very large source folders timing out on listing.","solutions":["Inspect the wrapped error for the root cause","Confirm the source folder still exists and lists in the AList UI, then retry","Avoid concurrent modifications of the source while copying","For huge folders, copy subfolders individually"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"copy merge: list source folder failed\") {\n    refreshDir(srcParent)\n    return retryCopyOnce()\n}","preventionTips":["Do not delete or move the source while copying","Confirm source lists correctly before copying onto an existing name","Copy large trees per-subfolder"],"tags":["sjtu-netdisk","copy","merge","recursion"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}