AlistGo/alist · warning

no share_ids found

Error message

no share_ids found

What it means

_parseShareConfigs returns this error when strings.Split of the trimmed share_ids yields zero lines. In practice this branch is unreachable: strings.Split always returns at least one element (Split("") returns [""]) and the empty-string case is already rejected by initShareList's own check, so hitting it indicates modified/duplicated validation logic.

Source

Thrown at drivers/doubao_share/util.go:221

	topLevelNodes := d._extractTopLevelNodes(rootMap, rootShares)
	if len(topLevelNodes) == 0 {
		return fmt.Errorf("no valid share_ids found")
	}

	// 存储结果
	d.RootFiles = topLevelNodes

	return nil
}

// 从配置中解析分享ID和路径
func (d *DoubaoShare) _parseShareConfigs() (map[string]string, []string, error) {
	shareConfigs := make(map[string]string) // 路径 -> 分享ID
	rootShares := make([]string, 0)         // 根目录显示的分享ID

	lines := strings.Split(strings.TrimSpace(d.Addition.ShareIds), "\n")
	if len(lines) == 0 {
		return nil, nil, fmt.Errorf("no share_ids found")
	}

	for _, line := range lines {
		line = strings.TrimSpace(line)
		if line == "" {
			continue
		}

		// 解析分享ID和路径
		parts := strings.Split(line, "|")
		var shareId, sharePath string

		if len(parts) == 1 {
			// 无路径分享,直接在根目录显示
			shareId = _extractShareId(parts[0])
			if shareId != "" {
				rootShares = append(rootShares, shareId)
			}

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Keep the empty-value guard in initShareList so this branch stays defensive only.
  2. If you refactored the splitter, ensure it mirrors strings.Split's guarantee of >= 1 element.
  3. No user-facing action needed on stock builds; configure share_ids to fix the related 733 error.
Defensive patterns

Strategy: validation

Validate before calling

// defensive only; strings.Split never returns 0 elements
lines := strings.Split(strings.TrimSpace(s), "\n")
if len(lines) == 0 { return fmt.Errorf("no share_ids found") }

Prevention

When it happens

Trigger: Only reachable in forks where the empty ShareIds guard in initShareList was removed or where the split logic was changed (e.g., a custom splitter that can return nil). Stock users see error 733 instead.

Common situations: Refactoring the parsing chain and introducing a splitter with different semantics; dead-code confusion when grepping for share_ids errors.

Related errors


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