Catch some conflict check errors more gracefully

Description

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(RequireUtil.java:47)
at org.opencastproject.scheduler.impl.SchedulerServiceImpl.findConflictingEvents(SchedulerServiceImpl.java:1185)
at org.opencastproject.scheduler.impl.SchedulerServiceImpl.findConflictingEvents(SchedulerServiceImpl.java:1165)
at org.opencastproject.adminui.endpoint.AbstractEventEndpoint.getNewConflicts(AbstractEventEndpoint.java:2223)

Activity

Show:
Stephen Marquard
February 17, 2019, 7:24 PM

https://github.com/cilt-uct/opencast/commit/30e9ff498fa15acbbed822760a6cc3bf9fa3e4e4

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

Assignee

Stephen Marquard

Reporter

Stephen Marquard