AlistGo/alist · error

rename merge: list source folder failed: %w

Error message

rename merge: list source folder failed: %w

What it means

During a Rename of a folder that hits a 409 name conflict, the SJTU driver merges by moving all children into the renamed folder. This error means the List call to enumerate the source folder's children failed, so the rename-merge aborted before moving anything. The wrapped error is the actual List failure.

Source

Thrown at drivers/sjtu_netdisk/driver.go:401

		}

		// 204 means no conflict
		if resp.StatusCode() == http.StatusNoContent {
			return &model.Object{
				Name:     newName,
				Size:     srcObj.GetSize(),
				IsFolder: true,
				Modified: srcObj.ModTime(),
				Ctime:    srcObj.CreateTime(),
				Path:     dstPath,
			}, nil
		}

		// 409 means conflict name
		if resp.StatusCode() == http.StatusConflict {
			children, listErr := d.List(ctx, srcObj, model.ListArgs{})
			if listErr != nil {
				return nil, fmt.Errorf("rename merge: list source folder failed: %w", listErr)
			}

			targetDirObj := &model.Object{Path: dstPath, Name: newName, IsFolder: true}

			for _, child := range children {
				childSrcPath := path.Join(srcObj.GetPath(), child.GetName())

				if child.IsDir() {
					childObj := &model.Object{
						Name: child.GetName(), Path: childSrcPath,
						Size: child.GetSize(), IsFolder: true,
					}
					if _, mergeErr := d.Move(ctx, childObj, targetDirObj); mergeErr != nil {
						return nil, fmt.Errorf("rename merge subfolder %s: %w", child.GetName(), mergeErr)
					}
				} else {
					fileErr := d.moveItem(ctx, childSrcPath, dstPath, child.GetName(), false, "overwrite")
					if fileErr != nil {

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Inspect the wrapped List error for the root cause
  2. Refresh the directory in the AList UI and retry the rename once the source is confirmed present
  3. Avoid renaming folders that are being modified concurrently by other clients
  4. If the target name must be kept, manually merge contents first, then rename an empty folder
Defensive patterns

Strategy: retry

Try / catch

if err != nil && strings.Contains(err.Error(), "rename merge: list source folder failed") {
    refreshDir(parentOf(src))
    return retryRenameOnce()
}

Prevention

When it happens

Trigger: Renaming a folder to a name that already exists at the same level; the follow-up d.List(ctx, srcObj) fails from an expired token, the folder disappearing mid-rename, or a transient API error.

Common situations: Another client deleted or moved the source folder concurrently; token expiry between the rename attempt and the listing; very large folders timing out on list.

Related errors


AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15). Data as JSON: /api/errors/e30b07051f3114f1. Report an issue: GitHub.