AlistGo/alist · error
MediaFire API error: %s
Error message
MediaFire API error: %s
What it means
getFolderContent posted to /folder/get_content.php and the response result was not 'Success'. This is the workhorse behind List: pagination chunks are fetched until folder_content_chunk is exhausted, so any chunk failing kills the whole listing. Causes: invalid/expired folder_key (root key misconfigured), session token expired, or the folder having been deleted or unshared.
Source
Thrown at drivers/mediafire/util.go:224
"response_format": "json",
"folder_key": folderKey,
"content_type": contentType,
"chunk": strconv.Itoa(chunkNumber),
"chunk_size": strconv.FormatInt(d.ChunkSize, 10),
"details": "yes",
"order_direction": d.OrderDirection,
"order_by": d.OrderBy,
"filter": "",
}
var resp MediafireResponse
_, err := d.postForm("/folder/get_content.php", data, &resp)
if err != nil {
return nil, err
}
if resp.Response.Result != "Success" {
return nil, fmt.Errorf("MediaFire API error: %s", resp.Response.Result)
}
return &resp, nil
}
func (d *Mediafire) fileToObj(f File) *model.ObjThumb {
created, _ := time.Parse("2006-01-02T15:04:05Z", f.CreatedUTC)
var thumbnailURL string
if !f.IsFolder && f.ID != "" {
thumbnailURL = d.hostBase + "/convkey/acaa/" + f.ID + "3g.jpg"
}
return &model.ObjThumb{
Object: model.Object{
ID: f.ID,
//Path: "",
Name: f.Name,View on GitHub (pinned to 843d9dc814)
Solutions
- Refresh the session token (getSessionToken) and retry the listing
- Open the root folder key in the MediaFire web UI to confirm it exists and is accessible from this account
- For very large folders, retry the failed chunk instead of restarting from chunk 1
- Include resp.Response.Message in the error for the exact API reason
Example fix
// before: whole listing fails on one bad chunk
for hasMore {
resp, err := d.getFolderContent(ctx, folderKey, chunkNumber)
if err != nil {
return nil, err
}
...
}
// after: refresh token once and retry the same chunk
for hasMore {
resp, err := d.getFolderContent(ctx, folderKey, chunkNumber)
if err != nil {
if _, tokErr := d.getSessionToken(ctx); tokErr == nil {
resp, err = d.getFolderContent(ctx, folderKey, chunkNumber)
}
if err != nil {
return nil, err
}
}
...
} Defensive patterns
Strategy: retry
Try / catch
Wrap each chunk fetch: on API error, refresh the session token once and retry the same chunkNumber; on a second failure with 'invalid key' messages, abort with a clear 'root folder not accessible' error instead of an opaque result string.
Prevention
- Verify the root folder key exists in the MediaFire UI when configuring the storage
- Retry the failed pagination chunk, not the whole listing
- Include response.message in errors; add token refresh before every long paginated operation
When it happens
Trigger: Listing a storage whose root_folder_key was deleted; token expired mid-pagination (large folders take several chunk requests); listing a shared folder whose share was revoked.
Common situations: Users pasting a folder key from a different account; big directories failing partway through due to token expiry; storage that worked yesterday but whose source folder was removed.
Related errors
AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15).
Data as JSON: /api/errors/1a4f229cc7f92681.
Report an issue: GitHub.