{"record":{"id":"232999bfed9ac885","repo":"fish2018/pansou","slug":"action-id","errorCode":null,"errorMessage":"未找到潜在的Action ID","messagePattern":"未找到潜在的Action ID","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/panyq/panyq.go","lineNumber":427,"sourceCode":"\t\t\n\t\t// 保存到内存缓存\n\t\tactionIDCacheLock.Lock()\n\t\tfor k, v := range finalIDs {\n\t\t\tactionIDCache[k] = v\n\t\t}\n\t\tactionIDCacheLock.Unlock()\n\t\t\n\t\treturn finalIDs, nil\n\t}\n\t\n\t// 从网站获取潜在的Action ID\n\tpotentialIDs, err := p.findPotentialActionIDs(p.client)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t\n\tif len(potentialIDs) == 0 {\n\t\treturn nil, fmt.Errorf(\"未找到潜在的Action ID\")\n\t}\n\t\n\tif DebugLog {\n\t\t// fmt.Printf(\"panyq: 找到 %d 个潜在的 Action ID\\n\", len(potentialIDs))\n\t\tif len(potentialIDs) > 0 {\n\t\t\tfmt.Printf(\"panyq: 样例ID: %s\\n\", potentialIDs[0])\n\t\t}\n\t}\n\t\n\tfinalIDs = make(map[string]string)\n\t\n\t// 1. 验证credential_action_id - 并发验证\n\tif DebugLog {\n\t\tfmt.Println(\"panyq: validating credential_action_id...\")\n\t}\n\t\n\t// 使用通道存储验证成功的ID\n\tcredIDChan := make(chan string, len(potentialIDs))","sourceCodeStart":409,"sourceCodeEnd":445,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/panyq/panyq.go#L409-L445","documentation":"discoverActionIDs found zero candidate Action IDs: findPotentialActionIDs successfully fetched the site homepage but extracted no potential IDs from it. Without candidates the plugin cannot build credentials, so discovery aborts.","triggerScenarios":"Called from doSearch (cold cache) or getOrDiscoverActionIDs when the homepage HTML/JS no longer contains the patterns findPotentialActionIDs matches — typically after an upstream site redesign or when the fetched page is not the real homepage (captcha page, error page, CDN block).","commonSituations":"Upstream changed its JS bundle so the ID-extraction regex/logic matches nothing; the request was intercepted by WAF/anti-bot returning HTML without IDs; offline proxy returned an empty or error page.","solutions":["Enable DebugLog and inspect what findPotentialActionIDs actually fetched (page size, content).","curl BaseURL and confirm the homepage still embeds candidate Action IDs.","Update the extraction logic/regex in findPotentialActionIDs to match the new site bundle.","Check for anti-bot interception (captcha/WAF page) and add appropriate headers or cookies."],"exampleFix":"// before\npotentialIDs, err := p.findPotentialActionIDs(p.client)\nif err != nil {\n    return nil, err\n}\nif len(potentialIDs) == 0 {\n    return nil, fmt.Errorf(\"未找到潜在的Action ID\")\n}\n// after\npotentialIDs, err := p.findPotentialActionIDs(p.client)\nif err != nil {\n    return nil, fmt.Errorf(\"提取潜在Action ID失败: %w\", err)\n}\nif len(potentialIDs) == 0 {\n    if DebugLog {\n        fmt.Println(\"panyq: homepage contained no candidate Action IDs — site layout may have changed\")\n    }\n    return nil, fmt.Errorf(\"未找到潜在的Action ID\")\n}","handlingStrategy":"fallback","validationCode":"resp, err := http.Get(BaseURL)\nif err != nil || resp.StatusCode != 200 {\n    return errors.New(\"cannot fetch homepage; discovery will fail\")\n}","typeGuard":null,"tryCatchPattern":"results, err := plugin.Search(kw)\nif err != nil && strings.Contains(err.Error(), \"未找到潜在的Action ID\") {\n    log.Println(\"panyq site layout likely changed; using fallback source\")\n    return alternateSearch(kw)\n}","preventionTips":["Pin plugin versions tested against the current site","Detect WAF/captcha pages before extraction","Alert on discovery failures to catch upstream redesigns early","Cache last-known-good IDs with TTL"],"tags":["scraping","upstream","action-id","empty-result"],"backgroundTag":"empty-result-set","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"}