AlistGo/alist · error
missing owner_qid for cookie mode
Error message
missing owner_qid for cookie mode
What it means
resolveCookieOwnerQID exhausted every source of the owner_qid form field — driver config, the YunpanObject's embedded OwnerQID, the listing response, and the scraped index page — and still found nothing (drivers/yunpan360/util.go:502). Cookie-mode operations like rename/move/recycle that need owner_qid will fail with this error.
Source
Thrown at drivers/yunpan360/util.go:502
if ownerQID != "" {
return ownerQID, nil
}
}
resp, err := d.listCookiePage(ctx, d.RootFolderPath, 0, 1)
if err == nil && resp != nil {
ownerQID = firstNonEmpty(ownerQID, resp.GetOwnerQID())
}
if ownerQID != "" {
return ownerQID, nil
}
pageSession, err := d.getCookieDownloadSessionFromPage(ctx)
if err == nil && pageSession != nil {
ownerQID = firstNonEmpty(ownerQID, pageSession.OwnerQID)
}
if ownerQID == "" {
return "", errors.New("missing owner_qid for cookie mode")
}
return ownerQID, nil
}
func (d *Yunpan360) getCookieDownloadSessionFromPage(ctx context.Context) (*CookieDownloadSession, error) {
body, err := d.cookiePage(ctx, indexPath)
if err != nil {
return nil, err
}
session := parseCookieDownloadSessionFromText(string(body))
if session == nil {
return nil, errors.New("failed to parse cookie download session from page")
}
d.cacheCookieSession(session)
return session, nil
}
func (d *Yunpan360) getCachedCookieDownloadSession() *CookieDownloadSession {View on GitHub (pinned to 843d9dc814)
Solutions
- Set OwnerQID explicitly in the storage configuration
- Refresh the cookie from a current browser session (full cookie string, all key values)
- Re-list the directory: objects freshly listed carry OwnerQID which is picked up per-object
- If the error appears after a 360 web update, the page parser in the driver needs updating
Example fix
// before
storage.Setting("owner_qid", "")
// after
storage.Setting("owner_qid", "360100000012345678") Defensive patterns
Strategy: validation
Validate before calling
if sanitizeOwnerQID(d.OwnerQID) == "" { return errors.New("configure owner_qid before cookie operations") } Type guard
func hasOwnerQID(q string) bool { return sanitizeOwnerQID(q) != "" } Try / catch
q, err := d.resolveCookieOwnerQID(ctx, obj, false)
if err != nil {
if strings.Contains(err.Error(), "owner_qid") {
q, err = d.resolveCookieOwnerQID(ctx, obj, true) // force refresh pass
}
if err != nil { return err }
} Prevention
- Keep OwnerQID in config as the baseline; per-object values are a bonus
- Refresh cookie when scraping starts failing — layout changes hit the parser first
- Re-list directories after cookie changes so objects pick up fresh owner data
When it happens
Trigger: Any cookie-mode mutation (rename, move, recycle) or download param resolution when OwnerQID is absent from storage config, absent from listed objects, and page scraping returns nothing. The listing API (resp.GetOwnerQID()) also returned empty.
Common situations: Fresh storage setup where OwnerQID was never configured; 360 changed the index page HTML so parseCookieDownloadSessionFromText finds no owner QID; shared-file scenarios where the listing response omits owner info.
Related errors
- missing owner_qid or download_token for cookie mode
- cookie is empty
- failed to parse cookie download session from page
- api_key is empty
- invalid auth_type
AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15).
Data as JSON: /api/errors/785a0c7e0d398fae.
Report an issue: GitHub.