{"record":{"id":"838c93d8001fa6d5","repo":"AlistGo/alist","slug":"failed-to-get-account-id-w","errorCode":null,"errorMessage":"failed to get account ID: %w","messagePattern":"failed to get account ID: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/gofile/driver.go","lineNumber":37,"sourceCode":"}\n\nfunc (d *Gofile) Config() driver.Config {\n\treturn config\n}\n\nfunc (d *Gofile) GetAddition() driver.Additional {\n\treturn &d.Addition\n}\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 {","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/gofile/driver.go#L19-L55","documentation":"Wrapped error from Gofile Init: the getAccountId call failed. Init first calls the Gofile 'getAccount' endpoint to resolve the account ID from the API token; any transport error or API error from that call is wrapped as 'failed to get account ID: <cause>'.","triggerScenarios":"Init with an invalid/expired API token (Gofile returns error status and handleError fires), network/DNS failure to api.gofile.io, or proxy blocking the request.","commonSituations":"Token pasted incorrectly (truncated/extra spaces); token revoked or account deleted; server has no outbound access to gofile.io; gofile.io under maintenance returning 5xx.","solutions":["Check the wrapped cause: 'gofile API error: ...' means bad token, HTTP xxx means service/network issue","Verify the token by calling curl -H 'Authorization: Bearer TOKEN' https://api.gofile.io/accounts/getAccountDetails","Fix network egress/DNS/proxy for api.gofile.io if the cause is a transport error","Regenerate the token in the Gofile dashboard if revoked"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := d.Init(ctx); err != nil {\n  if strings.HasPrefix(err.Error(), \"failed to get account ID\") {\n    // inspect inner cause: token vs network; reconfig token or retry later\n  }\n}","preventionTips":["Verify the token with a direct curl to the accounts endpoint before saving storage","Ensure the host can reach api.gofile.io (DNS, proxy, firewall)"],"tags":["gofile","auth","network","init"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}