AlistGo/alist · error

failed to get share link information: %w

Error message

failed to get share link information: %w

What it means

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).

Source

Thrown at drivers/doubao_share/util.go:588

		NodeID:   file.ID,
		NodeType: file.NodeType,
	}

	return obj
}

// getFilesInPath 获取指定分享和路径下的文件
func (d *DoubaoShare) getFilesInPath(ctx context.Context, shareId, nodeId, relativePath string) ([]model.Obj, error) {
	var (
		files []File
		err   error
	)

	// 调用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)))

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Open the share URL in a browser to verify it still works; if expired, get a new link and update share_ids.
  2. 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).
  3. Refresh the storage after updating share_ids so the root is re-resolved.
Defensive patterns

Strategy: try-catch

Type guard

func isShareResolveFailure(err error) bool {
    return err != nil && strings.Contains(err.Error(), "failed to get share link information")
}

Try / catch

objs, err := d.getFilesInPath(ctx, shareId, nodeId, rel)
if err != nil {
    if isShareResolveFailure(err) {
        // unwrap: the %w chain carries the CommonResp API code
        if isDoubaoShareAPIError(errors.Unwrap(err)) {
            // share expired/revoked: flag config, stop retrying this share
        }
    }
    return err
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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