AlistGo/alist · error
fast login with cookies failed, and cannot fallback to passw
Error message
fast login with cookies failed, and cannot fallback to password login (missing username/password)
What it means
The driver was configured with mail_cookies only (no username/password), fast login via existing SID/RMKEY cookies failed (step 2 or step 3 rejected them), and there is no fallback because password login requires credentials. This is a terminal configuration-state error, not a transient one.
Source
Thrown at drivers/139/util.go:1263
}
func (d *Yun139) validateAndInitCredentials() error {
state, err := d.credentialState()
if err != nil {
return err
}
switch state {
case credentialStateAuthorization:
log.Debugf("139yun: Authorization exists, skipping initialization login.")
return nil
case credentialStateFullLogin, credentialStateCookiesOnly:
log.Infof("139yun: Authorization missing, attempting login...")
if d.tryFastLoginWithCookies() {
return nil
}
if state == credentialStateCookiesOnly {
return fmt.Errorf("fast login with cookies failed, and cannot fallback to password login (missing username/password)")
}
log.Infof("139yun: fast login failed or not possible, performing full password login (Step 1).")
_, err := d.loginWithPassword()
if err != nil {
return fmt.Errorf("login with password failed: %w", err)
}
return nil
default:
return fmt.Errorf("unsupported credential state: %d", state)
}
}
func (d *Yun139) credentialState() (credentialState, error) {
d.Authorization = strings.TrimSpace(d.Authorization)
d.Username = strings.TrimSpace(d.Username)
d.MailCookies = strings.TrimSpace(d.MailCookies)
if d.Authorization != "" {View on GitHub (pinned to 843d9dc814)
Solutions
- Re-copy complete, fresh cookies: log into yun.139.com in the browser and take both Os_SSo_Sid and RMKEY (cookie format must be 'k=v; k=v')
- If you want resilience against cookie expiry, switch the driver to full login: fill mail_cookies AND username AND password together
- Verify there is no whitespace/newline or 'Cookie:' prefix pasted into the mail_cookies field
- Restart/reload the storage after fixing config so login is re-attempted
Defensive patterns
Strategy: validation
Validate before calling
// Validate cookies-only configuration before triggering login
sid, rmkey := extractFastLoginCookies(d.MailCookies)
if sid == "" || rmkey == "" {
return fmt.Errorf("mail_cookies lacks Os_SSo_Sid/RMKEY — fast login impossible; add username+password or refresh cookies")
} Type guard
func hasFastLoginCookies(mailCookies string) bool {
sid, rmkey := extractFastLoginCookies(mailCookies)
return sid != "" && rmkey != ""
} Try / catch
// Catch at storage-init level and surface an actionable config message
if err := storage.Init(); err != nil {
if strings.Contains(err.Error(), "cannot fallback to password login") {
return errors.New("139 cookies expired: re-copy Os_SSo_Sid/RMKEY from browser, or configure username+password")
}
} Prevention
- Always copy both Os_SSo_Sid and RMKEY together
- Prefer full-login config (cookies+username+password) for unattended setups
- Refresh cookies on a schedule; they expire faster than Authorization tokens
When it happens
Trigger: credentialState() returned credentialStateCookiesOnly and tryFastLoginWithCookies() returned false — Os_SSo_Sid or RMKEY missing from the cookie string, or the 139 server rejected the session as expired.
Common situations: User pasted incomplete cookies (missing RMKEY), cookies expired after ~days of idle, or copied cookies for a different account/region.
Related errors
AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15).
Data as JSON: /api/errors/d77717759c18ecc2.
Report an issue: GitHub.