[ZBX-5526] WARNING: nonstandard use of \\ in a string literal - zabbix-2.0.2 + postgresql Created: 2012 Aug 31  Updated: 2017 May 30  Resolved: 2014 Jan 28

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Proxy (P), Server (S)
Affects Version/s: 2.0.2
Fix Version/s: 2.0.11, 2.2.2, 2.3.0

Type: Incident report Priority: Major
Reporter: Ilyas Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: escaping, postgresql
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Scientific Linux release 6.3 (Carbon)
postgresql92-9.2-beta4_1PGDG.rhel6.x86_64
zabbix-proxy


Attachments: File bug    

 Description   

cut from debug log of zabbix-proxy:

 29846:20120831:093726.059 query [txnlev:1] [begin;]
 29846:20120831:093726.059 In DCmass_proxy_add_history()
 29846:20120831:093726.060 query [txnlev:1] [insert into proxy_history (itemid,clock,ns,value,status) values (23781,1346391441,904778055,'99.933775',0),(23661,1346391441,905176630,'0.000000',0),(23541,1346391441,905587324,'0.597015',0),(23421,1346391441,905979616,'94.204979',0),(23841,1346391441,907285562,'{
	"data":[
		{
			"{#IFNAME}":"lo"},
		{
			"{#IFNAME}":"eth0"},
		{
			"{#IFNAME}":"eth1"},
		{
			"{#IFNAME}":"venet0"}]}',0),(23782,1346391442,909865709,'0.000000',0),(23662,1346391442,910839557,'0.000000',0),(23842,1346391442,912319331,'{
	"data":[
		{
			"{#FSNAME}":"\\/",
			"{#FSTYPE}":"ext3"},
		{
			"{#FSNAME}":"\\/dev",
			"{#FSTYPE}":"tmpfs"},
		{
			"{#FSNAME}":"\\/proc",
			"{#FSTYPE}":"proc"},
		{
			"{#FSNAME}":"\\/sys",
			"{#FSTYPE}":"sysfs"},
		{
			"{#FSNAME}":"\\/proc\\/bus\\/usb",
			"{#FSTYPE}":"usbfs"},
		{
			"{#FSNAME}":"\\/dev\\/pts",
			"{#FSTYPE}":"devpts"},
		{
			"{#FSNAME}":"\\/boot",
			"{#FSTYPE}":"ext2"},
		{
			"{#FSNAME}":"\\/dev\\/shm",
			"{#FSTYPE}":"tmpfs"},
		{
			"{#FSNAME}":"\\/proc\\/sys\\/fs\\/binfmt_misc",
			"{#FSTYPE}":"binfmt_misc"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/401",
			"{#FSTYPE}":"simfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/401\\/proc",
			"{#FSTYPE}":"proc"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/401\\/sys",
			"{#FSTYPE}":"sysfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/402",
			"{#FSTYPE}":"simfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/402\\/proc",
			"{#FSTYPE}":"proc"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/402\\/sys",
			"{#FSTYPE}":"sysfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/401\\/dev",
			"{#FSTYPE}":"tmpfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/401\\/dev\\/pts",
			"{#FSTYPE}":"devpts"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/401\\/proc\\/sys\\/fs\\/binfmt_misc",
			"{#FSTYPE}":"binfmt_misc"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/403",
			"{#FSTYPE}":"simfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/403\\/proc",
			"{#FSTYPE}":"proc"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/403\\/sys",
			"{#FSTYPE}":"sysfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/402\\/dev\\/pts",
			"{#FSTYPE}":"devpts"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/402\\/proc\\/sys\\/fs\\/binfmt_misc",
			"{#FSTYPE}":"binfmt_misc"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/404",
			"{#FSTYPE}":"simfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/404\\/proc",
			"{#FSTYPE}":"proc"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/404\\/sys",
			"{#FSTYPE}":"sysfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/403\\/dev\\/pts",
			"{#FSTYPE}":"devpts"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/403\\/proc\\/sys\\/fs\\/binfmt_misc",
			"{#FSTYPE}":"binfmt_misc"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/405",
			"{#FSTYPE}":"simfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/405\\/proc",
			"{#FSTYPE}":"proc"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/405\\/sys",
			"{#FSTYPE}":"sysfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/404\\/dev\\/pts",
			"{#FSTYPE}":"devpts"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/406",
			"{#FSTYPE}":"simfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/406\\/proc",
			"{#FSTYPE}":"proc"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/406\\/sys",
			"{#FSTYPE}":"sysfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/404\\/proc\\/sys\\/fs\\/binfmt_misc",
			"{#FSTYPE}":"binfmt_misc"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/405\\/dev",
			"{#FSTYPE}":"tmpfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/405\\/dev\\/pts",
			"{#FSTYPE}":"devpts"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/405\\/proc\\/sys\\/fs\\/binfmt_misc",
			"{#FSTYPE}":"binfmt_misc"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/406\\/dev",
			"{#FSTYPE}":"tmpfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/406\\/dev\\/pts",
			"{#FSTYPE}":"devpts"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/406\\/proc\\/sys\\/fs\\/binfmt_misc",
			"{#FSTYPE}":"binfmt_misc"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/410",
			"{#FSTYPE}":"simfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/410\\/proc",
			"{#FSTYPE}":"proc"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/410\\/sys",
			"{#FSTYPE}":"sysfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/410\\/dev",
			"{#FSTYPE}":"tmpfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/410\\/dev\\/pts",
			"{#FSTYPE}":"devpts"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/410\\/proc\\/sys\\/fs\\/binfmt_misc",
			"{#FSTYPE}":"binfmt_misc"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/411",
			"{#FSTYPE}":"simfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/411\\/proc",
			"{#FSTYPE}":"proc"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/411\\/sys",
			"{#FSTYPE}":"sysfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/411\\/dev",
			"{#FSTYPE}":"tmpfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/411\\/dev\\/pts",
			"{#FSTYPE}":"devpts"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/411\\/proc\\/sys\\/fs\\/binfmt_misc",
			"{#FSTYPE}":"binfmt_misc"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/407",
			"{#FSTYPE}":"simfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/407\\/proc",
			"{#FSTYPE}":"proc"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/407\\/sys",
			"{#FSTYPE}":"sysfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/407\\/dev",
			"{#FSTYPE}":"tmpfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/407\\/dev\\/pts",
			"{#FSTYPE}":"devpts"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/407\\/proc\\/sys\\/fs\\/binfmt_misc",
			"{#FSTYPE}":"binfmt_misc"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/408",
			"{#FSTYPE}":"simfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/408\\/proc",
			"{#FSTYPE}":"proc"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/408\\/sys",
			"{#FSTYPE}":"sysfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/408\\/dev",
			"{#FSTYPE}":"tmpfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/408\\/dev\\/pts",
			"{#FSTYPE}":"devpts"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/408\\/proc\\/sys\\/fs\\/binfmt_misc",
			"{#FSTYPE}":"binfmt_misc"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/409",
			"{#FSTYPE}":"simfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/409\\/proc",
			"{#FSTYPE}":"proc"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/409\\/sys",
			"{#FSTYPE}":"sysfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/409\\/dev",
			"{#FSTYPE}":"tmpfs"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/409\\/dev\\/pts",
			"{#FSTYPE}":"devpts"},
		{
			"{#FSNAME}":"\\/vz\\/root\\/409\\/proc\\/sys\\/fs\\/binfmt_misc",
			"{#FSTYPE}":"binfmt_misc"}]}',0),(23542,1346391442,912731552,'0.298458',0),(23902,1346391442,913194342,'868589568',0),(23482,1346391442,913641604,'1',0),(23663,1346391443,915720694,'0.000000',0),(23783,1346391443,916320170,'0.000000',0),(23423,1346391443,918359603,'1244475392',0),(23784,1346391444,920555567,'0.000000',0),(23664,1346391444,920970744,'0.016626',0),(23544,1346391444,922628816,'1346391444',0),(23964,1346391444,924782093,'891518558208',0),(23665,1346391445,925090834,'0.016626',0),(23785,1346391445,925522246,'0.000000',0),(23545,1346391445,929711368,'1072775168',0),(23903,1346391446,3127196,'238439161577',0);
]
WARNING:  nonstandard use of \\ in a string literal
LINE 10: ...91442,910839557,'0.000000',0),(23842,1346391442,912319331,'{
                                                                      ^
HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
 29846:20120831:093726.062 End of DCmass_proxy_add_history()



 Comments   
Comment by Ilyas [ 2012 Aug 31 ]

log

Comment by Alexander Vladishev [ 2012 Sep 03 ]

Please check the PostgreSQL client (dev) version. It should be the same with the PostgreSQL server.

Comment by Ilyas [ 2012 Sep 03 ]

Which actions I need to do for check?

Please explain what you need.

Thanks.

Comment by Alexei Vladishev [ 2012 Sep 03 ]

Try to execute this command on Zabbix server side and post result here:

rpm -qa | grep -i postgres

Comment by Ilyas [ 2012 Sep 04 ]
  1. rpm -qa | grep -i postgres
    postgresql92-9.2-beta3_1PGDG.rhel6.x86_64
    postgresql92-contrib-9.2-beta3_1PGDG.rhel6.x86_64
    postgresql92-libs-9.2-beta3_1PGDG.rhel6.x86_64
    postgresql92-server-9.2-beta3_1PGDG.rhel6.x86_64

(there are packages from official postgresql RPM repo)

Comment by Alexander Vladishev [ 2013 Dec 17 ]

Related issue: ZBX-4376

Comment by Igors Homjakovs (Inactive) [ 2014 Jan 07 ]

This issue could be reproduced is the function PQserverVersion() was made unavailable. One of the possible reasons of this issue is missing libpq library or if the older version (<8.0) of this library was used.

Therefore, It was decided to remove support of older versions of PosgreSQL since documentation says that version 2.0 support v8.1 or later.

Comment by Igors Homjakovs (Inactive) [ 2014 Jan 07 ]

Fixed in the development branch svn://svn.zabbix.com/branches/dev/ZBX-5526

Comment by Igors Homjakovs (Inactive) [ 2014 Jan 09 ]

Fixed in 2.0.11rc1 r41440, 2.2.2rc1 r41441, 2.3.0 (trunk) r41442

Comment by Alexander Vladishev [ 2014 Jan 28 ]

Regression:

Too many SQL errors with failed connection to the PostgreSQL.

  8366:20140128:173146.978 [Z3005] query failed: [0] result is NULL [set escape_string_warning to off]
  8366:20140128:173146.978 In DBconnect() flag:0
  8366:20140128:173146.978 [Z3001] connection to database 'zabbix' failed: [0] could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

...

sasha RESOLVED in r41938 (branches/2.0), r41939 (branches/2.2) and r41940 (trunk)

asaveljevs Additionally, I have fixed a typo in the original change log entry in r41975 and r41976. CLOSED.

Generated at Fri Mar 29 00:29:00 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.