{"record":{"id":"344d16ca695e2fc4","repo":"github/spec-kit","slug":"catalog-source-id-url-must-be-a-valid-url-with","errorCode":null,"errorMessage":"Catalog '{source_id}' URL must be a valid URL with a host: {url}","messagePattern":"Catalog '(.+?)' URL must be a valid URL with a host: (.+?)","errorType":"exception","errorClass":"BundlerError","httpStatus":null,"severity":"error","filePath":"src/specify_cli/bundler/services/adapters.py","lineNumber":97,"sourceCode":"        hostname = parsed.hostname\n        # Accessing ``port`` performs urllib's syntax/range validation.\n        _ = parsed.port\n    except ValueError:\n        raise BundlerError(\n            f\"Catalog '{source_id}' URL is malformed: {url}\"\n        ) from None\n    is_localhost = hostname in (\"localhost\", \"127.0.0.1\", \"::1\")\n    if parsed.scheme != \"https\" and not (parsed.scheme == \"http\" and is_localhost):\n        raise BundlerError(\n            f\"Catalog '{source_id}' URL must use HTTPS (got {parsed.scheme}://). \"\n            \"HTTP is only allowed for localhost.\"\n        )\n    # Check hostname, not netloc: netloc is truthy for host-less URLs like\n    # \"https://:8080\" or \"https://user@...\", so requiring netloc would let\n    # those through even though they carry no host. hostname is None in those\n    # cases. Mirrors the fix in ``specify_cli.catalogs`` (#3210).\n    if not hostname:\n        raise BundlerError(\n            f\"Catalog '{source_id}' URL must be a valid URL with a host: {url}\"\n        )\n\n\ndef _load_packaged_community_catalog() -> dict:\n    core_pack = _locate_core_pack()\n    path = (\n        core_pack / \"bundles\" / \"catalog.community.json\"\n        if core_pack is not None\n        else _repo_root() / \"bundles\" / \"catalog.community.json\"\n    )\n    if not path.is_file():\n        raise BundlerError(f\"Bundled community catalog not found: {path}\")\n    return loads_json(path.read_text(encoding=\"utf-8\"), origin=str(path))\n\n\ndef make_catalog_fetcher(*, allow_network: bool = True):\n    \"\"\"Return a fetcher callable suitable for :class:`CatalogStack`.","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/github/spec-kit/blob/bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c/src/specify_cli/bundler/services/adapters.py#L79-L115","documentation":"Error \"Catalog '{source_id}' URL must be a valid URL with a host: {url}\" thrown in github/spec-kit.","triggerScenarios":"Thrown at src/specify_cli/bundler/services/adapters.py:97 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a catalog URL that includes a valid host, e.g. https://example.com/catalog.json."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c","analyzedAt":"2026-08-14T19:43:37.150Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}