AlistGo/alist · critical
Init :: [MediaFire] {critical} missing sessionToken
Error message
Init :: [MediaFire] {critical} missing sessionToken What it means
Mediafire driver Init aborts because the Addition struct has an empty SessionToken. The driver is a scraping-style client that authenticates with a pre-obtained session token plus browser Cookie; without it, no API call can be signed. Init returns this error, which the driver framework surfaces as storage initialization failure.
Source
Thrown at drivers/mediafire/driver.go:54
hostBase string
maxRetries int
secChUa string
secChUaPlatform string
userAgent string
}
func (d *Mediafire) Config() driver.Config {
return config
}
func (d *Mediafire) GetAddition() driver.Additional {
return &d.Addition
}
func (d *Mediafire) Init(ctx context.Context) error {
if d.SessionToken == "" {
return fmt.Errorf("Init :: [MediaFire] {critical} missing sessionToken")
}
if d.Cookie == "" {
return fmt.Errorf("Init :: [MediaFire] {critical} missing Cookie")
}
if _, err := d.getSessionToken(ctx); err != nil {
d.renewToken(ctx)
num := rand.Intn(4) + 6
d.cron = cron.NewCron(time.Minute * time.Duration(num))
d.cron.Do(func() {
d.renewToken(ctx)
})
}View on GitHub (pinned to 843d9dc814)
Solutions
- Open mediafire.com logged in, extract session_token (and cookie) from browser devtools and fill both fields in the storage config
- Verify the saved storage JSON actually contains the token (it is persisted via op.MustSaveDriverStorage)
- Re-save the storage config after pasting so Init runs again with the populated Addition
Defensive patterns
Strategy: validation
Validate before calling
func (d *Mediafire) Init(ctx context.Context) error {
if strings.TrimSpace(d.SessionToken) == "" {
return fmt.Errorf("sessionToken is required: extract it from a logged-in mediafire.com browser session")
}
...
} Try / catch
The framework already surfaces Init errors in the storage status UI — catch nothing; instead present actionable text in the error so the admin knows which field to fill.
Prevention
- Validate both SessionToken and Cookie fields in the admin form before saving
- Document the browser-devtools extraction steps in the storage's help text
- Persist credentials via driver storage immediately after first successful Init
When it happens
Trigger: Adding a MediaFire storage in the admin UI without pasting a session token; restoring a storage config from JSON where the session_token field was dropped; the token never having been persisted (MustSaveDriverStorage not yet run on first setup).
Common situations: First-time setup where the user filled Cookie but skipped extracting the session_token from the browser; migrating configs between instances; secret fields stripped during config export.
Related errors
- Init :: [MediaFire] {critical} missing Cookie
- authn not support
- login failed: provide a valid access_token, or refresh_token
- not logged in yet: please fill verify_code and save storage
- get token failed: %s
AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15).
Data as JSON: /api/errors/6aba1f3fd0ac2584.
Report an issue: GitHub.