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

    Details

    • Type: Incident report
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 3.2.1
    • Fix Version/s: None
    • Component/s: API (A)
    • Labels:
      None
    • Environment:
      PHP 7.0.8-0ubuntu0.16.04.3

      Description

      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
      }
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: