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

SQL Error on IT Services with PostgreSQL database

XMLWordPrintable

      When looking in the IT Services tab under Monitoring or Configuration I get an SQL error at the bottom of the page.

      pg_query(): Query failed: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
      LINE 1: ...9999999 AND sl.servicedownid=s.serviceid ORDER BY s.sortorde...
      ^ [include/db.inc.php:430]
      Error in query [SELECT DISTINCT sl.linkid,sl.servicedownid,sl.soft,sl.serviceupid FROM services_links sl,services s WHERE ( (sl.serviceupid IN ('2')) ) AND sl.linkid BETWEEN 000000000000000 AND 099999999999999 AND sl.servicedownid=s.serviceid ORDER BY s.sortorder, s.serviceid] [ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
      LINE 1: ...9999999 AND sl.servicedownid=s.serviceid ORDER BY s.sortorde...
      ^]
      pg_fetch_assoc() expects parameter 1 to be resource, boolean given [include/db.inc.php:565]
      pg_free_result() expects parameter 1 to be resource, boolean given [include/db.inc.php:566]
      pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block [include/db.inc.php:430]
      Error in query [SELECT DISTINCT s.* FROM services s,services_links slc WHERE s.serviceid=slc.serviceupid AND slc.soft=0 AND (slc.servicedownid IN ('2')) AND s.serviceid BETWEEN 000000000000000 AND 099999999999999] [ERROR: current transaction is aborted, commands ignored until end of transaction block]
      pg_fetch_assoc() expects parameter 1 to be resource, boolean given [include/db.inc.php:565]
      pg_free_result() expects parameter 1 to be resource, boolean given [include/db.inc.php:566]
      pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block [include/db.inc.php:430]
      Error in query [SELECT t.triggerid,t.description FROM triggers t WHERE (t.triggerid IN ('0')) ] [ERROR: current transaction is aborted, commands ignored until end of transaction block]
      pg_fetch_assoc() expects parameter 1 to be resource, boolean given [include/db.inc.php:565]
      pg_free_result() expects parameter 1 to be resource, boolean given [include/db.inc.php:566]

      Switching Debug on, I was able to find the problem query,

      SQL (0.00044): SELECT DISTINCT sl.linkid,sl.servicedownid,sl.soft,sl.serviceupid FROM services_links sl,services s WHERE ( (sl.serviceupid IN ('2')) ) AND sl.linkid BETWEEN 000000000000000 AND 099999999999999 AND sl.servicedownid=s.serviceid ORDER BY s.sortorder, s.serviceid
      CAPIObject->get() > CAPIObject>__call() > czbxrpc::call() -> czbxrpc::callAPI() -> call_user_func() -> CService>get() > CService>addRelatedObjects() > CService>fetchChildDependencies() -> DBselect()

            Unassigned Unassigned
            jstone Jory Stone
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: