AlistGo/alist · error

路径冲突: 路径 '%s' 被多个不同的分享ID使用: %s

Error message

路径冲突: 路径 '%s' 被多个不同的分享ID使用: %s

What it means

During initShareList, _detectPathConflicts found two different share_ids assigned to the exact same mount path in share_ids. The virtual tree would be ambiguous, so startup aborts, listing the colliding ids in the message (Chinese: 'path conflict: path is used by multiple different share ids').

Source

Thrown at drivers/doubao_share/util.go:274

		// 添加到路径映射
		shareConfigs[sharePath] = shareId
	}

	return shareConfigs, rootShares, nil
}

// 检测路径冲突
func (d *DoubaoShare) _detectPathConflicts(shareConfigs map[string]string) error {
	// 检查直接路径冲突
	pathToShareIds := make(map[string][]string)
	for sharePath, id := range shareConfigs {
		pathToShareIds[sharePath] = append(pathToShareIds[sharePath], id)
	}

	for sharePath, ids := range pathToShareIds {
		if len(ids) > 1 {
			return fmt.Errorf("路径冲突: 路径 '%s' 被多个不同的分享ID使用: %s",
				sharePath, strings.Join(ids, ", "))
		}
	}

	// 检查层次冲突
	for path1, id1 := range shareConfigs {
		for path2, id2 := range shareConfigs {
			if path1 == path2 || id1 == id2 {
				continue
			}

			// 检查前缀冲突
			if strings.HasPrefix(path2, path1+"/") || strings.HasPrefix(path1, path2+"/") {
				return fmt.Errorf("路径冲突: 路径 '%s' (ID: %s) 与路径 '%s' (ID: %s) 存在层次冲突",
					path1, id1, path2, id2)
			}
		}
	}

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Deduplicate: give each share id a unique mount path (e.g., 'docs|111' and 'docs-old|222') or delete the stale line.
  2. To mount the same share twice at one path, that is not supported — remove one.
  3. After editing share_ids, refresh/restart the storage so initShareList re-validates.

Example fix

# before
docs|7412365891
docs|7412399887

# after
docs|7412365891
archive|7412399887
Defensive patterns

Strategy: validation

Validate before calling

seen := map[string]string{} // path -> share id
for _, line := range lines {
    path, id := splitShareLine(line)
    if prev, ok := seen[path]; ok && prev != id {
        return fmt.Errorf("duplicate mount path %q used by %s and %s", path, prev, id)
    }
    seen[path] = id
}

Prevention

When it happens

Trigger: share_ids contains two lines like 'docs|111' and 'docs|222' — same left-hand path, different share ids. Fires at mount initialization or refresh, before any listing.

Common situations: Copying a line and pasting a new share id but forgetting to change the path; consolidating shares and leaving the old entry; typos where the path was meant to differ ('docs' vs 'docs2').

Related errors


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