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

Maintenance.get returns HTTP 500 when using single "hostids" ID

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Fixed
    • Icon: Trivial Trivial
    • 7.0.5rc1, 7.2.0alpha1
    • 7.0.3
    • API (A)
    • None
    • Red Hat Enterprise Linux release 9.4 (Plow), PHP 8.0.30
    • S24-W38/39, S24-W40/41
    • 2

      Steps to reproduce:

      1. Perform "maintenance.get" API request with body:
       {
          "jsonrpc": "2.0",
          "method": "maintenance.get",
          "params": {
              "hostids": 12345
          },
          "id": 2,
          "auth": "<API key>"
      }

      Result:
      HTTP/1.1 500 Internal Server Error
      Expected:
      Return maintenance periods containing host ID "12345"

      The maintenance.get documentation states that the parameter must be submitted as "ID/array". The request works if the single ID is sent as an array instead. The same API request worked as expected in Zabbix 6.4.17 when not sent as an array. I can't see any changes to "maintenance.get" in API changes for 7.0.

            wczerneha Wiktor Czerneha
            martinmoerch Martin Mørch
            Team C
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - Not Specified
                Not Specified
                Logged:
                Time Spent - 13h
                13h