Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-22735

Zabbix Agent 2 - Accidental duplicate key for user parameter loops agent restart and grows log file

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Fixed
    • Icon: Minor Minor
    • 6.0.20, 6.4.2
    • Agent (G)
    • Ubuntu 22.04.1 LTS
      Zabbix Agent 2 package installed from official repo.
    • Sprint 103 (Aug 2023), Sprint 104 (Sep 2023), Sprint 105 (Oct 2023)
    • 0.5

      Steps to reproduce:

      1. Create  
        /etc/zabbix/zabbix_agent2.d/plugins.d/userparams.conf

         

      1. Add two lines.
        UserParameters=dl,<command>
        UserParameters=dl,<command>
      1. Execute 
        zabbix_agent2 -R userparameter_reload 

      Result:

      • Contents of /var/log/zabbix/zabbix_agent2.log:

       

      2023/04/25 23:25:59.713508 Critical failure: cannot register duplicate metric "dl"
      2023/04/25 23:25:59.713531 goroutine 7 [running]:
      2023/04/25 23:25:59.713537 runtime/debug.Stack()
      2023/04/25 23:25:59.713543 	/home/packager/go1.20/src/runtime/debug/stack.go:24 +0x65
      2023/04/25 23:25:59.713548 git.zabbix.com/ap/plugin-support/log.PanicHook()
      2023/04/25 23:25:59.713556 	/tmp/build-ubuntu-2204-x86_64.FGRnYGmT/buildroot/zabbix-6.4.2/debian/tmp.build-sqlite3/src/go/vendor/git.zabbix.com/ap/plugin-support/log/log.go:245 +0x59
      2023/04/25 23:25:59.713561 panic({0xc83640, 0xc000483cd0})
      2023/04/25 23:25:59.713567 	/home/packager/go1.20/src/runtime/panic.go:884 +0x213
      2023/04/25 23:25:59.713573 git.zabbix.com/ap/plugin-support/plugin.registerMetric({0xe7f100?, 0x13366a0}, {0xd7cb4c, 0xd}, {0xc00012fef6, 0x2}, {0xc00003c230, 0x47})
      2023/04/25 23:25:59.713580 	/tmp/build-ubuntu-2204-x86_64.FGRnYGmT/buildroot/zabbix-6.4.2/debian/tmp.build-sqlite3/src/go/vendor/git.zabbix.com/ap/plugin-support/plugin/registry.go:59 +0xb3e
      2023/04/25 23:25:59.713585 git.zabbix.com/ap/plugin-support/plugin.RegisterMetrics({0xe7f100, 0x13366a0}, {0xd7cb4c, 0xd}, {0xc000141990, 0x2, 0xc000418040?})
      2023/04/25 23:25:59.713592 	/tmp/build-ubuntu-2204-x86_64.FGRnYGmT/buildroot/zabbix-6.4.2/debian/tmp.build-sqlite3/src/go/vendor/git.zabbix.com/ap/plugin-support/plugin/registry.go:120 +0x88
      2023/04/25 23:25:59.713597 zabbix.com/internal/agent.InitUserParameterPlugin({0xc0000a6880, 0x8, 0xc00003b129?}, 0x0, {0x0, 0x0})
      2023/04/25 23:25:59.713603 	/tmp/build-ubuntu-2204-x86_64.FGRnYGmT/buildroot/zabbix-6.4.2/debian/tmp.build-sqlite3/src/go/internal/agent/plugin_userparameter.go:166 +0x6c5
      2023/04/25 23:25:59.713608 zabbix.com/internal/agent/scheduler.(*Manager).run(0xc000415e00)
      2023/04/25 23:25:59.713613 	/tmp/build-ubuntu-2204-x86_64.FGRnYGmT/buildroot/zabbix-6.4.2/debian/tmp.build-sqlite3/src/go/internal/agent/scheduler/manager.go:417 +0x98d
      2023/04/25 23:25:59.713619 created by zabbix.com/internal/agent/scheduler.(*Manager).Start
      2023/04/25 23:25:59.713634 	/tmp/build-ubuntu-2204-x86_64.FGRnYGmT/buildroot/zabbix-6.4.2/debian/tmp.build-sqlite3/src/go/internal/agent/scheduler/manager.go:546 +0xb6
      2023/04/25 23:25:59.713640 
      2023/04/25 23:26:10.006148 Starting Zabbix Agent 2 (6.4.2)
      2023/04/25 23:26:10.007386 OpenSSL library (OpenSSL 3.0.2 15 Mar 2022) initialized
      2023/04/25 23:26:10.007457 using configuration file: /etc/zabbix/zabbix_agent2.conf
      2023/04/25 23:26:20.264207 Starting Zabbix Agent 2 (6.4.2)
      2023/04/25 23:26:20.265136 OpenSSL library (OpenSSL 3.0.2 15 Mar 2022) initialized
      2023/04/25 23:26:20.265198 using configuration file: /etc/zabbix/zabbix_agent2.conf
      2023/04/25 23:26:30.503406 Starting Zabbix Agent 2 (6.4.2)
      2023/04/25 23:26:30.504554 OpenSSL library (OpenSSL 3.0.2 15 Mar 2022) initialized
      2023/04/25 23:26:30.504631 using configuration file: /etc/zabbix/zabbix_agent2.conf 

       

      • Zabbix Agent 2 keeps restarting and failing with the last three lines repeatedly written to the log file.

       

      Expected:

      • Expected the Zabbix Agent 2 to register the error in the log file and exit.

      The user did not intend to add a duplicate key name for the user parameter and the Zabbix Agent 2 correctly identifies the issue and logs it but an improvement would perhaps be that the error is logged and no restart attempt is made. This would prevent increasing the log file size.

            rzvejs Rudolfs Zvejs
            Söderlund Freddy Söderlund
            Team INT
            Votes:
            1 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: