Uploaded image for project: 'Opencast'
  1. MH-13568

Catch exception from overlapping RRule and return bad request

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed and reviewed
    • Affects versions: 6.0
    • Fix versions: 7.0
    • Components: External API
    • Labels:
      None
    • Severity:
      Incorrectly Functioning With Workaround
    • Steps to reproduce:
      Hide
      With scheduling data with a very long duration (>24 hours) such that events overlap, like this:

      {"agent_id":"devca","duration":262500000,"end":"2019-07-30T12:55:00Z","inputs":["default"],"rrule":"FREQ=WEEKLY;BYDAY=MO,TU,TH,FR;BYHOUR=12;BYMINUTE=0","start":"2019-07-24T12:00:00Z"}

      you get an exception thrown and an uninformative 500 internal server error from the POST /api/event endpoint:

      2019-05-20T16:08:08,098 | ERROR | (EventsEndpoint:534) - Unable to create event
      org.opencastproject.scheduler.api.SchedulerException: RRULE periods overlap
      at org.opencastproject.scheduler.impl.SchedulerServiceImpl.findConflictingEvents(SchedulerServiceImpl.java:1127) ~[?:?]
      at org.opencastproject.scheduler.impl.SchedulerServiceImpl.addMultipleEventInternal(SchedulerServiceImpl.java:541) ~[?:?]
      at org.opencastproject.scheduler.impl.SchedulerServiceImpl.addMultipleEvents(SchedulerServiceImpl.java:492) ~[?:?]
      at org.opencastproject.index.service.impl.IndexServiceImpl.createEvent(IndexServiceImpl.java:976) ~[?:?]
      at org.opencastproject.external.endpoint.EventsEndpoint.scheduleNewEvent(EventsEndpoint.java:548) ~[101:opencast-external-api:7.0.0.SNAPSHOT]
      at org.opencastproject.external.endpoint.EventsEndpoint.createNewEvent(EventsEndpoint.java:513) [101:opencast-external-api:7.0.0.SNAPSHOT]

      This exception should get mapped to a bad request.
      Show
      With scheduling data with a very long duration (>24 hours) such that events overlap, like this: {"agent_id":"devca","duration":262500000,"end":"2019-07-30T12:55:00Z","inputs":["default"],"rrule":"FREQ=WEEKLY;BYDAY=MO,TU,TH,FR;BYHOUR=12;BYMINUTE=0","start":"2019-07-24T12:00:00Z"} you get an exception thrown and an uninformative 500 internal server error from the POST /api/event endpoint: 2019-05-20T16:08:08,098 | ERROR | (EventsEndpoint:534) - Unable to create event org.opencastproject.scheduler.api.SchedulerException: RRULE periods overlap at org.opencastproject.scheduler.impl.SchedulerServiceImpl.findConflictingEvents(SchedulerServiceImpl.java:1127) ~[?:?] at org.opencastproject.scheduler.impl.SchedulerServiceImpl.addMultipleEventInternal(SchedulerServiceImpl.java:541) ~[?:?] at org.opencastproject.scheduler.impl.SchedulerServiceImpl.addMultipleEvents(SchedulerServiceImpl.java:492) ~[?:?] at org.opencastproject.index.service.impl.IndexServiceImpl.createEvent(IndexServiceImpl.java:976) ~[?:?] at org.opencastproject.external.endpoint.EventsEndpoint.scheduleNewEvent(EventsEndpoint.java:548) ~[101:opencast-external-api:7.0.0.SNAPSHOT] at org.opencastproject.external.endpoint.EventsEndpoint.createNewEvent(EventsEndpoint.java:513) [101:opencast-external-api:7.0.0.SNAPSHOT] This exception should get mapped to a bad request.

      TestRail: Results

        Attachments

          Activity

            People

            • Assignee:
              smarquard Stephen Marquard
              Reporter:
              smarquard Stephen Marquard
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                TestRail: Cases