{"record":{"id":"8c900bb243d48d33","repo":"chroma-core/chroma","slug":"invalid-url-seems-that-you-are-trying-to-pass-url","errorCode":null,"errorMessage":"Invalid URL. Seems that you are trying to pass URL as a host but without                   specifying the protocol. Please add http:// or https:// to the host.","messagePattern":"Invalid URL\\. Seems that you are trying to pass URL as a host but without                   specifying the protocol\\. Please add http:// or https:// to the host\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"chromadb/api/base_http_client.py","lineNumber":58,"sourceCode":"        max_keepalive_connections = self._settings.chroma_http_max_keepalive_connections\n        if max_keepalive_connections is not None:\n            limit_kwargs[\"max_keepalive_connections\"] = max_keepalive_connections\n\n        return httpx.Limits(**limit_kwargs)\n\n    @property\n    def http_limits(self) -> httpx.Limits:\n        return self._http_limits\n\n    @staticmethod\n    def _validate_host(host: str) -> None:\n        parsed = urlparse(host)\n        if \"/\" in host and parsed.scheme not in {\"http\", \"https\"}:\n            raise ValueError(\n                \"Invalid URL. \" f\"Unrecognized protocol - {parsed.scheme}.\"\n            )\n        if \"/\" in host and (not host.startswith(\"http\")):\n            raise ValueError(\n                \"Invalid URL. \"\n                \"Seems that you are trying to pass URL as a host but without \\\n                  specifying the protocol. \"\n                \"Please add http:// or https:// to the host.\"\n            )\n\n    @staticmethod\n    def resolve_url(\n        chroma_server_host: str,\n        chroma_server_ssl_enabled: Optional[bool] = False,\n        default_api_path: Optional[str] = \"\",\n        chroma_server_http_port: Optional[int] = 8000,\n    ) -> str:\n        _skip_port = False\n        _chroma_server_host = chroma_server_host\n        BaseHTTPClient._validate_host(_chroma_server_host)\n        if _chroma_server_host.startswith(\"http\"):\n            logger.debug(\"Skipping port as the user is passing a full URL\")","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/chromadb/api/base_http_client.py#L40-L76","documentation":"Second host-validation branch: the host contains '/' but does not start with 'http', and urlparse() found no recognized scheme (e.g. \"example.com/api\" or \"/server\"). The message is literal — Chroma thinks you pasted a URL as a host and forgot the protocol.","triggerScenarios":"HttpClient(host=\"chroma.example.com/api\"); host=\"/api/v2\"; any host-with-path string that has no scheme prefix. (Strings like \"localhost:8000/api\" do not reach this branch — they fail the earlier 'Unrecognized protocol' check instead.)","commonSituations":"Copying the path-qualified URL from a reverse-proxied deployment into host; config files ported from tools that expect host+path in one field.","solutions":["Add the protocol if you mean a URL: host=\"https://chroma.example.com\" (with ssl settings as needed).","Or strip the path and pass just the hostname, letting the port/path arguments carry the rest.","Set CHROMA_SERVER_HOST to a bare hostname instead of a URL."],"exampleFix":"# before\nclient = HttpClient(host=\"chroma.internal/api\")  # ValueError: add http:// or https://\n\n# after\nclient = HttpClient(host=\"https://chroma.internal\")","handlingStrategy":"validation","validationCode":"def needs_protocol(host: str) -> bool:\n    return \"/\" in host and not host.startswith(\"http\")\n\nhost = \"chroma.internal/api\"\nif needs_protocol(host):\n    host = \"https://\" + host.split(\"/\")[0]  # or fix at the config source","typeGuard":null,"tryCatchPattern":"try:\n    client = chromadb.HttpClient(host=host)\nexcept ValueError:\n    # message asks to add http:// or https:// — fix the host string\n    host = f\"https://{host}\" if \"/\" in host else host\n    client = chromadb.HttpClient(host=host)","preventionTips":["Store scheme, host, and port as separate config fields.","Never paste browser URLs into the host parameter.","Add a config schema check that host matches ^[A-Za-z0-9.:-]+$ or a full http(s) URL."],"tags":["chroma","url","configuration","input-validation","host"],"backgroundTag":"invalid-url-format","analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}