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

API: Misleading error when trying to delete maintenance that has already been deleted

    XMLWordPrintable

    Details

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

      Description

      Currently, if you try to delete a maintenance that has already been deleted, the API will respond with an error saying that you do not have access to the operation. It would make more sense if the error message stated that you tried to delete an nonexistent maintenance instead.

      Example output from a delete attempt on an already removed maintenance id:

      { "code": -32500, "message": "Application error.", "data": "You do not have permission to perform this operation." }

      Looking in frontends/php/api/classes/CMaintenance.php it seems this would be a very trivial fix, looking at lines 619-623 in current SVN version:

      foreach ($maintenanceids as $maintenanceid) {
      if (!isset($maintenances[$maintenanceid]))

      { self::exception(ZBX_API_ERROR_PERMISSIONS, _('You do not have permission to perform this operation.')); }

      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              bunjiboys Asbjorn Kjaer
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated: