{"record":{"id":"0f1b5bbfa5e59656","repo":"pathwaycom/pathway","slug":"schemaregistrysettings-urls-i-must-be-a-non-emp","errorCode":null,"errorMessage":"SchemaRegistrySettings.urls[{i}] must be a non-empty string; got {url!r}.","messagePattern":"SchemaRegistrySettings\\.urls\\[(.+?)\\] must be a non-empty string; got (.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/internals/_io_helpers.py","lineNumber":286,"sourceCode":"    headers: list[SchemaRegistryHeader] | None = None\n    proxy: str | None = None\n    timeout: datetime.timedelta | None = None\n\n    def __post_init__(self):\n        if not isinstance(self.urls, (list, tuple)):\n            raise TypeError(\n                f\"SchemaRegistrySettings.urls must be a list of strings, \"\n                f\"got {type(self.urls).__name__}. Wrap a single URL in a \"\n                f\"list: urls=['http://...'].\"\n            )\n        if not self.urls:\n            raise ValueError(\n                \"SchemaRegistrySettings requires at least one entry in 'urls'; \"\n                \"got an empty list.\"\n            )\n        for i, url in enumerate(self.urls):\n            if not isinstance(url, str) or not url:\n                raise ValueError(\n                    f\"SchemaRegistrySettings.urls[{i}] must be a non-empty \"\n                    f\"string; got {url!r}.\"\n                )\n        for field_name in (\"token_authorization\", \"username\", \"password\", \"proxy\"):\n            value = getattr(self, field_name)\n            if value is not None and not isinstance(value, str):\n                raise TypeError(\n                    f\"SchemaRegistrySettings.{field_name} must be a str, \"\n                    f\"got {type(value).__name__}.\"\n                )\n        if self.password is not None and self.username is None:\n            raise ValueError(\n                \"SchemaRegistrySettings: 'password' was provided without \"\n                \"'username'. Both are needed for username/password \"\n                \"authentication.\"\n            )\n        if self.token_authorization is not None and (\n            self.username is not None or self.password is not None","sourceCodeStart":268,"sourceCodeEnd":304,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/internals/_io_helpers.py#L268-L304","documentation":"SchemaRegistrySettings validates every entry of the 'urls' list in its __post_init__. Each element must be a non-empty string. This error fires when one element is either not a str at all (e.g. an int, None, bytes) or is the empty string ''. The settings object is used to configure the Confluent Schema Registry connection for pw.io.kafka connectors, and an invalid URL entry would break every HTTP request, so it is rejected eagerly at construction time.","triggerScenarios":"Constructing SchemaRegistrySettings(urls=['']) or urls=['http://registry:8081', None] or urls=[8081]. Also triggered by URLs read from config/env where an unset variable produced '' (e.g. os.environ.get('REGISTRY_URL', '')), or by parsing a delimited string like env.split(',') which yields '' when the env var is empty.","commonSituations":"Loading registry URLs from environment variables or YAML config where a missing value becomes an empty string; copy-pasting a URL list with a trailing comma; passing a port number or parsed URL object instead of a string.","solutions":["Inspect the reported index urls[i] and fix or remove the offending entry.","If URLs come from config, filter blanks before construction: urls=[u for u in raw_urls if u].","Ensure every element is a plain Python str (wrap or str()-convert parsed values).","Fall back to a sensible default URL when the config value is empty."],"exampleFix":"# before\nsettings = pw.io.kafka.SchemaRegistrySettings(\n    urls=os.environ.get(\"SCHEMA_REGISTRY_URL\", \"\").split(\",\")\n)\n\n# after\nraw = [u.strip() for u in os.environ.get(\"SCHEMA_REGISTRY_URL\", \"\").split(\",\")]\nsettings = pw.io.kafka.SchemaRegistrySettings(\n    urls=[u for u in raw if u]\n)","handlingStrategy":"validation","validationCode":"def clean_registry_urls(raw) -> list[str]:\n    if isinstance(raw, str):\n        raw = [raw]\n    urls = [u.strip() for u in raw or []]\n    bad = [(i, u) for i, u in enumerate(urls) if not isinstance(u, str) or not u]\n    if bad:\n        raise ValueError(f\"invalid registry urls at {bad}\")\n    return urls\n\nurls = clean_registry_urls(os.environ.get(\"SCHEMA_REGISTRY_URL\", \"\").split(\",\"))\nsettings = pw.io.kafka.SchemaRegistrySettings(urls=urls)","typeGuard":"def is_valid_url_list(urls) -> bool:\n    return (\n        isinstance(urls, (list, tuple))\n        and len(urls) > 0\n        and all(isinstance(u, str) and u for u in urls)\n    )","tryCatchPattern":null,"preventionTips":["Filter empty strings from URL lists built via split(',') before passing them to SchemaRegistrySettings.","Keep registry URLs in one typed config field (list of non-empty strings) validated at load time.","Never mix types in the urls list; convert everything to str at the config boundary."],"tags":["kafka","schema-registry","validation","configuration"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}