AlistGo/alist · error

missing cookie or qrcode account

Error message

missing cookie or qrcode account

What it means

Returned by the strm driver's link reader (drivers/strm/util.go:246) when a link has no readable source at all: link.MFile is nil, link.RangeReadCloser is nil, and link.URL is the empty string. It means the .strm resolution produced a Link with no content source, so there is nothing to read or proxy.

Source

Thrown at drivers/115_share/utils.go:200

		return errors.Wrap(err, "failed to get share snap")
	}
	cr := &driver115.Credential{}
	if d.QRCodeToken != "" {
		s := &driver115.QRCodeSession{
			UID: d.QRCodeToken,
		}
		if cr, err = d.client.QRCodeLoginWithApp(s, driver115.LoginApp(d.QRCodeSource)); err != nil {
			return errors.Wrap(err, "failed to login by qrcode")
		}
		d.Cookie = fmt.Sprintf("UID=%s;CID=%s;SEID=%s;KID=%s", cr.UID, cr.CID, cr.SEID, cr.KID)
		d.QRCodeToken = ""
	} else if d.Cookie != "" {
		if err = cr.FromCookie(d.Cookie); err != nil {
			return errors.Wrap(err, "failed to login by cookies")
		}
		d.client.ImportCredential(cr)
	} else {
		return errors.New("missing cookie or qrcode account")
	}

	return d.client.LoginCheck()
}

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Check the source .strm file content — ensure the first line is a non-empty absolute URL.
  2. Audit the code path that builds the Link: on extraction failure return an error instead of an empty Link.
  3. Before reading, guard: if link.MFile == nil && link.RangeReadCloser == nil && link.URL is empty, treat it as an invalid/missing source and surface a user-facing error.

Example fix

// before
return &model.Link{}, nil // resolver placeholder -> later "empty link"

// after
if rawURL == "" {
	return nil, fmt.Errorf("strm file %s has no link", path)
}
return &model.Link{URL: rawURL}, nil
Defensive patterns

Strategy: validation

Validate before calling

if link.MFile == nil && link.RangeReadCloser == nil && strings.TrimSpace(link.URL) == "" {
	return nil, fmt.Errorf("strm target has no content source")
}

Type guard

func hasReadableSource(link *model.Link) bool {
	return link != nil && (link.MFile != nil || link.RangeReadCloser != nil || strings.TrimSpace(link.URL) != "")
}

Try / catch

if _, err := readStrmLink(ctx, link); err != nil && err.Error() == "empty link" {
	// treat as corrupt strm file; surface the file path
}

Prevention

When it happens

Trigger: Opening/reading the raw content of an object whose resolved Link was built with only headers/flags (e.g. a metadata-only link) or where the URL extraction from the .strm file produced an empty string; passing a zero-value model.Link to this helper.

Common situations: A .strm file that contains only whitespace or no URL on its first line; a resolver path that returns &model.Link{} as a placeholder on failure instead of an error; upstream refactors of model.Link making MFile/RangeReadCloser nil where they used to be set.

Related errors


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