{"record":{"id":"11248ca33f8d8193","repo":"AlistGo/alist","slug":"failed-to-get-share-link-information-w","errorCode":null,"errorMessage":"failed to get share link information: %w","messagePattern":"failed to get share link information: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/doubao_share/util.go","lineNumber":588,"sourceCode":"\t\tNodeID:   file.ID,\n\t\tNodeType: file.NodeType,\n\t}\n\n\treturn obj\n}\n\n// getFilesInPath 获取指定分享和路径下的文件\nfunc (d *DoubaoShare) getFilesInPath(ctx context.Context, shareId, nodeId, relativePath string) ([]model.Obj, error) {\n\tvar (\n\t\tfiles []File\n\t\terr   error\n\t)\n\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)))","sourceCodeStart":570,"sourceCodeEnd":606,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/doubao_share/util.go#L570-L606","documentation":"getFilesInPath wraps a failure of getShareOverview — the call that resolves a share link's top-level node id — when listing the root of a share (nodeId empty). The %w preserves the underlying cause, which is almost always the CommonResp API error (share expired, invalid share_id, or blocked access).","triggerScenarios":"Listing the root of a mounted share whose link expired, was revoked, or whose share_id is invalid; risk-control/WAF blocking the overview endpoint; missing or stale visitor credentials for password-protected shares.","commonSituations":"Shared links naturally expiring after configuration; the sharer deleting the share; account/IP flagged by risk control; share now requires a passcode that the mount never stored.","solutions":["Open the share URL in a browser to verify it still works; if expired, get a new link and update share_ids.","Read the wrapped error text: an API code tells you whether it's expiry, auth, or rate limit, and you react accordingly (update id / refresh cookies / back off).","Refresh the storage after updating share_ids so the root is re-resolved."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"func isShareResolveFailure(err error) bool {\n    return err != nil && strings.Contains(err.Error(), \"failed to get share link information\")\n}","tryCatchPattern":"objs, err := d.getFilesInPath(ctx, shareId, nodeId, rel)\nif err != nil {\n    if isShareResolveFailure(err) {\n        // unwrap: the %w chain carries the CommonResp API code\n        if isDoubaoShareAPIError(errors.Unwrap(err)) {\n            // share expired/revoked: flag config, stop retrying this share\n        }\n    }\n    return err\n}","preventionTips":["Verify share links still resolve in a browser when this recurs.","Update share_ids as soon as a link is re-issued.","Use errors.Unwrap/errors.As on the %w chain to reach the real API code."],"tags":["doubao-share","share-link","api-error","wrap"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}