[ZBX-13199] Add web scenario in Zabbix 3.4.2 with (PostgreSQL 9.6.5) is always Failing Created: 2017 Dec 14  Updated: 2017 Dec 21  Resolved: 2017 Dec 21

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 3.4.3
Fix Version/s: None

Type: Incident report Priority: Major
Reporter: MD. ABBAS ALI Assignee: Unassigned
Resolution: Done Votes: 0
Labels: database
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

RedHat 7.3 with PGSQL-9.6.5


Attachments: PNG File zabbix.gif.png    

 Description   

Steps to reproduce:

  1. Changes in configuration...
  2. Navigate to screen title...
  3. Click on screen element...
  4. ...

Result:
See screenshot...
See log file...
See memory dump...
Expected:
See screenshot...
See attached patch file...



 Comments   
Comment by MD. ABBAS ALI [ 2017 Dec 14 ]

When I am trying to create a new web scenario in Zabbix 3.4.2 with (PostgreSQL 9.6.5), it's failing with the below message:
-----------
Cannot add web scenario
Details in the attached screenshot.
---------
I have installed Zabbix-server(3.4.2) in RedHat 7.3 with PGSQL-9.6.5

N.B.: But I am not facing this issue when creating web scenario with same version of Zabbix-server(3.4.3) in CentOS 6.5 with MySQL-5.5

Comment by MD. ABBAS ALI [ 2017 Dec 15 ]

Hi @Aleksejs Petrovs ,
We have 2 different Zabbix Environments:
1. Zabbix Server 3.4.3 with MySQL 5.5 OS: CentOS 6.5 Zabbix-Test-ENV
2. Zabbix Server 3.4.2 with PGSQL-9.6.5 OS: RedHat 7.3 Zabbix-PROD-ENV

We migrated OLD MySQL DB to our PROD-Zabbix with PGSQL-9.6.5
Those Web scenarios we created before are working fine in our PROD-Zabbix with PGSQL-9.6.5.
But when trying to create any new Web scenario then it is getting This kind of DB related "violates not-null constraint"error

Can you please provide any idea ?

Comment by Aleksejs Petrovs [ 2017 Dec 15 ]

I will try to reproduce and will try to understand if it's a bug.

If not, then I would be forced to close the ticket as this isn't a free support page, but a bug tracker system. For community support please follow this link or you can ask for support from Zabbix Professionals.

So you've migrated the Zabbix database from MySQL to PostgreSQL? How did you've performed the migration?

Regards,
Aleksejs!

Comment by MD. ABBAS ALI [ 2017 Dec 15 ]

Hi,
Thanks for your quick response.

