AlistGo/alist · error

cannot move folder into itself or its subfolder

Error message

cannot move folder into itself or its subfolder

What it means

checkCircularMove detects that the destination parent equals the source link itself (or is an ancestor chain reaching it), meaning the move would place a folder inside its own subtree — an operation Proton Drive cannot represent. It is a validation guard on the requested srcLinkID/dstParentLinkID pair.

Solutions

  1. Check the storage configuration and the provider's service status, fix the indicated cause, and retry the operation.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at drivers/proton_drive/util.go:907 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at drivers/proton_drive/util.go:907

		return "", err
	}

	newKeyPacket, err := dstKR.EncryptSessionKey(sessionKey)
	if err != nil {
		return "", err
	}

	newSplitMessage := crypto.NewPGPSplitMessage(newKeyPacket, oldSplitMessage.DataPacket)

	return newSplitMessage.GetArmored()
}

func (d *ProtonDrive) checkCircularMove(ctx context.Context, srcLinkID, dstParentLinkID string) error {
	currentLinkID := dstParentLinkID

	for currentLinkID != "" && currentLinkID != d.RootLink.LinkID {
		if currentLinkID == srcLinkID {
			return fmt.Errorf("cannot move folder into itself or its subfolder")
		}

		currentLink, err := d.getLink(ctx, currentLinkID)
		if err != nil {
			return err
		}
		currentLinkID = currentLink.ParentLinkID
	}

	return nil
}

View on GitHub (pinned to 843d9dc814)