AlistGo/alist · error
copy merge subfolder %s: %w
Error message
copy merge subfolder %s: %w
What it means
During a copy-merge in the SJTU driver, recursively copying one child subfolder into the target failed. The message names the subfolder; the wrapped error is the recursive Copy failure (auth, 5xx, or deeper merge error).
Source
Thrown at drivers/sjtu_netdisk/driver.go:516
targetDirObj := &model.Object{
Path: targetPath,
Name: srcObj.GetName(),
IsFolder: true,
}
for _, child := range children {
childSrcPath := path.Join(srcPath, child.GetName())
if child.IsDir() {
childObj := &model.Object{
Name: child.GetName(),
Path: childSrcPath,
Size: child.GetSize(),
IsFolder: true,
}
if _, mergeErr := d.Copy(ctx, childObj, targetDirObj); mergeErr != nil {
return nil, fmt.Errorf("copy merge subfolder %s: %w", child.GetName(), mergeErr)
}
} else {
childEncoded := d.encodePath(path.Join(targetPath, child.GetName()))
childURL := fmt.Sprintf("%s/file/%s/%s/%s", API_URL, d.libraryId, d.spaceId, childEncoded)
if _, fileErr := d.newClient().R().
SetContext(ctx).
SetQueryParam("access_token", d.accessToken).
SetQueryParam("conflict_resolution_strategy", "overwrite").
SetBody(map[string]interface{}{"copyFrom": childSrcPath}).
Execute(http.MethodPut, childURL); fileErr != nil {
return nil, fmt.Errorf("copy merge file %s: %w", child.GetName(), fileErr)
}
}
}
return &model.Object{
Name: srcObj.GetName(),
Size: srcObj.GetSize(),View on GitHub (pinned to 843d9dc814)
Solutions
- Retry the copy of the named subfolder in isolation
- Check the wrapped error (auth, quota, permission) and remediate
- Verify quota on the destination space before copying large trees
- Split large copies into per-subfolder operations
Defensive patterns
Strategy: retry
Try / catch
if err != nil && strings.Contains(err.Error(), "copy merge subfolder") {
sub := extractSubfolderName(err)
return copySingleSubfolder(ctx, sub) // resumes the merge
} Prevention
- Check destination quota before large copies
- Retry from the named subfolder; earlier children are already copied
- Keep auth fresh during long-running copies
When it happens
Trigger: Copy folder onto an existing name triggers the merge loop; d.Copy(childObj, targetDirObj) errors for one subfolder.
Common situations: Deep trees where one failing branch aborts the entire copy; token expiry during long copies; destination quota exceeded partway.
Related errors
- copy merge: list source folder failed: %w
- merge: list source folder failed: %w
- merge subfolder %s: %w
- rename merge: list source folder failed: %w
- rename merge subfolder %s: %w
AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15).
Data as JSON: /api/errors/d362f03f35e5b3dd.
Report an issue: GitHub.