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

API: HTTP 500 on updating maintenance periods via API

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 3.2.1
    • API (A)
    • None
    • PHP 7.0.8-0ubuntu0.16.04.3

      When trying to update a maintenance period via the zabbix API, following error occurs:

      PHP Fatal error:  Uncaught TypeError: Argument 1 passed to zbx_array_diff() must be of the type array, null given, called in /usr/share/zabbix/include/classes/api/services/CMaintenance.php on line 613 and defined in /usr/share/zabbix/include/func.inc.php:869
      Stack trace:
      #0 /usr/share/zabbix/include/classes/api/services/CMaintenance.php(613): zbx_array_diff(NULL, Array, 'groupid')
      #1 /usr/share/zabbix/include/classes/api/clients/CLocalApiClient.php(123): CMaintenance->update(Array)
      #2 /usr/share/zabbix/include/classes/core/CJsonRpc.php(87): CLocalApiClient->callMethod('maintenance', 'update', Array, 'b62d2fc4fa72e2e...')
      #3 /usr/share/zabbix/api_jsonrpc.php(63): CJsonRpc->execute()
      #4 {main}
        thrown in /usr/share/zabbix/include/func.inc.php on line 869
      

      Data payload:

      {
        "params": {
          "name": "Deploy job",
          "timeperiods": [
            {
              "timeperiod_type": 0
            }
          ],
          "active_till": 1475676942,
          "active_since": "1475675040",
          "maintenanceid": "4",
          "hostids": [
            "2"
          ]
        },
        "jsonrpc": "2.0",
        "method": "maintenance.update",
        "auth": "xxxxxxxx",
        "id": 1
      }
      

            zabbix.dev Zabbix Development Team
            matthias.lohr Matthias Lohr
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: