{"record":{"id":"d0c5fbbd3ff88a1a","repo":"fish2018/pansou","slug":"u3c3","errorCode":null,"errorMessage":"u3c3 所有域名均不可用","messagePattern":"u3c3 所有域名均不可用","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/u3c3/u3c3.go","lineNumber":187,"sourceCode":"\t\tif lastErr != nil || resp == nil || resp.StatusCode != 200 {\n\t\t\tcontinue\n\t\t}\n\t\tbody, readErr := io.ReadAll(resp.Body)\n\t\tresp.Body.Close()\n\t\tif readErr != nil {\n\t\t\tlastErr = readErr\n\t\t\tcontinue\n\t\t}\n\t\tsearch2 = p.extractSearch2FromHTML(string(body))\n\t\tif search2 != \"\" {\n\t\t\tp.setActiveURL(baseURL)\n\t\t\tbreak\n\t\t}\n\t\tlastErr = fmt.Errorf(\"无法从首页提取search2参数\")\n\t}\n\tif search2 == \"\" {\n\t\tif lastErr == nil {\n\t\t\tlastErr = fmt.Errorf(\"u3c3 所有域名均不可用\")\n\t\t}\n\t\treturn \"\", lastErr\n\t}\n\n\t// 缓存参数\n\tp.search2 = search2\n\tp.lastSync = time.Now()\n\n\tif p.debugMode {\n\t\tlog.Printf(\"[U3C3] 获取到search2参数: %s\", search2)\n\t}\n\n\treturn search2, nil\n}\n\n// extractSearch2FromHTML 从HTML中提取search2参数\nfunc (p *U3c3Plugin) extractSearch2FromHTML(html string) string {\n\t// 按行处理，排除注释行","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/u3c3/u3c3.go#L169-L205","documentation":"The u3c3 plugin searches multiple mirror domains for a hidden 'search2' form parameter required to build search queries. If every candidate domain fails (network errors, blocked domains, or page markup changes prevent extracting search2), lastErr stays nil only if no domain attempt even produced an error, and the plugin throws 'u3c3 所有域名均不可用' (all domains unavailable). It means the plugin could not bootstrap a working search endpoint at all.","triggerScenarios":"Calling SearchWithResult or TestU3c3LiveSearch when: all configured u3c3 mirror domains fail to load (DNS/network/firewall), the homepage HTML no longer contains the search2 parameter (site markup change), or the site blocks requests (bot detection, geo-block).","commonSituations":"Running in an environment with no internet or a firewall blocking these pirate-index domains; the u3c3 site changed its homepage structure or rotated domains; ISP/GFW blocking; server egress restrictions in CI.","solutions":["Check network connectivity from the host to the u3c3 mirror domains (curl one of them)","Update the domain list in the plugin to the current mirrors","Re-inspect the homepage HTML and update the search2 extraction logic if the markup changed","Use a proxy or deploy the service in a region where the domains are reachable","Report/patch the plugin if the site is permanently dead"],"exampleFix":"// before\nsearch2, err := p.getSearch2Parameter()\nif err != nil { return nil, err }\n// after\nsearch2, err := p.getSearch2Parameter()\nif err != nil {\n    log.Warnf(\"u3c3 unavailable: %v, falling back to next plugin\", err)\n    return p.fallbackSearch(query)\n}","handlingStrategy":"fallback","validationCode":"func u3c3Available(domains []string) bool {\n    for _, d := range domains {\n        resp, err := http.Get(\"https://\" + d)\n        if err == nil {\n            resp.Body.Close()\n            return true\n        }\n    }\n    return false\n}","typeGuard":null,"tryCatchPattern":"results, err := u3c3Plugin.SearchWithResult(ctx, query)\nif err != nil {\n    log.Warn(\"u3c3 unavailable, skipping: %v\", err)\n    results = emptyResults // continue with other plugins\n}","preventionTips":["Health-check mirror domains before registering the plugin","Keep the mirror domain list up to date","Implement multi-domain fallback inside the caller","Run periodic live tests (TestU3c3LiveSearch) and alert on failure"],"tags":["network","scraping","plugin","dom-parsing"],"backgroundTag":"http-request-failed","analyzedSha":"beaa56133755a548ebc51b090b3816e2ae044aa6","analyzedAt":"2026-09-07T00:31:18.025Z","contentChangedAt":"2026-09-07T00:31:18.025Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}