{"record":{"id":"3ab1486d0c93f61b","repo":"pathwaycom/pathway","slug":"rdkafka-settings-must-contain-a-non-empty-bootstr-3ab148","errorCode":null,"errorMessage":"rdkafka_settings must contain a non-empty 'bootstrap.servers' entry so the producer can locate a broker; got {rdkafka_settings.get('bootstrap.servers')!r}.","messagePattern":"rdkafka_settings must contain a non-empty 'bootstrap\\.servers' entry so the producer can locate a broker; got (.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/io/kafka/__init__.py","lineNumber":711,"sourceCode":"    ...     value=t2.foo,\n    ... )\n\n    Still, the table has three fields and the field ``baz`` is not produced. You can do it\n    with the usage of headers. To pass it to the header with the same name ``baz``, you need to\n    specify it:\n\n    >>> pw.io.kafka.write(\n    ...     t2,\n    ...     rdkafka_settings,\n    ...     \"test\",\n    ...     format=\"raw\",\n    ...     key=t2.bar,\n    ...     value=t2.foo,\n    ...     headers=[t2.baz],\n    ... )\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 producer can locate a broker; got \"\n            f\"{rdkafka_settings.get('bootstrap.servers')!r}.\"\n        )\n    if isinstance(topic_name, str) and not topic_name:\n        raise ValueError(\n            \"'topic_name' must be a non-empty string; got an empty string. \"\n            \"Kafka does not allow empty topic names.\"\n        )\n\n    output_format = MessageQueueOutputFormat.construct(\n        table,\n        format=format,\n        delimiter=delimiter,\n        key=key,\n        value=value,\n        headers=headers,\n        topic_name=topic_name if isinstance(topic_name, ColumnReference) else None,","sourceCodeStart":693,"sourceCodeEnd":729,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/io/kafka/__init__.py#L693-L729","documentation":"pw.io.kafka.write validates that the producer's rdkafka_settings contains a non-empty 'bootstrap.servers' entry — without a broker address the librdkafka producer cannot deliver messages. The error echoes the offending value so you can see what was actually found (usually None or '').","triggerScenarios":"pw.io.kafka.write(table, {}, 'test') — settings dict missing 'bootstrap.servers'; or {'bootstrap.servers': ''}; or the key spelled 'bootstrap_servers'/'bootstrap.server'. This is the write-side twin of the reader's check.","commonSituations":"Reusing reader settings but stripping the broker entry; loading settings from environment/config where the address variable was empty; typo in the dotted librdkafka key name.","solutions":["Add the broker list: rdkafka_settings = {'bootstrap.servers': 'localhost:9092'} (no group.id needed for producers).","Verify the key is exactly 'bootstrap.servers'.","Fail fast at startup when the address is missing rather than discovering it at first write."],"exampleFix":"# before\npw.io.kafka.write(t, {}, \"test\", format=\"raw\")\n# after\npw.io.kafka.write(\n    t,\n    {\"bootstrap.servers\": \"localhost:9092\"},\n    \"test\",\n    format=\"raw\",\n)","handlingStrategy":"validation","validationCode":"def require_producer_settings(settings: dict) -> None:\n    if not settings.get(\"bootstrap.servers\"):\n        raise SystemExit(\"producer settings need a non-empty 'bootstrap.servers'\")\n\nrequire_producer_settings(rdkafka_settings)\npw.io.kafka.write(table, rdkafka_settings, \"test\", format=\"raw\")","typeGuard":"def producer_settings_ok(settings: dict) -> bool:\n    return bool(settings.get(\"bootstrap.servers\"))","tryCatchPattern":null,"preventionTips":["No group.id needed for producers — only bootstrap.servers is mandatory.","Share one validated settings builder between read and write, adding group.id only for readers.","Fail fast on empty broker addresses at app startup."],"tags":["kafka","configuration","connection","pathway"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}