-
Problem report
-
Resolution: Unresolved
-
Critical
-
None
-
8.0.0alpha1 (master)
-
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:
- git clone postgresql loadable plugin => https://git.zabbix.com/projects/AP/repos/postgresql/browse
- make build
- add binary file path in postgresql.conf file
- Include path to the plugin's conf file into zabbix_agent2.conf file
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.