Errors in FreeBSD 15 using ZeroMQ

Hi all,

I have compiled Zeek 8.0.4 enabling ZeroMQ support under a FreeBSD 15 host (amd64) but zeekctl returns the following errors:

hecking configurations …
Traceback (most recent call last):
File “/opt/zeek/bin/zeekctl”, line 861, in
sys.exit(main())
^^^^^^
File “/opt/zeek/bin/zeekctl”, line 834, in main
cmdsuccess = loop.onecmd(cmdline)
^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/cmd.py”, line 217, in onecmd
return func(arg)
^^^^^^^^^
File “/opt/zeek/bin/zeekctl”, line 211, in do_deploy
results = self.zeekctl.deploy()
^^^^^^^^^^^^^^^^^^^^^
File “/opt/zeek/lib/zeek/python/zeekctl/ZeekControl/zeekctl.py”, line 36, in wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/zeek/lib/zeek/python/zeekctl/ZeekControl/zeekctl.py”, line 345, in deploy
results = self.check(check_node_types=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/zeek/lib/zeek/python/zeekctl/ZeekControl/zeekctl.py”, line 60, in wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/zeek/lib/zeek/python/zeekctl/ZeekControl/zeekctl.py”, line 36, in wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/zeek/lib/zeek/python/zeekctl/ZeekControl/zeekctl.py”, line 447, in check
results = self.controller.check(nodes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/zeek/lib/zeek/python/zeekctl/ZeekControl/control.py”, line 668, in check
return self._check_config(nodes, False, False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/zeek/lib/zeek/python/zeekctl/ZeekControl/control.py”, line 709, in _check_config
if not install.make_layout(cwd, self.ui, True):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/zeek/lib/zeek/python/zeekctl/ZeekControl/install.py”, line 182, in make_layout
ostr += f"redef Telemetry::metrics_port = {metricsport.use_port(None)}/tcp;\n"
^^^^^^^^^^^^^^^^^^^^
AttributeError: ‘NoneType’ object has no attribute ‘use_port’

How can I fix this?

Hey @clopmz , thanks a bunch for testing!

This isn’t actually ZeroMQ specific, but happens if MetricsPort = 0 is set in zeekctl.cfg and node.cfg uses a standalone cluster configuration. It reproduces here on Linux, too. I’ll fix it in Zeekctl.

The standalone mode isn’t really something you’d run in production.

Please switch from a standalone node.cfg layout to a multi-process cluster node.cfg - the following is from my Linux testing VM (modulo the af_packet config):

[manager]
type=manager
host=localhost

[logger-1]
type=logger
host=localhost

[proxy-1]
type=proxy
host=localhost

[proxy-2]
type=proxy
host=localhost

[worker]
type=worker
host=localhost
interface=enp7s0

For a production setup with multiple worker processes you’ll want to look into lb_procs and lb_method for the [worker] section. For getting familiar with Zeekctl+Zeek+ZeroMQ (testing if scripts load, checking on warning/error messages), the above should work. Reach out if not.

Hope this helps!

PR for the standalone mode fix: install: Fix AttributeError in standalone mode with MetricsPort = 0 by awelzel · Pull Request #98 · zeek/zeekctl · GitHub

Ok. It works with multi-process cluster config"!! … many thanks @awelzel

1 Like