{"record":{"id":"f967b6a85e1f9769","repo":"NanmiCoder/MediaCrawler","slug":"unkown-err","errorCode":null,"errorMessage":"unkown err","messagePattern":"unkown err","errorType":"exception","errorClass":"IpGetError","httpStatus":null,"severity":"error","filePath":"proxy/providers/jishu_http_proxy.py","lineNumber":95,"sourceCode":"            })\n            res_dict: Dict = response.json()\n            if res_dict.get(\"code\") == 0:\n                data: List[Dict] = res_dict.get(\"data\")\n                current_ts = utils.get_unix_timestamp()\n                for ip_item in data:\n                    ip_info_model = IpInfoModel(\n                        ip=ip_item.get(\"ip\"),\n                        port=ip_item.get(\"port\"),\n                        user=ip_item.get(\"user\"),\n                        password=ip_item.get(\"pass\"),\n                        expired_time_ts=utils.get_unix_time_from_time_str(ip_item.get(\"expire\")),\n                    )\n                    ip_key = f\"JISUHTTP_{ip_info_model.ip}_{ip_info_model.port}_{ip_info_model.user}_{ip_info_model.password}\"\n                    ip_value = ip_info_model.json()\n                    ip_infos.append(ip_info_model)\n                    self.ip_cache.set_ip(ip_key, ip_value, ex=ip_info_model.expired_time_ts - current_ts)\n            else:\n                raise IpGetError(res_dict.get(\"msg\", \"unkown err\"))\n        return ip_cache_list + ip_infos\n\n\ndef new_jisu_http_proxy() -> JiSuHttpProxy:\n    \"\"\"\n    Construct JiSu HTTP instance\n    Returns:\n\n    \"\"\"\n    return JiSuHttpProxy(\n        key=os.getenv(\"jisu_key\", \"\"),  # Get JiSu HTTP IP extraction key value through environment variable\n        crypto=os.getenv(\"jisu_crypto\", \"\"),  # Get JiSu HTTP IP extraction encryption signature through environment variable\n        time_validity_period=30  # 30 minutes (maximum validity)\n    )\n","sourceCodeStart":77,"sourceCodeEnd":110,"githubUrl":"https://github.com/NanmiCoder/MediaCrawler/blob/d6f7c5bb906b6dac40ddf343ef9e26438a3de092/proxy/providers/jishu_http_proxy.py#L77-L110","documentation":"IpGetError raised by JiSuHttpProxy.get_proxy_ip when the JiSu HTTP API responds with a result code indicating failure and the message is missing or unrecognized ('unkown err' is the fallback for an absent msg field). The exception comes from proxy/base_proxy.py and aborts proxy acquisition for the jishu provider.","triggerScenarios":"Calling the jisu proxy API with a missing/wrong jisu_key or jisu_crypto env var, an expired balance/plan, a rate limit on IP extraction, or a changed API contract so the expected fields are absent - res_dict carries no usable msg.","commonSituations":"jisu_key/jisu_crypto environment variables never set (they default to empty strings); jisu subscription exhausted; upstream response schema changed; calling get_proxy_ip more often than the plan allows.","solutions":["Set the JISU_HTTP env vars: export jisu_key=... and jisu_crypto=... before running (they are read via os.getenv with empty defaults).","Check the jisu account balance/quota and that the key is active.","Log the full res_dict (excluding secrets) to see the real code when msg is missing.","If the API contract changed, update the URL/params/parsing in proxy/providers/jishu_http_proxy.py to match current jisu docs."],"exampleFix":"# before\n# run without env vars -> res_dict has error, no msg -> 'unkown err'\npython main.py --platform xhs --type search\n# after\nexport jisu_key=\"your_key\" jisu_crypto=\"your_crypto\"\npython main.py --platform xhs --type search","handlingStrategy":"validation","validationCode":"import os\ndef jisu_env_is_set() -> bool:\n    return bool(os.getenv(\"jisu_key\")) and bool(os.getenv(\"jisu_crypto\"))","typeGuard":null,"tryCatchPattern":"from proxy.base_proxy import IpGetError\ntry:\n    proxies = await jisu_proxy.get_proxy_ip()\nexcept IpGetError as e:\n    if str(e) == \"unkown err\":\n        raise RuntimeError(\"jisu proxy API failed without msg - check jisu_key/jisu_crypto and account balance\") from e\n    raise","preventionTips":["Set jisu_key and jisu_crypto env vars before starting any proxy-enabled crawl.","Health-check the jisu API once at startup with a single canary extraction.","Log the provider's result code (not just msg) so 'unkown err' never appears blind.","Keep proxy extraction frequency within the plan's rate limits."],"tags":["proxy","jisu-http","config","credentials"],"backgroundTag":null,"analyzedSha":"d6f7c5bb906b6dac40ddf343ef9e26438a3de092","analyzedAt":"2026-08-15T01:39:07.505Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}