zabbix-community / helm-zabbix

Helm chart for Zabbix
https://artifacthub.io/packages/helm/zabbix-community/zabbix
Apache License 2.0
83 stars 48 forks source link

zabbix-agent fails to start: cannot parse the "Server" parameter: address "127.0.0.1" specified more than once #36

Closed syphernl closed 1 year ago

syphernl commented 1 year ago

Describe the bug Running this with the defaults configured results in the agent container not starting:

2023/05/15 13:41:31.321446 Zabbix Agent2 hostname: [Zabbix server]
Press Ctrl+C to exit.
zabbix_agent2 [7]: ERROR: cannot start server listener: cannot parse the "Server" parameter: address "127.0.0.1" specified more than once

Version of Helm and Kubernetes: v3.12.0 / v1.26.3

What happened: See above

What you expected to happen: No error

How to reproduce it (as minimally and precisely as possible): Setup with the following values:

zabbix_image_tag: alpine-6.4.2

Anything else we need to know:

This is seen during startup:

** Preparing Zabbix agent
** Preparing Zabbix agent configuration file
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "PidFile": ''...removed
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "LogType": 'console'...added
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "LogFile": ''...removed
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "LogFileSize": ''...removed
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "DebugLevel": ''...removed
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "SourceIP": ''...removed
** Using '127.0.0.1,127.0.0.1' servers for passive checks
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "Server": '127.0.0.1,127.0.0.1'...updated
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "ListenPort": ''...removed
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "ListenIP": ''...removed
** Using '127.0.0.1:10051' servers for active checks
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "ServerActive": '127.0.0.1:10051'...updated
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "HeartbeatFrequency": ''...removed
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "EnablePersistentBuffer": '0'...added
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "HostInterface": ''...removed
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "HostInterfaceItem": ''...removed
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "Hostname": 'Zabbix server'...updated
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "HostnameItem": ''...removed
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "HostMetadata": ''...removed
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "HostMetadataItem": ''...removed
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "RefreshActiveChecks": ''...removed
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "BufferSend": ''...removed
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "BufferSize": ''...removed
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "Timeout": ''...removed
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "Include": '/etc/zabbix/zabbix_agent2.d/plugins.d/*.conf'...updated
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "Include": '/etc/zabbix/zabbix_agentd.d/*.conf'...added first occurrence
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "UnsafeUserParameters": ''...removed
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "TLSConnect": ''...removed
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "TLSAccept": ''...removed
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "TLSCAFile": ''...removed
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "TLSCRLFile": ''...removed
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "TLSServerCertIssuer": ''...removed
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "TLSServerCertSubject": ''...removed
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "TLSCertFile": ''...removed
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "TLSKeyFile": ''...removed
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "TLSPSKIdentity": ''...removed
** Updating '/etc/zabbix/zabbix_agent2.conf' parameter "TLSPSKFile": ''...removed
** Preparing Zabbix agent plugin configuration files
** Updating '/etc/zabbix/zabbix_agent2.d/plugins.d/mongodb.conf' parameter "Plugins.MongoDB.System.Path": '/usr/sbin/zabbix-agent2-plugin/zabbix-agent2-plugin-mongodb'...added
** Updating '/etc/zabbix/zabbix_agent2.d/plugins.d/postgresql.conf' parameter "Plugins.PostgreSQL.System.Path": '/usr/sbin/zabbix-agent2-plugin/zabbix-agent2-plugin-postgresql'...added
2023/05/15 13:41:31.315787 Starting Zabbix Agent 2 (6.4.2)
2023/05/15 13:41:31.317546 OpenSSL library (OpenSSL 3.0.8 7 Feb 2023) initialized
2023/05/15 13:41:31.321103 using configuration file: /etc/zabbix/zabbix_agent2.conf
2023/05/15 13:41:31.321179 using plugin 'Agent' (built-in) providing following interfaces: exporter
2023/05/15 13:41:31.321185 using plugin 'Ceph' (built-in) providing following interfaces: exporter, runner, configurator
2023/05/15 13:41:31.321191 using plugin 'Cpu' (built-in) providing following interfaces: exporter, collector, runner
2023/05/15 13:41:31.321195 using plugin 'DNS' (built-in) providing following interfaces: exporter
2023/05/15 13:41:31.321199 using plugin 'Docker' (built-in) providing following interfaces: exporter, configurator
2023/05/15 13:41:31.321203 using plugin 'File' (built-in) providing following interfaces: exporter, configurator
2023/05/15 13:41:31.321215 using plugin 'Hw' (built-in) providing following interfaces: exporter, configurator
2023/05/15 13:41:31.321219 using plugin 'Kernel' (built-in) providing following interfaces: exporter
2023/05/15 13:41:31.321225 using plugin 'Log' (built-in) providing following interfaces: exporter, configurator
2023/05/15 13:41:31.321231 using plugin 'MQTT' (built-in) providing following interfaces: watcher, configurator
2023/05/15 13:41:31.321236 using plugin 'Memcached' (built-in) providing following interfaces: exporter, runner, configurator
2023/05/15 13:41:31.321242 using plugin 'Memory' (built-in) providing following interfaces: exporter
2023/05/15 13:41:31.321245 using plugin 'Modbus' (built-in) providing following interfaces: exporter, configurator
2023/05/15 13:41:31.321256 using plugin 'MongoDB' (/usr/sbin/zabbix-agent2-plugin/zabbix-agent2-plugin-mongodb) providing following interfaces: exporter, runner, configurator
2023/05/15 13:41:31.321267 using plugin 'Mysql' (built-in) providing following interfaces: exporter, runner, configurator
2023/05/15 13:41:31.321271 using plugin 'NetIf' (built-in) providing following interfaces: exporter
2023/05/15 13:41:31.321277 using plugin 'Oracle' (built-in) providing following interfaces: exporter, runner, configurator
2023/05/15 13:41:31.321283 using plugin 'PostgreSQL' (/usr/sbin/zabbix-agent2-plugin/zabbix-agent2-plugin-postgresql) providing following interfaces: exporter, runner, configurator
2023/05/15 13:41:31.321298 using plugin 'Proc' (built-in) providing following interfaces: exporter, collector
2023/05/15 13:41:31.321304 using plugin 'ProcExporter' (built-in) providing following interfaces: exporter
2023/05/15 13:41:31.321307 using plugin 'Redis' (built-in) providing following interfaces: exporter, runner, configurator
2023/05/15 13:41:31.321312 using plugin 'Smart' (built-in) providing following interfaces: exporter, configurator
2023/05/15 13:41:31.321315 using plugin 'Sw' (built-in) providing following interfaces: exporter, configurator
2023/05/15 13:41:31.321318 using plugin 'Swap' (built-in) providing following interfaces: exporter
2023/05/15 13:41:31.321321 using plugin 'SystemRun' (built-in) providing following interfaces: exporter, configurator
2023/05/15 13:41:31.321324 using plugin 'Systemd' (built-in) providing following interfaces: exporter
2023/05/15 13:41:31.321329 using plugin 'TCP' (built-in) providing following interfaces: exporter, configurator
2023/05/15 13:41:31.321332 using plugin 'UDP' (built-in) providing following interfaces: exporter, configurator
2023/05/15 13:41:31.321335 using plugin 'Uname' (built-in) providing following interfaces: exporter
2023/05/15 13:41:31.321338 using plugin 'Uptime' (built-in) providing following interfaces: exporter
2023/05/15 13:41:31.321341 using plugin 'Users' (built-in) providing following interfaces: exporter, configurator
2023/05/15 13:41:31.321343 using plugin 'VFSDev' (built-in) providing following interfaces: exporter, collector
2023/05/15 13:41:31.321346 using plugin 'VFSDir' (built-in) providing following interfaces: exporter
2023/05/15 13:41:31.321349 using plugin 'VfsFs' (built-in) providing following interfaces: exporter
2023/05/15 13:41:31.321352 using plugin 'WebCertificate' (built-in) providing following interfaces: exporter, configurator
2023/05/15 13:41:31.321356 using plugin 'WebPage' (built-in) providing following interfaces: exporter, configurator
2023/05/15 13:41:31.321359 using plugin 'ZabbixAsync' (built-in) providing following interfaces: exporter
2023/05/15 13:41:31.321366 using plugin 'ZabbixStats' (built-in) providing following interfaces: exporter, configurator
2023/05/15 13:41:31.321371 lowering the plugin ZabbixSync capacity to 1 as the configured capacity 100 exceeds limits
2023/05/15 13:41:31.321374 using plugin 'ZabbixSync' (built-in) providing following interfaces: exporter
2023/05/15 13:41:31.321433 Plugin communication protocol version is 6.4.0
2023/05/15 13:41:31.321446 Zabbix Agent2 hostname: [Zabbix server]
Press Ctrl+C to exit.
zabbix_agent2 [7]: ERROR: cannot start server listener: cannot parse the "Server" parameter: address "127.0.0.1" specified more than once
aeciopires commented 1 year ago

Hello @syphernl!

Thanks for your report.

I founded the same issue yesterday while testing this PR https://github.com/zabbix-community/helm-zabbix/pull/25 using the 6.4.2-alpine image.

I believe that the problem is in the 6.4 version because did not happen with old version. We can not change the Zabbix image. Let the team know here https://support.zabbix.com/projects/ZBX/summary

In my case, I removed the ZBX_PASSIVESERVERS variable.

syphernl commented 1 year ago

I can confirm that it works with these values:

                zabbixagent:
                    enabled: true
                    ZBX_PASSIVESERVERS: ~ # see https://github.com/zabbix-community/helm-zabbix/issues/36#issuecomment-1548350466
aeciopires commented 1 year ago

Thanks @syphernl for your return.