AlistGo/alist · error
failed to get account info: %w
Error message
failed to get account info: %w
What it means
Wrapped error from Gofile Init: getAccountInfo failed. It is only called when RootFolderID is not configured, to discover the account's root folder from the account-details response; failure aborts Init with 'failed to get account info: <cause>'.
Source
Thrown at drivers/gofile/driver.go:45
}
func (d *Gofile) Init(ctx context.Context) error {
if d.APIToken == "" {
return fmt.Errorf("API token is required")
}
// Get account ID
accountId, err := d.getAccountId(ctx)
if err != nil {
return fmt.Errorf("failed to get account ID: %w", err)
}
d.accountId = accountId
// Get account info to set root folder if not specified
if d.RootFolderID == "" {
accountInfo, err := d.getAccountInfo(ctx, accountId)
if err != nil {
return fmt.Errorf("failed to get account info: %w", err)
}
d.RootFolderID = accountInfo.Data.RootFolder
}
// Save driver storage
op.MustSaveDriverStorage(d)
return nil
}
func (d *Gofile) Drop(ctx context.Context) error {
return nil
}
func (d *Gofile) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error) {
var folderId string
if dir.GetID() == "" {
folderId = d.GetRootId()
} else {View on GitHub (pinned to 843d9dc814)
Solutions
- Retry Init after a short delay — transient 5xx/429 from gofile is the most common cause
- Set the Root Folder ID explicitly in driver config to skip the account-info lookup entirely
- Confirm the account details endpoint manually with the token via curl
- If the wrapped cause is a JSON/unmarshal error, update the driver to match current Gofile API schema
Example fix
// before: blank root folder forces account-info lookup
{"root_folder_id":""}
// after: set root folder id, lookup skipped
{"root_folder_id":"abc123FolderId"} Defensive patterns
Strategy: retry
Try / catch
for attempt := 0; attempt < 3; attempt++ {
err := d.Init(ctx)
if err == nil || !strings.Contains(err.Error(), "failed to get account info") { break }
time.Sleep(time.Duration(attempt+1) * 2 * time.Second)
} Prevention
- Set RootFolderID explicitly to bypass the account-info dependency
- Avoid initializing during known Gofile outages; check status before enabling
When it happens
Trigger: Init with a valid token but empty root_folder_id setting while the account-info endpoint errors (rate limit, transient 5xx, partial API outage), or a token whose account cannot be queried.
Common situations: Gofile API returning 429/5xx during setup; API response schema change so JSON unmarshal fails; leaving root folder blank (the common default) right when the service is degraded.
Related errors
- failed to get account ID: %w
- failed to create direct link: %w
- gofile API error: HTTP %d - %s
- access_token is required in token mode
- renames is required
AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15).
Data as JSON: /api/errors/65008295ae0a48ae.
Report an issue: GitHub.