java.lang.IllegalArgumentException: End time cannot be before start time

Terracotta Project Issue Tracker | Harish Kantamneni | 4 years ago
  1. 0

    When using the TriggerBuilder class to build a CalendarIntervalTrigger with an end time that is in the past, an IllegalArgumentException is thrown indicating that end time cannot be before the start time, even though that is not the case. Repro: TriggerBuilder<CalendarIntervalTrigger> tb = TriggerBuilder.newTrigger() .withSchedule( CalendarIntervalScheduleBuilder.calendarIntervalSchedule().withIntervalInDays(1)) .startAt(new Instant("2004-11-20").toDate()) .endAt(new Instant("2005-11-20").toDate()); .build() Resulting exception: java.lang.IllegalArgumentException: End time cannot be before start time at org.quartz.impl.triggers.CalendarIntervalTriggerImpl.setEndTime(CalendarIntervalTriggerImpl.java:292) at org.quartz.TriggerBuilder.build(TriggerBuilder.java:97) Note that the start time here is "2004-11-20" and the end time here is "2005-11-20" and so should not result in this exception. Fix: It appears that the default start time for CalendarIntervalTrigger is "now" or more precisely the instant when getStartTime() is first accessed. Given this behavior, if an end time in the past is set before setting a start time, then this end time is compared with "now" and the above described exception is thrown. So, in order to be able to set a past end time on this trigger, the start time needs to be set first. But the TriggerBuilder.build() method sets the end time before the start time. So the fix is to modify TriggerBuilder.build() to set the start time for a trigger first before setting its end time.

    Terracotta Project Issue Tracker | 4 years ago | Harish Kantamneni
    java.lang.IllegalArgumentException: End time cannot be before start time
  2. 0

    When using the TriggerBuilder class to build a CalendarIntervalTrigger with an end time that is in the past, an IllegalArgumentException is thrown indicating that end time cannot be before the start time, even though that is not the case. Repro: TriggerBuilder<CalendarIntervalTrigger> tb = TriggerBuilder.newTrigger() .withSchedule( CalendarIntervalScheduleBuilder.calendarIntervalSchedule().withIntervalInDays(1)) .startAt(new Instant("2004-11-20").toDate()) .endAt(new Instant("2005-11-20").toDate()); .build() Resulting exception: java.lang.IllegalArgumentException: End time cannot be before start time at org.quartz.impl.triggers.CalendarIntervalTriggerImpl.setEndTime(CalendarIntervalTriggerImpl.java:292) at org.quartz.TriggerBuilder.build(TriggerBuilder.java:97) Note that the start time here is "2004-11-20" and the end time here is "2005-11-20" and so should not result in this exception. Fix: It appears that the default start time for CalendarIntervalTrigger is "now" or more precisely the instant when getStartTime() is first accessed. Given this behavior, if an end time in the past is set before setting a start time, then this end time is compared with "now" and the above described exception is thrown. So, in order to be able to set a past end time on this trigger, the start time needs to be set first. But the TriggerBuilder.build() method sets the end time before the start time. So the fix is to modify TriggerBuilder.build() to set the start time for a trigger first before setting its end time.

    Terracotta Project Issue Tracker | 4 years ago | Harish Kantamneni
    java.lang.IllegalArgumentException: End time cannot be before start time
  3. 0

    When data exported through puppetdb-export from PuppetDB 1.5 is imported through puppetdb-import on 1.6 the following error occurs: {code} 2014-01-08 17:50:37,233 ERROR [puppetdb.command] [7923915b-5c7a-4120-8467-af35c51c6fd0] [store report] Fatal error on attempt 0 java.lang.IllegalArgumentException: ResourceEvent has unknown keys: :report-receive-time, :run-end-time, :run-start-time at com.puppetlabs.validation$validate_against_model_BANG_.invoke(validation.clj:82) at com.puppetlabs.puppetdb.reports$eval2045$fn__2046.invoke(reports.clj:84) at clojure.lang.MultiFn.invoke(MultiFn.java:231) at com.puppetlabs.puppetdb.command$store_report_STAR_$fn__5255.invoke(command.clj:371) at com.puppetlabs.puppetdb.command$store_report_STAR_.invoke(command.clj:370) at com.puppetlabs.puppetdb.command$eval5276$fn__5279.invoke(command.clj:389) at clojure.lang.MultiFn.invoke(MultiFn.java:231) at com.puppetlabs.puppetdb.command$produce_message_handler$fn__5360.invoke(command.clj:603) at com.puppetlabs.puppetdb.command$wrap_with_discard$fn__5309$fn__5313.invoke(command.clj:509) at com.puppetlabs.puppetdb.command.proxy$java.lang.Object$Callable$f8c5758f.call(Unknown Source) at com.yammer.metrics.core.Timer.time(Timer.java:91) at com.puppetlabs.puppetdb.command$wrap_with_discard$fn__5309.invoke(command.clj:508) at com.puppetlabs.puppetdb.command$wrap_with_exception_handling$fn__5294$fn__5295.invoke(command.clj:462) at com.puppetlabs.puppetdb.command.proxy$java.lang.Object$Callable$f8c5758f.call(Unknown Source) at com.yammer.metrics.core.Timer.time(Timer.java:91) at com.puppetlabs.puppetdb.command$wrap_with_exception_handling$fn__5294.invoke(command.clj:461) at com.puppetlabs.puppetdb.command$wrap_with_command_parser$fn__5304.invoke(command.clj:484) at com.puppetlabs.puppetdb.command$wrap_with_meter$fn__5284.invoke(command.clj:422) at com.puppetlabs.puppetdb.command$wrap_with_thread_name$fn__5318.invoke(command.clj:524) at clamq.jms$jms_consumer$fn__4478.invoke(jms.clj:38) at clamq.jms.proxy$java.lang.Object$MessageListener$ce893c05.onMessage(Unknown Source) at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:560) at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:498) at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947) {code}

    JIRA | 3 years ago | Daniele Sluijters
    java.lang.IllegalArgumentException: ResourceEvent has unknown keys: :report-receive-time, :run-end-time, :run-start-time
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    When I run ``lein run -- anonymize --profile full --infile file --outfile file.anon`` on a puppetdb-export from 1.5 I get this: {code} Anonymizing report from archive entry 'puppetdb-bak/reports/nl12s0002.healthcare.nedap.local-2013-11-06T14:37:02.391Z-1383746164.json' to 'puppetdb- bak/reports/ajiispqxdp.aooyqfwukydpmgb.nsc-2013-11-06T14:37:02.391Z-1383746164.json' java.lang.IllegalArgumentException: ResourceEvent has unknown keys: :report-receive-time, :run-end-time, :run-start-time at com.puppetlabs.validation$validate_against_model_BANG_.invoke (validation.clj:82) com.puppetlabs.puppetdb.reports$eval3014$fn__3015.invoke (reports.clj:84) clojure.lang.MultiFn.invoke (MultiFn.java:231) com.puppetlabs.puppetdb.anonymizer$report_QMARK_.invoke (anonymizer.clj:39) com.puppetlabs.puppetdb.anonymizer$anonymize_report.invoke (anonymizer.clj:381) com.puppetlabs.puppetdb.cli.anonymize$process_tar_entry.invoke (anonymize.clj:164) com.puppetlabs.puppetdb.cli.anonymize$_main$fn__4791.invoke (anonymize.clj:193) com.puppetlabs.puppetdb.cli.anonymize$_main.doInvoke (anonymize.clj:184) clojure.lang.RestFn.invoke (RestFn.java:512) clojure.lang.Var.invoke (Var.java:435) clojure.lang.AFn.applyToHelper (AFn.java:185) clojure.lang.Var.applyTo (Var.java:532) clojure.core$apply.invoke (core.clj:617) com.puppetlabs.puppetdb.core$_main.doInvoke (core.clj:79) clojure.lang.RestFn.invoke (RestFn.java:551) clojure.lang.Var.invoke (Var.java:440) user$eval5$fn__7.invoke (form-init1916739061922380257.clj:1) user$eval5.invoke (form-init1916739061922380257.clj:1) clojure.lang.Compiler.eval (Compiler.java:6619) clojure.lang.Compiler.eval (Compiler.java:6609) clojure.lang.Compiler.load (Compiler.java:7064) clojure.lang.Compiler.loadFile (Compiler.java:7020) clojure.main$load_script.invoke (main.clj:294) clojure.main$init_opt.invoke (main.clj:299) clojure.main$initialize.invoke (main.clj:327) clojure.main$null_opt.invoke (main.clj:362) clojure.main$main.doInvoke (main.clj:440) clojure.lang.RestFn.invoke (RestFn.java:421) clojure.lang.Var.invoke (Var.java:419) clojure.lang.AFn.applyToHelper (AFn.java:163) clojure.lang.Var.applyTo (Var.java:532) clojure.main.main (main.java:37) 2013-11-07 12:51:05,280 ERROR [puppetlabs.utils] Uncaught exception java.lang.IllegalArgumentException: ResourceEvent has unknown keys: :report-receive-time, :run-end-time, :run-start-time at com.puppetlabs.validation$validate_against_model_BANG_.invoke(validation.clj:82) at com.puppetlabs.puppetdb.reports$eval3014$fn__3015.invoke(reports.clj:84) at clojure.lang.MultiFn.invoke(MultiFn.java:231) at com.puppetlabs.puppetdb.anonymizer$report_QMARK_.invoke(anonymizer.clj:39) at com.puppetlabs.puppetdb.anonymizer$anonymize_report.invoke(anonymizer.clj:381) at com.puppetlabs.puppetdb.cli.anonymize$process_tar_entry.invoke(anonymize.clj:164) at com.puppetlabs.puppetdb.cli.anonymize$_main$fn__4791.invoke(anonymize.clj:193) at com.puppetlabs.puppetdb.cli.anonymize$_main.doInvoke(anonymize.clj:184) at clojure.lang.RestFn.invoke(RestFn.java:512) at clojure.lang.Var.invoke(Var.java:435) at clojure.lang.AFn.applyToHelper(AFn.java:185) at clojure.lang.Var.applyTo(Var.java:532) at clojure.core$apply.invoke(core.clj:617) at com.puppetlabs.puppetdb.core$_main.doInvoke(core.clj:79) at clojure.lang.RestFn.invoke(RestFn.java:551) at clojure.lang.Var.invoke(Var.java:440) at user$eval5$fn__7.invoke(form-init1916739061922380257.clj:1) at user$eval5.invoke(form-init1916739061922380257.clj:1) at clojure.lang.Compiler.eval(Compiler.java:6619) at clojure.lang.Compiler.eval(Compiler.java:6609) at clojure.lang.Compiler.load(Compiler.java:7064) at clojure.lang.Compiler.loadFile(Compiler.java:7020) at clojure.main$load_script.invoke(main.clj:294) at clojure.main$init_opt.invoke(main.clj:299) at clojure.main$initialize.invoke(main.clj:327) at clojure.main$null_opt.invoke(main.clj:362) at clojure.main$main.doInvoke(main.clj:440) at clojure.lang.RestFn.invoke(RestFn.java:421) at clojure.lang.Var.invoke(Var.java:419) at clojure.lang.AFn.applyToHelper(AFn.java:163) at clojure.lang.Var.applyTo(Var.java:532) at clojure.main.main(main.java:37) {code} This happens on both the 1.5.x branch at commit 3e9b7e4f21ca440bfffd2c589476f82fd7a10dea and master at 07e0c366cb0c58ddcf46d22c6ae7e50ed0604f2e

    JIRA | 3 years ago | redmine.exporter
    java.lang.IllegalArgumentException: ResourceEvent has unknown keys: :report-receive-time, :run-end-time, :run-start-time
  6. 0

    RRD4J error

    GitHub | 3 years ago | petrklus
    java.lang.IllegalArgumentException: Invalid start/end time in fetch request: 1399068000 > 1399067999

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      End time cannot be before start time

      at org.quartz.impl.triggers.CalendarIntervalTriggerImpl.setEndTime()
    2. quartz
      TriggerBuilder.build
      1. org.quartz.impl.triggers.CalendarIntervalTriggerImpl.setEndTime(CalendarIntervalTriggerImpl.java:292)
      2. org.quartz.TriggerBuilder.build(TriggerBuilder.java:97)
      2 frames