{"record":{"id":"9d4896beb9e6a6d4","repo":"AlistGo/alist","slug":"failed-to-obtain-verification-code","errorCode":null,"errorMessage":"failed to obtain verification code","messagePattern":"failed to obtain verification code","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/189pc/utils.go","lineNumber":436,"sourceCode":"\t\t\t\"userName\":    param.RsaUsername,\n\t\t}).Post(AUTH_URL + \"/api/logbox/oauth2/needcaptcha.do\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tif resp.String() == \"0\" {\n\t\treturn nil\n\t}\n\n\t// 拉取验证码\n\timgRes, err := y.client.R().\n\t\tSetQueryParams(map[string]string{\n\t\t\t\"token\": param.CaptchaToken,\n\t\t\t\"REQID\": param.ReqId,\n\t\t\t\"rnd\":   fmt.Sprint(timestamp()),\n\t\t}).\n\t\tGet(AUTH_URL + \"/api/logbox/oauth2/picCaptcha.do\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to obtain verification code\")\n\t}\n\tif imgRes.Size() > 20 {\n\t\tif setting.GetStr(conf.OcrApi) != \"\" && !y.NoUseOcr {\n\t\t\tvRes, err := base.RestyClient.R().\n\t\t\t\tSetMultipartField(\"image\", \"validateCode.png\", \"image/png\", bytes.NewReader(imgRes.Body())).\n\t\t\t\tPost(setting.GetStr(conf.OcrApi))\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif jsoniter.Get(vRes.Body(), \"status\").ToInt() == 200 {\n\t\t\t\ty.VCode = jsoniter.Get(vRes.Body(), \"result\").ToString()\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\n\t\t// 返回验证码图片给前端\n\t\treturn fmt.Errorf(`need img validate code: <img src=\"data:image/png;base64,%s\"/>`, base64.StdEncoding.EncodeToString(imgRes.Body()))\n\t}","sourceCodeStart":418,"sourceCodeEnd":454,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/189pc/utils.go#L418-L454","documentation":"Error \"failed to obtain verification code\" thrown in AlistGo/alist.","triggerScenarios":"Thrown at drivers/189pc/utils.go:436 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the storage configuration and the provider's service status, fix the indicated cause, and retry the operation."],"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-15T17:31:12.345Z"}