{
  "id": "pip/trusted-host-flag-misuse",
  "signature": "ERROR: Invalid value for '--trusted-host': 'example.com:8080' does not match expected pattern. Expected a hostname or IP address, optionally with a port.",
  "signature_zh": "错误：'--trusted-host' 的值无效：'example.com:8080' 不符合预期模式。期望主机名或 IP 地址，可选带端口。",
  "regex": "ERROR: Invalid value for '--trusted-host': '[^']+' does not match expected pattern\\. Expected a hostname or IP address, optionally with a port\\.",
  "domain": "pip",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The --trusted-host flag was passed a value with an incorrect format, such as a URL with scheme (https://...) or an invalid port separator, which pip cannot parse for its trusted host logic.",
  "root_cause_type": "generic",
  "root_cause_zh": "--trusted-host 标志传递的值格式不正确，例如带有 scheme 的 URL（https://...）或无效的端口分隔符，pip 无法解析以用于其受信任主机逻辑。",
  "versions": [
    {
      "version": "pip 23.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "pip 24.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "pip 24.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Pip expects only hostname:port, not a full URL; the scheme is implied.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The parser strictly expects a hostname without path components.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use the correct format: --trusted-host example.com:8080 (no scheme, no trailing slash)",
      "success_rate": 0.95,
      "how": "Use the correct format: --trusted-host example.com:8080 (no scheme, no trailing slash)",
      "condition": "",
      "sources": []
    },
    {
      "action": "If using a config file, set trusted-host = example.com:8080 in pip.conf or pip.ini",
      "success_rate": 0.9,
      "how": "If using a config file, set trusted-host = example.com:8080 in pip.conf or pip.ini",
      "condition": "",
      "sources": []
    },
    {
      "action": "For multiple hosts, repeat the flag: --trusted-host host1 --trusted-host host2:443",
      "success_rate": 0.85,
      "how": "For multiple hosts, repeat the flag: --trusted-host host1 --trusted-host host2:443",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "使用正确格式：--trusted-host example.com:8080（无 scheme，无尾部斜杠）",
    "如果使用配置文件，在 pip.conf 或 pip.ini 中设置 trusted-host = example.com:8080",
    "对于多个主机，重复该标志：--trusted-host host1 --trusted-host host2:443"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://pip.pypa.io/en/stable/cli/pip_install/#install-trusted-host",
  "official_doc_section": null,
  "error_code": "ERROR",
  "verification_tier": "ai_generated",
  "confidence": 0.9,
  "fix_success_rate": 0.95,
  "resolvable": "true",
  "first_seen": "2024-01-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}