fish2018/pansou · error
访问登录页面失败
Error message
访问登录页面失败: %w
What it means
Step 1 of gying login performs a GET of the site's login page via requestWithChallengeRetry (which handles Cloudflare challenges). If that request fails at the transport level (connection error, timeout, challenge not solvable), the error is wrapped as '访问登录页面失败: %w' and the login aborts before any credentials are sent.
Solutions
- Verify basic connectivity to the site base URL (curl -I <baseURL>, with the same proxy if configured).
- Check the proxy: it may be down or too slow, causing request timeouts — switch or disable it.
- Re-run with DebugLog enabled to see how many challenge retries were attempted and the underlying error.
- Update the plugin/cloudscraper so the Cloudflare challenge solver matches the site's current protection level.
- Retry later if the site itself is temporarily down or rate-limiting your IP.
Defensive patterns
Strategy: retry
Try / catch
var lastErr error
for i := 0; i < 3; i++ {
res, err := gyingLogin(ctx, creds)
if err == nil {
return res, nil
}
lastErr = err
if !strings.Contains(err.Error(), "访问登录页面失败") || !isTransient(err) {
return err
}
time.Sleep(time.Duration(1<<i) * time.Second)
}
return lastErr Prevention
- Ensure the proxy (if any) is healthy and low-latency.
- Don't hammer login — back off between attempts to avoid Cloudflare flags.
- Keep cloudscraper updated for current challenge support.
- Monitor site availability before scheduled login jobs.
When it happens
Trigger: Calling gying login when the GET to loginPageURL errors in requestWithChallengeRetry — network unreachable, DNS failure, TLS error, or exhausted challenge-retry attempts.
Common situations: Site blocked or down; proxy offline; Cloudflare returns an unsolvable challenge repeatedly; corporate firewall or GFW interference; DNS pollution of the site domain.
Understand the failure class
Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.
Related errors
AI-assisted analysis of fish2018/pansou@beaa561337 (2026-09-07).
Data as JSON: /api/errors/7a296b23e553337c.
Report an issue: GitHub.
Appendix: source
Thrown at plugin/gying/gying.go:2121
fmt.Printf("[Gying] cloudscraper创建成功(已禁用403自动刷新)\n")
}
// 创建cookieMap用于收集所有cookies
cookieMap := make(map[string]string)
// ========== 步骤1: GET登录页 (获取初始PHPSESSID) ==========
loginPageURL := p.getLoginPageURL()
if DebugLog {
fmt.Printf("[Gying] 步骤1: 访问登录页面: %s\n", loginPageURL)
}
_, statusCode, headers, err := p.requestWithChallengeRetry(scraper, http.MethodGet, loginPageURL, "", "")
if err != nil {
if DebugLog {
fmt.Printf("[Gying] 访问登录页面失败: %v\n", err)
}
return nil, "", fmt.Errorf("访问登录页面失败: %w", err)
}
if DebugLog {
fmt.Printf("[Gying] 登录页面状态码: %d\n", statusCode)
}
if statusCode != http.StatusOK {
return nil, "", fmt.Errorf("访问登录页面失败: HTTP %d", statusCode)
}
// 从登录页响应中收集cookies
collectSetCookies(headers, cookieMap)
logSetCookiesForDebug(headers, "[Gying] 登录页Cookie: %s=%s\n", 20)
// ========== 步骤2: POST登录 (获取认证cookies) ==========
loginURL := p.getLoginAPIURL()
postData := fmt.Sprintf("code=&siteid=1&dosubmit=1&cookietime=10506240&username=%s&password=%s",
url.QueryEscape(username),
url.QueryEscape(password))View on GitHub (pinned to beaa561337)