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

[Postgresql plugin] 'nil error' appears for all metrics when trying to gather data with correct uri,user,password and dbname

XMLWordPrintable

    • 0.5

      Note: the issue appeared after changes made in https://support.zabbix.com/browse/DEV-4027 task. Need to recheck all related plugins that was changed in the task.

      Precondition:

      Steps to reproduce:

      • Run server and agent2
      • Add host with "PostgreSQL by Zabbix agent 2" template
      • Change inherited macros:
        {$PG.CONNSTRING.AGENT2} => URi to connect
        {$PG.DATABASE} => your dbname
        {$PG.PASSWORD} => postgres password
        {$PG.USER} => postgres user
      • Try to gather data from items

      Result: Error "Failed to create connection: failed to get server version: nil error." appears.
      Error from Agent2 log =>

      2025/09/05 11:39:16.520728 received passive check request from "{\"request\":\"passive checks\",\"data\":[{\"key\":\"pgsql.version[\\\"tcp://localhost:5432\\\",\\\"zabbix\\\",\\\"zabbix\\\",\\\"master\\\"]\",\"timeout\":3}]}": "127.0.0.1"
      2025/09/05 11:39:16.520802 [1] processing update request (1 requests)
      2025/09/05 11:39:16.520815 [1] adding new request for key: 'pgsql.version["tcp://localhost:5432","zabbix","zabbix","master"]'
      2025/09/05 11:39:16.520823 [1] created direct exporter task for plugin 'PostgreSQL' itemid:0 key 'pgsql.version["tcp://localhost:5432","zabbix","zabbix","master"]'
      2025/09/05 11:39:16.520918 executing direct exporter task for key 'pgsql.version["tcp://localhost:5432","zabbix","zabbix","master"]'
      2025/09/05 11:39:16.552037 [PostgreSQL] Failed to create connection: failed to get server version: nil error.
      2025/09/05 11:39:16.552813 failed to execute direct exporter task for key 'pgsql.version[[tcp://localhost:5432 zabbix zabbix master]]' error: 'Failed to create connection: failed to get server version: nil error.'
      

      Expected: Data should be gathered successfully without errors. I compared with release/7.4 and commit before DEV-4027 changes (master) and there is no such problem.

            natalja.zabbix Natalja Romancaka
            kseve Kirils Seve
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - 0h
                0h
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 2.5h
                2.5h