Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-75874

Unhandled hudson.scheduler.RareOrImpossibleDateException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • calendar-view-plugin
    • None
    • Jenkins 2.517 hosted on Ubuntu. Calendar View Plugin 0.3.6.

      When presented with a cron-based job that is "rare" or "impossible", lower level Jenkins code throws an exception (hudson.scheduler.RareOrImpossibleDateException). That exception is unhandled by the code that builds the future-looking view in the calendar, which results in no future events - including other events that are neither "rare" nor "impossible" - from appearing on the calendar.

      This is a stack trace:
       

              Caught exception evaluating: it.events in /user/<username>/my-views/view/Job%20Calendar/events. Reason: java.lang.reflect.InvocationTargetException hudson.scheduler.RareOrImpossibleDateException at hudson.scheduler.CronTab.ceil(CronTab.java:385) at hudson.scheduler.CronTab.ceil(CronTab.java:362) at PluginClassLoader for calendar-view//io.jenkins.plugins.view.calendar.service.CalendarEventService$ForwardScheduledEventCollector.nextRun(CalendarEventService.java:169) at PluginClassLoader for calendar-view//io.jenkins.plugins.view.calendar.service.CalendarEventService$ScheduledEventCollector.collectEvents(CalendarEventService.java:135) at PluginClassLoader for calendar-view//io.jenkins.plugins.view.calendar.service.CalendarEventService.getScheduledEvents(CalendarEventService.java:115) at PluginClassLoader for calendar-view//io.jenkins.plugins.view.calendar.service.CalendarEventService.getScheduledEventsForward(CalendarEventService.java:102) at PluginClassLoader for calendar-view//io.jenkins.plugins.view.calendar.service.CalendarEventService.getCalendarEvents(CalendarEventService.java:92) at PluginClassLoader for calendar-view//io.jenkins.plugins.view.calendar.CalendarView.getEvents(CalendarView.java:423)                

       
      It is recommended to catch this error at CalendarEventService.java:115 and either log it or ignore it.  The expected behavior from the user's perspective is that a job "rare" or "impossible" would simply not appear on the calendar, not that it would prevent all jobs from populating.
       
      It worth noting that, from a user perspective, the existence of a "rare" or "impossible" job in the schedule may be intentional or an error in the specification of a specific cron job, but in neither case is the failure mode seen here expected behavior. (In our case, it occurred due to a job that depends on where certain holidays fall within the week and so it was "rare" but not wrongly scheduled.)
       
      This should be reproducible by scheduling a job that runs, say, every 4 years and had it last run in the recent past.

            malice00 Roland Asmann
            yellowb David
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: