{"record":{"id":"86222a5badc0d75a","repo":"AlistGo/alist","slug":"10001","errorCode":"-10001","errorMessage":"ErrorCode: %d ,Error: %s ,ServerRunTime: %f ,ServerName: %s","messagePattern":"ErrorCode: (.+?) ,Error: (.+?) ,ServerRunTime: (.+?) ,ServerName: (.+?)","errorType":"error_code","errorClass":"ErrResp","httpStatus":null,"severity":"error","filePath":"drivers/febbox/util.go","lineNumber":61,"sourceCode":"\tres, err := req.Execute(method, url)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tswitch e.ErrorCode {\n\tcase 0:\n\t\treturn res.Body(), nil\n\tcase 1:\n\t\treturn res.Body(), nil\n\tcase -10001:\n\t\tif e.ServerName != \"\" {\n\t\t\t// access_token 过期\n\t\t\tif err = d.refreshTokenByOAuth2(); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn d.request(url, method, callback, resp)\n\t\t} else {\n\t\t\treturn nil, errors.New(e.Error())\n\t\t}\n\tdefault:\n\t\treturn nil, errors.New(e.Error())\n\t}\n}\n\nfunc (d *FebBox) getFilesList(id string) ([]File, error) {\n\tif d.PageSize <= 0 {\n\t\td.PageSize = 100\n\t}\n\tres, err := d.listWithLimit(id, d.PageSize)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn *res, nil\n}\n\nfunc (d *FebBox) listWithLimit(dirID string, pageLimit int64) (*[]File, error) {","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/febbox/util.go#L43-L79","documentation":"FebBox API returned error code -10001 (normally meaning an expired access_token) but the error payload had an empty ServerName, so the driver could not take its automatic refresh-and-retry path and instead surfaced the formatted error via errors.New(e.Error()). The message is the ErrResp.Error() formatting: ErrorCode, Error text, ServerRunTime and ServerName. In practice this means the token-refresh recovery was skipped because the server response was malformed or came from an endpoint that does not populate ServerName.","triggerScenarios":"Any FebBox request (listing, upload, download) where the JSON error body has ErrorCode == -10001 and ServerName == \"\". The request() switch takes the else branch at drivers/febbox/util.go:60-62 instead of calling refreshTokenByOAuth2().","commonSituations":"FebBox backend change altering the error payload shape; a proxy or gateway stripping fields from the error JSON; an API version change where -10001 is returned for a different condition (e.g. invalid rather than expired token); clock skew causing the server to reject the token without the expected metadata.","solutions":["Log the raw response body (res.Body()) when ErrorCode == -10001 to see the actual server payload and whether ServerName is truly absent.","Check whether the stored refresh token is still valid; re-authorize the FebBox driver in the storage settings to obtain fresh tokens.","If the payload is legitimately missing ServerName but the token is expired, consider refreshing anyway (patch the driver to attempt refreshTokenByOAuth2 on -10001 regardless of ServerName).","Verify the driver and API endpoint versions match (update OpenList/AList so the FebBox driver matches the current FebBox API)."],"exampleFix":"// before\ncase -10001:\n    if e.ServerName != \"\" {\n        if err = d.refreshTokenByOAuth2(); err != nil {\n            return nil, err\n        }\n        return d.request(url, method, callback, resp)\n    } else {\n        return nil, errors.New(e.Error())\n    }\n\n// after (still refresh once when ServerName is empty)\ncase -10001:\n    if err = d.refreshTokenByOAuth2(); err != nil {\n        return nil, errors.New(e.Error())\n    }\n    return d.request(url, method, callback, resp)","handlingStrategy":"retry","validationCode":"// before calling driver ops, ensure tokens are fresh\nif d.Addition.RefreshToken == \"\" {\n    return errors.New(\"febbox refresh token missing; re-authorize storage\")\n}","typeGuard":null,"tryCatchPattern":"err := doFebBoxOp()\nif err != nil && strings.Contains(err.Error(), \"-10001\") {\n    // force re-auth then retry once\n    if rerr := d.refreshTokenByOAuth2(); rerr == nil {\n        err = doFebBoxOp()\n    }\n}","preventionTips":["Keep the OAuth refresh token persisted and re-authorize the storage when it expires.","Monitor for -10001 with empty ServerName as a signal of API payload changes.","Wrap FebBox calls in a single retry after forced token refresh."],"tags":["febbox","auth","token-expired","api","go"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}