{"record":{"id":"3e747b90b0c778f4","repo":"AlistGo/alist","slug":"get-token-failed-s-3e747b","errorCode":null,"errorMessage":"get token failed: %s","messagePattern":"get token failed: (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/seafile/util.go","lineNumber":33,"sourceCode":"\nfunc (d *Seafile) getToken() error {\n\tif d.Token != \"\" {\n\t\td.authorization = fmt.Sprintf(\"Token %s\", d.Token)\n\t\treturn nil\n\t}\n\tvar authResp AuthTokenResp\n\tres, err := base.RestyClient.R().\n\t\tSetResult(&authResp).\n\t\tSetFormData(map[string]string{\n\t\t\t\"username\": d.UserName,\n\t\t\t\"password\": d.Password,\n\t\t}).\n\t\tPost(d.Address + \"/api2/auth-token/\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tif res.StatusCode() >= 400 {\n\t\treturn fmt.Errorf(\"get token failed: %s\", res.String())\n\t}\n\td.authorization = fmt.Sprintf(\"Token %s\", authResp.Token)\n\treturn nil\n}\n\nfunc (d *Seafile) request(method string, pathname string, callback base.ReqCallback, noRedirect ...bool) ([]byte, error) {\n\tfull := pathname\n\tif !strings.HasPrefix(pathname, \"http\") {\n\t\tfull = d.Address + pathname\n\t}\n\treq := base.RestyClient.R()\n\tif len(noRedirect) > 0 && noRedirect[0] {\n\t\treq = base.NoRedirectClient.R()\n\t}\n\treq.SetHeader(\"Authorization\", d.authorization)\n\tcallback(req)\n\tvar (\n\t\tres *resty.Response","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/seafile/util.go#L15-L51","documentation":"Error \"get token failed: %s\" thrown in AlistGo/alist.","triggerScenarios":"Thrown at drivers/seafile/util.go:33 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the underlying error details in the message, fix the indicated cause (credentials, network, or provider-side failure), and retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}