{"record":{"id":"87a006bd998eea0b","repo":"AlistGo/alist","slug":"request-failed-s","errorCode":null,"errorMessage":"request failed: %s","messagePattern":"request failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/kodbox/util.go","lineNumber":83,"sourceCode":"\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tswitch commonResp.Code.(type) {\n\t\tcase bool:\n\t\t\tskip = true\n\t\tcase string:\n\t\t\tif commonResp.Code.(string) == \"10001\" {\n\t\t\t\terr = d.getToken()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\treq.SetFormData(map[string]string{\"accessToken\": d.authorization})\n\t\t\t}\n\t\t}\n\t}\n\tif commonResp.Code.(bool) == false {\n\t\treturn nil, fmt.Errorf(\"request failed: %s\", commonResp.Data)\n\t}\n\treturn res.Body(), nil\n}\n","sourceCodeStart":65,"sourceCodeEnd":87,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/kodbox/util.go#L65-L87","documentation":"Raised by KodBox request() as the generic application-level failure: after optional token-refresh handling (code '10001' triggers getToken and a form-data accessToken retry), the response still has Code == false. The error text is commonResp.Data verbatim.","triggerScenarios":"Any KodBox API call whose Code flag is false for a reason other than the specific '10001' expired-token case: invalid path, missing permission, server-side validation failure, or a token that was refreshed but the operation still refused.","commonSituations":"Mount root path not visible to the configured user; stale token that the 10001 retry could not fix; KodBox version drift changing Code semantics (string vs bool) so the refresh branch is skipped.","solutions":["Read the passthrough Data message — it is the server's stated reason for that specific endpoint","If the message suggests session expiry, reload the storage to force getToken() and obtain a fresh accessToken","Verify the mount's root path exists and is accessible to the configured KodBox user"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Sanity-check the mount root before first request\nif cfg.RootFolderPath != \"\" {\n    // verify via a lightweight list call that Code==true; otherwise fail config early\n}","typeGuard":null,"tryCatchPattern":"body, err := d.request(http.MethodPost, path, cb)\nif err != nil && strings.Contains(err.Error(), \"request failed\") {\n    // one re-auth + single retry (the driver already handles code 10001 internally)\n    _ = d.getToken()\n    body, err = d.request(http.MethodPost, path, cb)\n}","preventionTips":["Use a KodBox user whose home contains the mounted root path","Reload the storage after credential or permission changes to force fresh tokens","Watch for KodBox upgrades that change Code typing (bool vs string) — update the driver"],"tags":["kodbox","api-error","token","passthrough","openlist"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}