{"record":{"id":"0334d79f7cda123a","repo":"xpzouying/xiaohongshu-mcp","slug":"v-0334d7","errorCode":null,"errorMessage":"部分商品未找到: %v","messagePattern":"部分商品未找到: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xiaohongshu/publish.go","lineNumber":1171,"sourceCode":"\t\ttime.Sleep(500 * time.Millisecond)\n\t}\n\n\t// 点击保存按钮\n\tslog.Info(\"准备点击保存按钮\")\n\tif err := clickModalSaveButton(modal); err != nil {\n\t\treturn errors.Wrap(err, \"点击保存按钮失败\")\n\t}\n\tslog.Info(\"保存按钮点击完成，开始等待弹窗关闭\")\n\n\t// 等待弹窗关闭\n\tif err := waitForModalClose(page); err != nil {\n\t\tslog.Warn(\"等待弹窗关闭超时\", \"error\", err)\n\t} else {\n\t\tslog.Info(\"弹窗已关闭\")\n\t}\n\n\tif len(failedProducts) > 0 {\n\t\treturn errors.Errorf(\"部分商品未找到: %v\", failedProducts)\n\t}\n\n\tslog.Info(\"商品绑定完成\", \"total\", len(products))\n\ttime.Sleep(1000 * time.Millisecond)\n\treturn nil\n}\n\n// clickAddProductButton 点击\"添加商品\"按钮\nfunc clickAddProductButton(page *rod.Page) error {\n\tslog.Info(\"开始查找添加商品按钮\")\n\n\t// 查找包含\"添加商品\"文本的元素\n\tspans, err := page.Elements(\"span.d-text\")\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"查找商品按钮文本失败\")\n\t}\n\n\tfor _, span := range spans {","sourceCodeStart":1153,"sourceCodeEnd":1189,"githubUrl":"https://github.com/xpzouying/xiaohongshu-mcp/blob/332d196854a9eac0d2b8c2c0e3d0cc43139d724c/xiaohongshu/publish.go#L1153-L1189","documentation":"bindProducts returns this Errorf when one or more product keywords could not be found/selected by searchAndSelectProduct. The failed keywords are listed in the message; other errors during binding were only logged as warnings and collected here. It means the product search on the platform returned no match for those terms.","triggerScenarios":"A product keyword in the products list matches no item in the product-selection search; the search box or result list failed for that keyword; the modal state got stale mid-loop.","commonSituations":"Product renamed or delisted since the keyword list was configured; typos or over-specific keywords; search rate-limiting causing empty results after the first few lookups.","solutions":["Read the failedProducts list from the message and correct/remove those keywords","Search the platform manually to confirm each product's current title","Use shorter, distinctive keywords instead of exact long titles","Retry the flow — transient search failures can cause false negatives"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// pre-validate product keywords against your config\nfor _, p := range products {\n    if strings.TrimSpace(p) == \"\" { return fmt.Errorf(\"商品关键词为空\") }\n}\n// optionally check failed list from a prior run before re-submitting","typeGuard":null,"tryCatchPattern":"err := bindProducts(ctx, page, products)\nif err != nil {\n    var failed []string\n    if _, scanErr := fmt.Sscanf(err.Error(), \"部分商品未找到: %v\", &failed); scanErr == nil {\n        // correct/remove these keywords and retry binding only for them\n    }\n}","preventionTips":["Keep product keywords short and distinctive, not exact long titles","Re-verify product listings periodically (renames/delist)","Manually confirm each keyword matches on the platform first","Treat empty search results after several lookups as possible rate-limiting"],"tags":["products","search","configuration"],"backgroundTag":"product-not-found","analyzedSha":"332d196854a9eac0d2b8c2c0e3d0cc43139d724c","analyzedAt":"2026-09-05T22:22:55.988Z","contentChangedAt":"2026-09-05T22:22:55.988Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}