Error: The end instant must be greater or equal to the start


I’m getting a “The end instant must be greater or equal to the start” error when running my query. I’ve seen posts about this error but am unable to understand how I should update my query. When I update the period to PT01H it works, but for a 1 minute period I can’t get it work (tried a bunch of different time ranges). It is possible that there is no data for some minutes in the interval, could that be the problem? Thank you for your help, the full query is below.


“dataSource”: “experiment_123”,

“granularity”: {

“type”: “period”,

“period”: “PT60S”,

“timeZone”: “UTC”,

“origin”: “2017-03-04T08:00:00+00:00”


“intervals”: [“2017-03-04T15:00:00+00:00/2017-03-04T20:00:00+00:00”],

“context”: {

“timeout”: 30000


“queryType”: “timeseries”,

“filter”: {

“type”: “or”,

“fields”: [{

“type”: “selector”,

“dimension”: “policy_permitted”,

“value”: “PERMITTED”

}, {

“type”: “selector”,

“dimension”: “policy_permitted”,

“value”: “PERMITTED”



“aggregations”: [{

“type”: “longSum”,

“name”: “count”,

“fieldName”: “count”



There should be a log on your broker or your historicals with a stack trace of this error. What does it say and what version of Druid is this?

The stack trace is superficially similar to but I tracked down the root cause. It’s actually not druid’s fault, but the “experiment” datasource was written with a custom indexer and the input wasn’t time-sorted before writing out the segment, so getting the last value of the __time column ended up being before the first value, violating all sorts of invariants.

So, not actually a bug in druid but a bug on our end, easily fixed.