{"record":{"id":"a5058d26919dcf59","repo":"AlistGo/alist","slug":"failed-to-get-share-file-w","errorCode":null,"errorMessage":"failed to get share file: %w","messagePattern":"failed to get share file: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/doubao_share/util.go","lineNumber":601,"sourceCode":"\n\t// 调用overview接口获取分享链接信息 nodeId\n\tif nodeId == \"\" {\n\t\tfiles, err = d.getShareOverview(shareId, \"\")\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to get share link information: %w\", err)\n\t\t}\n\n\t\tresult := make([]model.Obj, 0, len(files))\n\t\tfor _, file := range files {\n\t\t\tresult = append(result, d.convertToFileObject(file, shareId, \"/\"))\n\t\t}\n\n\t\treturn result, nil\n\n\t} else {\n\t\tfiles, err = d.getFiles(shareId, nodeId, \"\")\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to get share file: %w\", err)\n\t\t}\n\n\t\tresult := make([]model.Obj, 0, len(files))\n\t\tfor _, file := range files {\n\t\t\tresult = append(result, d.convertToFileObject(file, shareId, path.Join(\"/\", relativePath)))\n\t\t}\n\n\t\treturn result, nil\n\t}\n}\n\n// listRootDirectory 处理根目录的内容展示\nfunc (d *DoubaoShare) listRootDirectory(ctx context.Context) ([]model.Obj, error) {\n\tobjects := make([]model.Obj, 0)\n\n\t// 分组处理：直接显示的分享内容 vs 虚拟目录\n\tvar directShareIDs []string\n\taddedDirs := make(map[string]bool)","sourceCodeStart":583,"sourceCodeEnd":619,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/doubao_share/util.go#L583-L619","documentation":"This error is returned by the doubao_share driver when listing the contents of a subdirectory inside a shared link. The inner getFiles call to the Doubao share API failed, and the error is wrapped with this message. The root-directory branch of the same function uses a different call path, so this specifically means the non-root node fetch failed.","triggerScenarios":"Calling List on a path inside the share that is not the root (nodeId != root), when getFiles(shareId, nodeId, \"\") returns an error: expired share token, invalid shareId/nodeId extracted from the share URL, share deleted or revoked by the owner, network failure, or API rate limiting.","commonSituations":"Share link expired or was cancelled by its owner; the share URL pasted into the driver config was truncated so shareId parsing is wrong; the share root lists fine but a nested folder 404s because nodeId mapping drifted after share content changes; transient network errors behind a proxy.","solutions":["Verify the share link still opens in a browser and the specific subdirectory is still present, then re-save the driver config to force re-parsing of shareId","Re-list the parent directory to refresh node ids — nested node ids can change when the share owner reorganizes content","Check logs for the wrapped inner error (%w) to distinguish auth failure (re-authenticate the share) from network failure (retry later)","If the error is intermittent, check for rate limiting on the Doubao share API and space out listing requests"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// in caller of List\nobjs, err := shareDriver.List(ctx, dirObj)\nif err != nil && strings.Contains(err.Error(), \"failed to get share file\") {\n    // re-list parent once to refresh node ids, then retry once\n    if _, rerr := shareDriver.List(ctx, dirObj.GetParent()); rerr == nil {\n        objs, err = shareDriver.List(ctx, dirObj)\n    }\n}\nif err != nil { return err }","preventionTips":["Treat share listings as short-lived: cache node ids only briefly","Validate the share link is still alive during driver Init or periodically","Surface the wrapped inner error in logs to distinguish auth vs network causes"],"tags":["doubao","share-drive","api","listing"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}