We performed migration from MySQL to PGSQL as below:
1. We used ESF tool (https://www.easyfrom.net/) to Import table structures from MySQL to PGSQL
2. Then We migrated using a PHP script https://github.com/AnatolyUss/FromMySqlToPostgreSql

N.B: Before performing that migration we upgraded our old Zabbix-Server-2.4.8 to 3.4.2

Thanks

Comment by Aleksejs Petrovs [ 2017 Dec 15 ]

Please paste the error here. It is kinda challenging to read from a screenshot.

Regards,
Aleksejs!

Comment by MD. ABBAS ALI [ 2017 Dec 15 ]
Details of Error [what is in the attached screenshot]:
========================================
-----------
Cannot add web scenario
Details
    pg_query(): Query failed: ERROR: null value in column "params" violates not-null constraint
    DETAIL: Failing row contains (82627, 9, , , 10496, Download speed for scenario "$1"., web.test.in[zabbix-test,,bps], 1m, 30d, 90d, 0, 0, , Bps, , 0, , , , , 0, , null, null, null, , 0, , , , , 0, 0, null, , null, 0, 30d, 0, 0, 0, , 0, , null). [httpconf.php:409 → CFrontendApiWrapper->create() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CHttpTest->create() → CHttpTestManager->persist() → CHttpTestManager->save() → CHttpTestManager->create() → CHttpTestManager->createHttpTestItems() → DB::insert() → DBexecute() → pg_query() in include/db.inc.php:487]
    Error in query [INSERT INTO items (name,key_,value_type,units,hostid,delay,type,history,trends,status,itemid) VALUES ('Download speed for scenario "$1".','web.test.in[zabbix-test,,bps]','0','Bps','10496','1m','9','30d','90d','0','82627')] [ERROR: null value in column "params" violates not-null constraint
    DETAIL: Failing row contains (82627, 9, , , 10496, Download speed for scenario "$1"., web.test.in[zabbix-test,,bps], 1m, 30d, 90d, 0, 0, , Bps, , 0, , , , , 0, , null, null, null, , 0, , , , , 0, 0, null, , null, 0, 30d, 0, 0, 0, , 0, , null).]
    SQL statement execution has failed "INSERT INTO items (name,key_,value_type,units,hostid,delay,type,history,trends,status,itemid) VALUES ('Download speed for scenario "$1".','web.test.in[zabbix-test,,bps]','0','Bps','10496','1m','9','30d','90d','0','82627')".
---------------------------------
Comment by Aleksejs Petrovs [ 2017 Dec 15 ]

Could you show the packets you've installed?

yum list installed | grep zabbix

Comment by MD. ABBAS ALI [ 2017 Dec 15 ]
[user@host ]# rpm -qa | grep zabbix

zabbix-server-pgsql-3.4.2-1.el7.x86_64
zabbix-web-pgsql-3.4.2-1.el7.noarch
zabbix-get-3.4.2-1.el7.x86_64
python-pyzabbix-0.7.3-2.el7.noarch
zabbix-web-3.4.2-1.el7.noarch
zabbix-agent-3.4.2-1.el7.x86_64
zabbix-release-3.4-2.el7.noarch
zabbix-java-gateway-3.4.2-1.el7.x86_64

[user@host ]# yum list installed | grep zabbix
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
python-pyzabbix.noarch              0.7.3-2.el7              installed
zabbix-agent.x86_64                 3.4.2-1.el7              @zabbix
zabbix-get.x86_64                   3.4.2-1.el7              @zabbix
zabbix-java-gateway.x86_64          3.4.2-1.el7              @zabbix
zabbix-release.noarch               3.4-2.el7                installed
zabbix-server-pgsql.x86_64          3.4.2-1.el7              @zabbix
zabbix-web.noarch                   3.4.2-1.el7              @zabbix
zabbix-web-pgsql.noarch             3.4.2-1.el7              @zabbix
Comment by Aleksejs Petrovs [ 2017 Dec 19 ]

I still can't reproduce this, most probably the problem appears due to the migration you've performed. Could you please try to update the Zabbix to the latest version and see if the problem still appears?

Comment by MD. ABBAS ALI [ 2017 Dec 20 ]

Thank you Aleksejs Petrovs for your update about the issue.

As per your comment, we are planning as below:

1. We will investigate the issue with our DBA team:
======================================
[As the problem when inserting in 'items' table and conflicting constraints for 'params' column.......
So I have checked between MySQL & PGSQL 'items' table description ......
Found:
in MySQL 'params' column NOT NULL and Default value=NULL
in PGSQL 'params' column NOT NULL and No Default value, its blank]

I'm not sure, is it the cause ? which we will investigate with DBA.

N.B. We can create any new item which is also inserting in same 'items' table

2. If step-1 can't solve the problem then we will try to update Zabbix:
====================================================
--> Is it the latest stable release Zabbix-3.4.4 ?

Thanks

Comment by MD. ABBAS ALI [ 2017 Dec 21 ]

After modifying PGSQL (Zabbix DB) 'items' Table constraints, Successfully added new Web scenario.

Thanks for the feedback from Aleksejs Petro.

Actually it was not a Bug.... It was our migration problem.

Generated at Wed Apr 16 21:44:13 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.