{"record":{"id":"65008295ae0a48ae","repo":"AlistGo/alist","slug":"failed-to-get-account-info-w","errorCode":null,"errorMessage":"failed to get account info: %w","messagePattern":"failed to get account info: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/gofile/driver.go","lineNumber":45,"sourceCode":"}\n\nfunc (d *Gofile) Init(ctx context.Context) error {\n\tif d.APIToken == \"\" {\n\t\treturn fmt.Errorf(\"API token is required\")\n\t}\n\n\t// Get account ID\n\taccountId, err := d.getAccountId(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get account ID: %w\", err)\n\t}\n\td.accountId = accountId\n\n\t// Get account info to set root folder if not specified\n\tif d.RootFolderID == \"\" {\n\t\taccountInfo, err := d.getAccountInfo(ctx, accountId)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to get account info: %w\", err)\n\t\t}\n\t\td.RootFolderID = accountInfo.Data.RootFolder\n\t}\n\n\t// Save driver storage\n\top.MustSaveDriverStorage(d)\n\treturn nil\n}\n\nfunc (d *Gofile) Drop(ctx context.Context) error {\n\treturn nil\n}\n\nfunc (d *Gofile) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error) {\n\tvar folderId string\n\tif dir.GetID() == \"\" {\n\t\tfolderId = d.GetRootId()\n\t} else {","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/gofile/driver.go#L27-L63","documentation":"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>'.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before: blank root folder forces account-info lookup\n{\"root_folder_id\":\"\"}\n\n// after: set root folder id, lookup skipped\n{\"root_folder_id\":\"abc123FolderId\"}","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"for attempt := 0; attempt < 3; attempt++ {\n  err := d.Init(ctx)\n  if err == nil || !strings.Contains(err.Error(), \"failed to get account info\") { break }\n  time.Sleep(time.Duration(attempt+1) * 2 * time.Second)\n}","preventionTips":["Set RootFolderID explicitly to bypass the account-info dependency","Avoid initializing during known Gofile outages; check status before enabling"],"tags":["gofile","init","network","root-folder"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}