Failed to parse setting [date_histogram.fixedInterval] with value [1M]

Hi!

We suddenly get the error “failed to parse setting [date_histogram.fixedInterval] with value [1M] as a time value: unit is missing or unrecognized” for our panels fetching data with the interval 1M

We use Grafana Cloud, current version is v9.1.0-76166 (7002c1100), possibly it just updated itself, since it worked yesterday.

When reading Elastic docs, the fixed_interval does not support 1M, so what has happened here? Did Grafana change something, or was it an undocumented feature in Elastic before?
source: Date histogram aggregation | Elasticsearch Guide [8.4] | Elastic

The request and response from the query inspector is as follows:

{
“request”: {
“url”: “api/datasources/proxy/20/_msearch?max_concurrent_shard_requests=5”,
“method”: “POST”,
“data”: “{"search_type":"query_then_fetch","ignore_unavailable":true,"index":"serilog-payments"}\n{"size":0,"query":{"bool":{"filter":[{"range":{"Timestamp":{"gte":1535702428168,"lte":1661932828168,"format":"epoch_millis"}}},{"query_string":{"analyze_wildcard":true,"query":"Properties.Author.ServiceGroup_s:Checkout AND Properties.Tag_s:PurchaseSuccessful"}}]}},"aggs":{"2":{"date_histogram":{"field":"Timestamp","min_doc_count":0,"extended_bounds":{"min":1535702428168,"max":1661932828168},"format":"epoch_millis","fixed_interval":"1M"},"aggs":{"1":{"sum":{"field":"Properties.Amount_d"}}}}}}\n”,
“hideFromInspector”: false
},
“response”: {
“error”: {
“root_cause”: [
{
“type”: “x_content_parse_exception”,
“reason”: “[1:436] [date_histogram] failed to parse field [fixed_interval]”
}
],
“type”: “x_content_parse_exception”,
“reason”: “[1:436] [date_histogram] failed to parse field [fixed_interval]”,
“caused_by”: {
“type”: “illegal_argument_exception”,
“reason”: “failed to parse setting [date_histogram.fixedInterval] with value [1M] as a time value: unit is missing or unrecognized”
}
},
“status”: 400
}
}

I got an answer from support, I paste it here for reference:

I think this change in Grafana caused your issue: [https://github.com/grafana/grafana/pull/50297]

in previous Grafana versions, for Elasticsearch 7.x we used the interval attribute to specify the interval-value. the problem is, this can become fixed_interval or calendar_interval based on the interval-value, so for example, when the user resized the dashboard-window, this might trigger a different interval-handling. this is not good, so we are switching to always use fixed_interval to provide consistent results. this is technically a breaking change, but it is a change to a better situation.

The workaround is to use 30d or 31d instead of 1M.