{"record":{"id":"995acf9ece16493e","repo":"AlistGo/alist","slug":"s-id-s-s-id-s","errorCode":null,"errorMessage":"路径冲突: 路径 '%s' (ID: %s) 与路径 '%s' (ID: %s) 存在层次冲突","messagePattern":"路径冲突: 路径 '(.+?)' \\(ID: (.+?)\\) 与路径 '(.+?)' \\(ID: (.+?)\\) 存在层次冲突","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/doubao_share/util.go","lineNumber":288,"sourceCode":"\t}\n\n\tfor sharePath, ids := range pathToShareIds {\n\t\tif len(ids) > 1 {\n\t\t\treturn fmt.Errorf(\"路径冲突: 路径 '%s' 被多个不同的分享ID使用: %s\",\n\t\t\t\tsharePath, strings.Join(ids, \", \"))\n\t\t}\n\t}\n\n\t// 检查层次冲突\n\tfor path1, id1 := range shareConfigs {\n\t\tfor path2, id2 := range shareConfigs {\n\t\t\tif path1 == path2 || id1 == id2 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// 检查前缀冲突\n\t\t\tif strings.HasPrefix(path2, path1+\"/\") || strings.HasPrefix(path1, path2+\"/\") {\n\t\t\t\treturn fmt.Errorf(\"路径冲突: 路径 '%s' (ID: %s) 与路径 '%s' (ID: %s) 存在层次冲突\",\n\t\t\t\t\tpath1, id1, path2, id2)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// 构建树形结构\nfunc (d *DoubaoShare) _buildTreeStructure(shareConfigs map[string]string, rootShares []string) map[string]*RootFileList {\n\trootMap := make(map[string]*RootFileList)\n\n\t// 添加所有分享节点\n\tfor sharePath, shareId := range shareConfigs {\n\t\tchildren := make([]RootFileList, 0)\n\t\trootMap[sharePath] = &RootFileList{\n\t\t\tShareID:     shareId,\n\t\t\tVirtualPath: sharePath,","sourceCodeStart":270,"sourceCodeEnd":306,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/doubao_share/util.go#L270-L306","documentation":"The second conflict check in _detectPathConflicts: two different share ids are mounted at paths where one is a directory-ancestor of the other (e.g., 'docs' and 'docs/books'). Nesting distinct shares this way makes path resolution ambiguous, so initialization fails with the colliding pair in the message (Chinese: 'hierarchical conflict').","triggerScenarios":"share_ids contains lines like 'docs|111' and 'docs/books|222' with different ids but overlapping path prefixes (checked with strings.HasPrefix(path, other+\"/\")). Fires during initShareList at mount/refresh time.","commonSituations":"Gradually adding shares and accidentally nesting a new one under an existing mount point; normalizing paths inconsistently (leading slash on one line, absent on the other) so the intended siblings become parent/child.","solutions":["Move the nested entry to a sibling path that is not a prefix: 'docs|111' + 'books|222' instead of 'docs/books|222'.","If nesting is truly desired, mount the subtree under the SAME share id (one line), not a second id.","Normalize all paths consistently (no leading/trailing slashes) so intended siblings don't accidentally form a prefix chain."],"exampleFix":"# before\ndocs|7412365891\ndocs/books|7412399887\n\n# after\ndocs|7412365891\nbooks|7412399887","handlingStrategy":"validation","validationCode":"paths := normalizedMountPaths(lines) // trimmed, no leading/trailing '/'\nfor _, a := range paths {\n    for _, b := range paths {\n        if a != b && strings.HasPrefix(b, a+\"/\") {\n            return fmt.Errorf(\"nested mount paths under different shares: %s vs %s\", a, b)\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep mount paths as siblings, never nested under a different share's path.","Normalize path formatting (no leading/trailing slashes) consistently across lines."],"tags":["doubao-share","config","path-conflict"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}