[ZBX-17843] SQLSTATE 42501 when requesting the Zabbix Agent2 Postgresql plugin pgsql.archive key (PG12) Created: 2020 May 29  Updated: 2024 Apr 10  Resolved: 2020 Aug 02

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G), Templates (T)
Affects Version/s: 5.0.1
Fix Version/s: 5.0.3rc1, 5.2.0alpha1, 5.2 (plan)

Type: Problem report Priority: Critical
Reporter: Roman Assignee: Anton Fayantsev (Inactive)
Resolution: Fixed Votes: 1
Labels: PostgreSQL, Template
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Team: Team INT
Sprint: Sprint 65 (Jun 2020), Sprint 66 (Jul 2020)
Story Points: 0.125

 Description   

Steps to reproduce:

  1. Install PostgreSQL 12
  2. Install zabbix agent2 5.0.1
  3. Configure zbx_monitor account according to the instruction
  4. Run from zabbix account: zabbix_agent2 -t "pgsql.archive[postgresql://127.0.0.1:5432,zbx_monitor,password,postgres]" -v

Result:
String in the output - ERROR: permission denied for function pg_ls_dir (SQLSTATE 42501).

Expected:
Instruction lacks necessary parameters (GRANTS) for zbx_monitor account.



 Comments   
Comment by Roman [ 2020 May 29 ]

Workaround:
GRANT EXECUTE ON FUNCTION pg_catalog.pg_ls_dir(text) TO zbx_monitor;
GRANT EXECUTE ON FUNCTION pg_catalog.pg_stat_file(text) TO zbx_monitor;

Comment by Roman [ 2020 May 29 ]

Imprint in file: zabbix/src/go/plugins/postgres/conn.go:

return nil, fmt.Errorf("Cannoe etabilish connection to Postgres server: %s", err)

Comment by Anton Fayantsev (Inactive) [ 2020 Jul 30 ]

Fixed in ZBXCTR-9.

Generated at Mon May 12 06:21:28 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.