opnsense / plugins

OPNsense plugin collection
https://opnsense.org/
BSD 2-Clause "Simplified" License
842 stars 638 forks source link

net-mgmt/zabbix-proxy - zabbix-proxy.conf template fails #3921

Closed ruworuro closed 6 months ago

ruworuro commented 6 months ago

Important notices Before you add a new report, we ask you kindly to acknowledge the following:

Describe the bug In commit 26e6379874d56190e409c07c37c37cb12a58679c1ff a bug has been added in the file net-mgmt/zabbix-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/zabbix_proxy.conf.in, on line 37.

In a new installation with version 24.1.6 I get this message in the backend log after trying to activate the zabbix-proxy service

error generating template OPNsense/Zabbixproxy : Traceback (most recent call last): File "/usr/local/opnsense/service/modules/template.py", line 245, in _generate j2_page = self._j2_env.get_template(template_filename) File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 1010, in get_template return self._load_template(name, globals) File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 969, in _load_template template = self.loader.load(self, name, self.make_globals(globals)) File "/usr/local/lib/python3.9/site-packages/jinja2/loaders.py", line 137, in load code = environment.compile(source, name, filename) File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 768, in compile self.handle_exception(source=source_hint) File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 936, in handle_exception raise rewrite_traceback_stack(source=source) File "/usr/local/opnsense/service/templates/OPNsense/Zabbixproxy/zabbixproxy.conf", line 37, in template DebugLevel={{OPNsense.zabbixproxy.general.debugLevel|replace("val", "")}} jinja2.exceptions.TemplateSyntaxError: expected token 'end of statement block', got 'DebugLevel' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/opnsense/service/modules/template.py", line 328, in generate for filename in self._generate(template_name, create_directory): File "/usr/local/opnsense/service/modules/template.py", line 247, in _generate raise Exception("%s %s %s" % (module_name, template_filename, templExc)) Exception: OPNsense/Zabbixproxy OPNsense/Zabbixproxy/zabbix_proxy.conf expected token 'end of statement block', got 'DebugLevel'

Workaruond to start the zabbix-proxy service

I have corrected the file _/usr/local/opnsense/service/templates/OPNsense/Zabbixproxy/zabbixproxy.conf by adding a %} to the end of line 37

fraenki commented 6 months ago

Thanks for reporting this issue!

If someone wants to apply the fix on OPNsense 24.1.6:

opnsense-patch -c plugins 750465b75b0ee4e25db357ebf2dbf8c7a3d595e6
fichtner commented 6 months ago

I'll be issuing a hotfix in the next day or two. Thanks!