{"record":{"id":"2781c761478c8306","repo":"pathwaycom/pathway","slug":"rdkafka-settings-must-contain-a-non-empty-bootstr","errorCode":null,"errorMessage":"rdkafka_settings must contain a non-empty 'bootstrap.servers' entry so the consumer can locate a broker; got {rdkafka_settings.get('bootstrap.servers')!r}.","messagePattern":"rdkafka_settings must contain a non-empty 'bootstrap\\.servers' entry so the consumer can locate a broker; got (.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/io/kafka/__init__.py","lineNumber":251,"sourceCode":"    >>> t = pw.io.kafka.read(\n    ...     rdkafka_settings,\n    ...     topic=\"animals\",\n    ...     format=\"json\",\n    ...     schema=InputSchema,\n    ...     json_field_paths={\n    ...         \"pet_id\": \"/pet/identification/id\",\n    ...         \"pet_name\": \"/pet/name\",\n    ...         \"pet_height\": \"/pet/measurements/1\"\n    ...     },\n    ... )\n\n    Note that you would not need to provide the JSONPath for ``pet_id`` if it is\n    at the top level of the key JSON.\n    \"\"\"\n    # The data_storage is common to all kafka connectors\n\n    if not rdkafka_settings.get(\"bootstrap.servers\"):\n        raise ValueError(\n            \"rdkafka_settings must contain a non-empty 'bootstrap.servers' \"\n            \"entry so the consumer can locate a broker; got \"\n            f\"{rdkafka_settings.get('bootstrap.servers')!r}.\"\n        )\n    if not rdkafka_settings.get(\"group.id\"):\n        raise ValueError(\n            \"rdkafka_settings must contain a non-empty 'group.id' entry: \"\n            \"Pathway's Kafka reader uses 'subscribe' (not 'assign'), which \"\n            \"librdkafka refuses to perform without a configured consumer \"\n            f\"group id; got {rdkafka_settings.get('group.id')!r}.\"\n        )\n\n    if max_backlog_size is not None and max_backlog_size <= 0:\n        raise ValueError(\n            f\"'max_backlog_size' must be positive; got {max_backlog_size}. \"\n            f\"A non-positive value would prevent any entry from being \"\n            f\"processed and the reader would never make progress.\"\n        )","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/io/kafka/__init__.py#L233-L269","documentation":"pw.io.kafka.read validates that the rdkafka_settings dict contains a non-empty 'bootstrap.servers' entry — without a broker address the librdkafka consumer cannot connect to anything. The error message includes the offending value (e.g. None or '') so you can see exactly what was found.","triggerScenarios":"pw.io.kafka.read(rdkafka_settings={'group.id': 'g'}, topic='t') — 'bootstrap.servers' key missing; or rdkafka_settings={'bootstrap.servers': ''} with an empty string; or a typo'd key like 'bootstrap.server' or 'bootstrap_servers'.","commonSituations":"Loading rdkafka_settings from a config file/env where the broker address variable was not set; using the key name from a different Kafka client library (underscore vs dot); passing settings intended for pw.io.kafka.write with the address stripped out.","solutions":["Add the broker list: rdkafka_settings = {'bootstrap.servers': 'localhost:9092', 'group.id': 'my-group'} (multiple brokers comma-separated).","Check for typos in the key — it must be exactly 'bootstrap.servers' with a dot.","If settings come from config, log/fail fast when the address is empty instead of passing it through."],"exampleFix":"# before\nrdkafka_settings = {\"group.id\": \"consumer-group\"}\nt = pw.io.kafka.read(rdkafka_settings, topic=\"t\")\n# after\nrdkafka_settings = {\n    \"bootstrap.servers\": \"localhost:9092\",\n    \"group.id\": \"consumer-group\",\n}\nt = pw.io.kafka.read(rdkafka_settings, topic=\"t\")","handlingStrategy":"validation","validationCode":"def require_bootstrap_servers(rdkafka_settings: dict) -> None:\n    if not rdkafka_settings.get(\"bootstrap.servers\"):\n        raise SystemExit(\n            \"rdkafka_settings['bootstrap.servers'] is missing or empty\"\n        )\n\nrequire_bootstrap_servers(rdkafka_settings)\nt = pw.io.kafka.read(rdkafka_settings, topic=\"t\")","typeGuard":"def has_bootstrap_servers(settings: dict) -> bool:\n    return bool(settings.get(\"bootstrap.servers\"))","tryCatchPattern":null,"preventionTips":["Build rdkafka_settings from one shared, tested config helper per app.","Assert required keys at startup: {'bootstrap.servers', 'group.id'} for readers.","Load broker addresses from env with a fail-fast default, never pass empty strings."],"tags":["kafka","configuration","connection","pathway"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}