fish2018/pansou · error

[ ] 所有域名均不可用

Error message

[%s] 所有域名均不可用

What it means

This error is returned by searchSuggestWithFallback in plugin/qiwei/qiwei.go:184 when the qiwei plugin fails to get suggestion results from every configured qiweiHosts domain. The loop iterates all host candidates, calling searchSuggest on each; when every attempt returns an error, the loop ends and the last error is propagated (or, only if there were no hosts and thus no attempt was made, this generic 'all domains unavailable' error is constructed). It is the plugin's aggregate 'nothing worked' signal to the caller searchImpl.

Solutions

  1. Check basic outbound connectivity from the deployment (curl https://www.qmp4.com/index.php/ajax/suggest?mid=1&limit=10&wd=test) to rule out network/DNS/firewall issues.
  2. If the response is a verification/anti-bot page on every host, reduce request rate or route through a proxy with clean cookies; the plugin's cookie jar may be flagged.
  3. Update the qiweiHosts list in plugin/qiwei/qiwei.go if the sites have rotated domains.
  4. Retry later — transient upstream outages produce this across all mirrors at once; pansou aggregates other plugins so one failing plugin is tolerable.
Defensive patterns

Strategy: fallback

Validate before calling

// Go: probe connectivity to the primary host before invoking the plugin search
func reachable(u string) bool {
    c := &http.Client{Timeout: 5 * time.Second}
    resp, err := c.Get(u)
    if err != nil { return false }
    resp.Body.Close()
    return resp.StatusCode < 500
}
// if !reachable("https://www.qmp4.com") { skip qiwei plugin / use other sources }

Try / catch

results, err := plugin.Search(keyword, ext)
if err != nil {
    log.Printf("qiwei unavailable: %v; falling back to other plugins", err)
    return fallbackSearch(keyword) // continue with remaining sources
}

Prevention

When it happens

Trigger: All configured hosts (www.qmp4.com and mirrors) fail searchSuggest — each returns a network error, timeout, verification page, or non-JSON/abnormal suggest response. Practically this fires after the loop over hostCandidates() exhausts every host with err != nil.

Common situations: The upstream qiwei sites are down, blocked, or rate-limiting the server's IP; all mirrors simultaneously serve anti-bot verification pages; the server has no outbound internet/DNS; the hardcoded host list is stale after the sites change domains (the most common long-term cause, since hosts are hardcoded in qiweiHosts).

Related errors


AI-assisted analysis of fish2018/pansou@beaa561337 (2026-09-07). Data as JSON: /api/errors/ac4ca1580f221c96. Report an issue: GitHub.

Appendix: source

Thrown at plugin/qiwei/qiwei.go:184

		return []model.SearchResult{}, nil
	}

	return plugin.FilterResultsByKeyword(results, keyword), nil
}

func (p *QiweiPlugin) searchSuggestWithFallback(client *http.Client, keyword string) ([]suggestItem, string, error) {
	var lastErr error
	for _, host := range p.hostCandidates() {
		items, err := p.searchSuggest(client, host, keyword)
		if err == nil {
			p.setActiveHost(host)
			return items, host, nil
		}
		lastErr = err
	}

	if lastErr == nil {
		lastErr = fmt.Errorf("[%s] 所有域名均不可用", p.Name())
	}
	return nil, "", lastErr
}

func (p *QiweiPlugin) searchSuggest(client *http.Client, host, keyword string) ([]suggestItem, error) {
	searchURL := fmt.Sprintf("%s/index.php/ajax/suggest?mid=1&limit=%d&wd=%s", host, searchSuggestLimit, url.QueryEscape(keyword))
	body, err := p.fetchBody(client, searchURL, host+"/", searchTimeout)
	if err != nil {
		return nil, err
	}
	if isVerifyPage(body) {
		if err := p.solveVerification(client, searchURL, body); err != nil {
			return nil, fmt.Errorf("[%s] 搜索验证失败: %w", p.Name(), err)
		}
		body, err = p.fetchBody(client, searchURL, host+"/", searchTimeout)
		if err != nil {
			return nil, err
		}

View on GitHub (pinned to beaa561337)