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

Empty response when API request fails

    XMLWordPrintable

    Details

    • Type: Problem report
    • Status: Open
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: 5.2.0alpha1
    • Fix Version/s: None
    • Component/s: API (A)
    • Labels:

      Description

      Steps to reproduce error 1:
      Create incorrect API request for method host.massremove

      {
        "hosts":[{"hostid": "10337"}],
        "interfaces": [{
          "ip": "194.168.3.1",
          "dns": "",
          "port": "10050"
        }]
      }
      

      Notice: "hosts" property is incorrect.

      Result 1:

      PHP Fatal error:  Uncaught TypeError: Argument 1 passed to CHost::checkPermissions() must be of the type array, null given, called in /var/www/html/feature/ZBXNEXT-2156-5.1/ui/include/classes/api/services/CHost.php on line 1342 and defined in /var/www/html/feature/ZBXNEXT-2156-5.1/ui/include/classes/api/services/CHost.php:1778
      

      Steps to reproduce error 2:
      Create incorrect API request for method host.massremove

      {
        "hostids":[{"hostid": "10337"}],
        "interfaces": [{
          "ip": "194.168.3.1",
          "dns": "",
          "port": "10050"
        }]
      }
      

      Notice: "hostids" property is incorrect.

      Result 2:

      PHP Warning:  array_flip(): Can only flip STRING and INTEGER values! in /var/www/html/feature/ZBXNEXT-2156-5.1/ui/include/db.inc.php on line 634"
      PHP Warning:  pg_query(): Query failed: ERROR:  syntax error at or near "AND""
      "LINE 1: ...owscount FROM hosts h WHERE h.flags IN (0,4) AND  AND h.stat..."
      in /var/www/html/feature/ZBXNEXT-2156-5.1/ui/include/db.inc.php on line 247"
      

      Expected:

      1. Graceful failure if uncaught.
      2. No failure in given example.

      Only tested in 5.2.0alpha1, please see if this issue exists earlier.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              zabbix.dev Zabbix Development Team
              Reporter:
              talbergs Mārtiņš Tālbergs (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: