{"record":{"id":"4b9d47ad936c1913","repo":"AlistGo/alist","slug":"request-verification-failed-s","errorCode":null,"errorMessage":"request verification failed: %s","messagePattern":"request verification failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/guangyapan/driver.go","lineNumber":701,"sourceCode":"\t\tSetContext(ctx).\n\t\tSetBody(map[string]any{\n\t\t\t\"phone_number\": normalizePhoneE164(d.PhoneNumber),\n\t\t\t\"target\":       \"ANY\",\n\t\t\t\"client_id\":    d.ClientID,\n\t\t}).\n\t\tSetResult(&step1).\n\t\tPost(\"/v1/auth/verification\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif resp.IsError() || step1.Error != \"\" || strings.TrimSpace(step1.VerificationID) == \"\" {\n\t\t// If captcha token is expired/invalid, refresh it once and retry.\n\t\tif strings.Contains(step1.Error, \"captcha_invalid\") || strings.Contains(step1.ErrorDesc, \"captcha_token expired\") {\n\t\t\tif err := d.ensureCaptchaToken(ctx, true); err == nil {\n\t\t\t\treturn d.requestVerificationID(ctx)\n\t\t\t}\n\t\t}\n\t\treturn \"\", fmt.Errorf(\"request verification failed: %s\", d.accountErr(step1.ErrorDesc, step1.Error, resp))\n\t}\n\treturn strings.TrimSpace(step1.VerificationID), nil\n}\n\nfunc (d *GuangYaPan) ensureCaptchaToken(ctx context.Context, force bool) error {\n\tif !force && d.CaptchaToken != \"\" {\n\t\td.accountClient.SetHeader(\"X-Captcha-Token\", d.CaptchaToken)\n\t\treturn nil\n\t}\n\n\tvar out captchaInitResp\n\tresp, err := d.accountClient.R().\n\t\tSetContext(ctx).\n\t\tSetBody(map[string]any{\n\t\t\t\"client_id\": d.ClientID,\n\t\t\t\"action\":    \"POST:/v1/auth/verification\",\n\t\t\t\"device_id\": d.DeviceID,\n\t\t\t\"meta\": map[string]any{","sourceCodeStart":683,"sourceCodeEnd":719,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/guangyapan/driver.go#L683-L719","documentation":"Step one of SMS login preparation: POST to /v1/auth/verification to obtain a verification_id. Thrown when the response is an HTTP error, has an error field, or the VerificationID is empty. Before giving up the driver self-heals once: if the error mentions captcha_invalid or 'captcha_token expired' it force-refreshes the captcha token and retries the request.","triggerScenarios":"prepareSMSCode -> requestVerificationID with a stale/missing X-Captcha-Token (the one-retry path fires and also fails), the phone number is rejected, rate limiting on SMS requests, or provider 5xx.","commonSituations":"Captcha token stored in driver config expired (they are short-lived) and the single automatic retry also failed; too many verification requests in a row trigger provider throttling; service outage.","solutions":["Retry after a wait - the common cause is a stale captcha token and one retry may not be enough if the service is flaky.","Reduce SMS request frequency to avoid provider throttling.","If persistent, clear the stored captcha token and retry so ensureCaptchaToken does a fresh init."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := d.prepareSMSCode(ctx); err != nil {\n    if strings.Contains(err.Error(), \"request verification failed\") {\n        time.Sleep(2 * time.Second)\n        // driver already self-heals captcha once; one outer retry covers flaky shields\n        err = d.prepareSMSCode(ctx)\n    }\n    if err != nil {\n        return err // persistent failure: likely rate limit or outage\n    }\n}","preventionTips":["Do not request SMS codes in a tight loop; space attempts by minutes.","Let the driver's built-in captcha refresh run; do not pre-set stale captcha tokens in config."],"tags":["auth","sms-login","captcha","rate-limit","guangyapan"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}