AlistGo/alist · error
failed to get share file: %w
Error message
failed to get share file: %w
What it means
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.
Source
Thrown at drivers/doubao_share/util.go:601
// 调用overview接口获取分享链接信息 nodeId
if nodeId == "" {
files, err = d.getShareOverview(shareId, "")
if err != nil {
return nil, fmt.Errorf("failed to get share link information: %w", err)
}
result := make([]model.Obj, 0, len(files))
for _, file := range files {
result = append(result, d.convertToFileObject(file, shareId, "/"))
}
return result, nil
} else {
files, err = d.getFiles(shareId, nodeId, "")
if err != nil {
return nil, fmt.Errorf("failed to get share file: %w", err)
}
result := make([]model.Obj, 0, len(files))
for _, file := range files {
result = append(result, d.convertToFileObject(file, shareId, path.Join("/", relativePath)))
}
return result, nil
}
}
// listRootDirectory 处理根目录的内容展示
func (d *DoubaoShare) listRootDirectory(ctx context.Context) ([]model.Obj, error) {
objects := make([]model.Obj, 0)
// 分组处理:直接显示的分享内容 vs 虚拟目录
var directShareIDs []string
addedDirs := make(map[string]bool)View on GitHub (pinned to 843d9dc814)
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
Defensive patterns
Strategy: retry
Try / catch
// in caller of List
objs, err := shareDriver.List(ctx, dirObj)
if err != nil && strings.Contains(err.Error(), "failed to get share file") {
// re-list parent once to refresh node ids, then retry once
if _, rerr := shareDriver.List(ctx, dirObj.GetParent()); rerr == nil {
objs, err = shareDriver.List(ctx, dirObj)
}
}
if err != nil { return err } Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- -10001
- invalid response
- empty download url
- instant upload returns empty task id
- upload token is incomplete
AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15).
Data as JSON: /api/errors/a5058d26919dcf59.
Report an issue: GitHub.