fish2018/pansou · error

提交 Anubis 验证结果失败

Error message

提交 Anubis 验证结果失败: %w

What it means

After solving the challenge, the answer is submitted via GET to the Anubis pass endpoint. This error wraps an http.Client.Do transport failure on that submission request (miosou.go:204) — the solution was computed but never delivered.

Solutions

  1. Increase gateTimeout so PoW solving + submission both fit, especially on slow hardware.
  2. Retry — ensureGate re-runs the whole flow up to 3 times.
  3. Check network/proxy stability between the site and the client.
  4. If context.DeadlineExceeded, reserve budget for submission (e.g. shorter PoW deadline, longer total deadline).

Example fix

// before
ctx, cancel := context.WithTimeout(context.Background(), gateTimeout)
// after
ctx, cancel := context.WithTimeout(context.Background(), gateTimeout)
debug := "" // on timeout, check errors.Is(err, context.DeadlineExceeded)
_ = debug
Defensive patterns

Strategy: retry

Try / catch

if err := p.ensureGate(); err != nil {
    if errors.Is(err, context.DeadlineExceeded) || strings.Contains(err.Error(), "提交 Anubis 验证结果失败") {
        // budget exhausted: raise gateTimeout or retry later
    }
    return err
}

Prevention

When it happens

Trigger: p.client.Do(passReq) fails: connection reset/refused, TLS error, DNS failure, or the shared gateTimeout context expired during PoW solving, leaving no time for submission.

Common situations: Slow devices spending most of gateTimeout on the PoW so the submission phase times out; unstable network mid-flow; server dropping keep-alive connections between the two requests.

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/f8311d75efa22170. Report an issue: GitHub.

Appendix: source

Thrown at plugin/miosou/miosou.go:204

	if elapsed < 1 {
		elapsed = 1
	}
	query := url.Values{
		"id":          []string{challenge.Challenge.ID},
		"response":    []string{hash},
		"nonce":       []string{strconv.FormatUint(nonce, 10)},
		"redir":       []string{baseURL + "/"},
		"elapsedTime": []string{strconv.FormatInt(elapsed, 10)},
	}
	passReq, err := http.NewRequestWithContext(ctx, http.MethodGet, baseURL+anubisPassPath+"?"+query.Encode(), nil)
	if err != nil {
		return fmt.Errorf("创建 Anubis 验证提交请求失败: %w", err)
	}
	setPageHeaders(passReq)
	passReq.Header.Set("Referer", resp.Request.URL.String())
	passResp, err := p.client.Do(passReq)
	if err != nil {
		return fmt.Errorf("提交 Anubis 验证结果失败: %w", err)
	}
	io.Copy(io.Discard, io.LimitReader(passResp.Body, 1<<20))
	passResp.Body.Close()
	if passResp.StatusCode != http.StatusOK || isAnubisGateResponse(passResp) {
		return fmt.Errorf("Anubis 验证结果返回状态码 %d", passResp.StatusCode)
	}
	return nil
}

func (p *MiosouPlugin) invalidateGate() {
	p.gateMu.Lock()
	p.gateReady = false
	p.gateMu.Unlock()
}

func setHeaders(req *http.Request, accept string) {
	req.Header.Set("User-Agent", browserUserAgent)
	req.Header.Set("Accept", accept)

View on GitHub (pinned to beaa561337)