Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kafka support seems broken #243

Closed
talyz opened this issue Jun 2, 2021 · 0 comments
Closed

Kafka support seems broken #243

talyz opened this issue Jun 2, 2021 · 0 comments

Comments

@talyz
Copy link

talyz commented Jun 2, 2021

I'm currently in the process of packaging parsedmarc for NixOS and writing a configurable deployment recipe for it (a NixOS module). When trying to set up a test environment with Kafka, I ran into trouble.

I found some issues in cli.py that I fixed:

--- a/parsedmarc/cli.py
+++ b/parsedmarc/cli.py
@@ -398,18 +398,10 @@ def _main():
                 exit(-1)
             if "user" in kafka_config:
                 opts.kafka_username = kafka_config["user"]
-            else:
-                logger.critical("user setting missing from the "
-                                "kafka config section")
-                exit(-1)
             if "password" in kafka_config:
                 opts.kafka_password = kafka_config["password"]
-            else:
-                logger.critical("password setting missing from the "
-                                "kafka config section")
-                exit(-1)
             if "ssl" in kafka_config:
-                opts.kafka_ssl = kafka_config["ssl"].getboolean()
+                opts.kafka_ssl = kafka_config.getboolean("ssl")
             if "skip_certificate_verification" in kafka_config:
                 kafka_verify = kafka_config.getboolean(
                     "skip_certificate_verification")
@@ -421,7 +413,7 @@ def _main():
                                 "kafka config section")
                 exit(-1)
             if "forensic_topic" in kafka_config:
-                opts.kafka_username = kafka_config["forensic_topic"]
+                opts.kafka_forensic_topic = kafka_config["forensic_topic"]
             else:
                 logger.critical("forensic_topic setting missing from the "
                                 "splunk_hec config section")

I still couldn't get it to connect, however. It fails in a loop with the error message

ERROR:conn.py:418:Connect attempt to <BrokerConnection node_id=bootstrap-0 host=localhost:9092 <connecting> [IPv6 ('::1', 9092, 0, 0)]> returned error 111. Disconnecting.

Using the Kafka CLI tools with --bootstrap-server localhost:9092 to connect to the instance works fine, so I'm not sure what's going on. Maybe this is a configuration issue, but I'm not going to put more time into it now, since I don't personally have a need for Kafka. Feel free to use the patch, btw.

talyz added a commit to talyz/nixpkgs that referenced this issue Jun 15, 2022
It's broken (see domainaware/parsedmarc#243)
and providing settings for it is therefore misleading.
github-actions bot pushed a commit to NixOS/nixpkgs that referenced this issue Jun 27, 2022
It's broken (see domainaware/parsedmarc#243)
and providing settings for it is therefore misleading.

(cherry picked from commit 32e0578)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants