From 11e0bc88a29987023ecd49d2e4f1dab7b1b2500d Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Sat, 17 Feb 2024 17:52:53 +0200 Subject: [PATCH] docs/CHANGELOG.md: document f8207e33a21db65bff9585e7a1aa0f144f1a1ae7 --- docs/CHANGELOG.md | 3 +++ lib/httputils/duration.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 9142a06e9..7980325fe 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -11,6 +11,9 @@ The following `tip` changes can be tested by building VictoriaMetrics components ## v1.93.x long-time support release (LTS) +* BUGFIX: fix the misleading error `0ms is out of allowed range [0 ...` when passing `step=0` to [/api/v1/query](https://docs.victoriametrics.com/keyconcepts/#instant-query) + or [/api/v1/query_range](https://docs.victoriametrics.com/keyconcepts/#range-query). See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5795). + ## [v1.93.12](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.93.12) Released at 2024-02-14 diff --git a/lib/httputils/duration.go b/lib/httputils/duration.go index 8a5e3887f..f2a6df300 100644 --- a/lib/httputils/duration.go +++ b/lib/httputils/duration.go @@ -29,7 +29,7 @@ func GetDuration(r *http.Request, argKey string, defaultValue int64) (int64, err } msecs := int64(secs * 1e3) if msecs <= 0 || msecs > maxDurationMsecs { - return 0, fmt.Errorf("%q=%dms is out of allowed range [%d ... %d]", argKey, msecs, 1, int64(maxDurationMsecs)) + return 0, fmt.Errorf("%s=%dms is out of allowed range [%dms ... %dms]", argKey, msecs, 1, int64(maxDurationMsecs)) } return msecs, nil }