Catch some conflict check errors more gracefully


In the AdminUI, if you schedule a recurrent event with the start & end date on the same day, not the same day of week as the recurrent event, you get an appropriate UI error (Scheduling error: The event has already ended), but also this long stack trace in the logs that's not really helpful.

POST to /admin-ng/event/new/conflicts with metadata like:

metadata: {"start":"2019-02-16T16:00:00Z","device":"alex1a","duration":"3300000","end":"2019-02-16T16:55:00Z","rrule":"FREQ=WEEKLY;BYDAY=WE;BYHOUR=16;BYMINUTE=0"}

and gets an http 500 internal server error back.

2019-02-16 17:39:31,597 | ERROR | qtp1466124335-1047 | (AbstractEventEndpoint:2235) - Unable to find conflicting events for jdaylt2, 2019-02-16T02:00:00Z, 2019-02-16T02:55:00Z: java.lang.IllegalArgumentException: Requirement 'periods' must hold true
at org.opencastproject.util.RequireUtil.requireTrue(
at org.opencastproject.scheduler.impl.SchedulerServiceImpl.findConflictingEvents(
at org.opencastproject.scheduler.impl.SchedulerServiceImpl.findConflictingEvents(
at org.opencastproject.adminui.endpoint.AbstractEventEndpoint.getNewConflicts(


Stephen Marquard
February 17, 2019, 7:24 PM

This change avoids back-end errors, but leads to the Admin UI thinking an event has been created when none has (because the range is empty). Needs some sanity-checking on the Admin UI, or a slightly different response from the conflict check that means "no events in range" rather than "no conflicts".

Stephen Marquard
February 16, 2019, 4:45 PM

Also need to check how the external API handles this.

Fixed and reviewed


Stephen Marquard


Stephen Marquard