Closed cyberox closed 1 week ago
To help debugging it, could you also share the actual curl
command (with the post payload) that you used. The error message notes the start
is empty. But it's not clear if that's because its value was scrambled by something in-between, or it was indeed missing.
Here is the curl command I used:
curl -v -X POST -s https://mimir.dev.organization.local/prometheus/api/v1/query_range \
--header 'X-Scope-OrgID: organization-dev' \
--header 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ' \
-F 'query=sum(container_memory_working_set_bytes{namespace="default"}) by (pod, container, namespace)' \
-F 'end="2024-08-29T12:11:16.000Z"' \
-F 'start="2024-08-29T11:11:16.000Z"' \
-F 'step=60'
Thank you for providing the command. I think the issue is that this curl command sends request with Content-Type: multipart/form-data
, because of the -F
flags. Prometheus doesn't officially support that, neither does Mimir. The API expects application/x-www-form-urlencoded
(ref to Prometheus docs).
The request validation in Mimir should probably do a better job and report the bad request's content-type in this case.
Meanwhile, try using curl's -d
or --data-urlencode
instead. For example,
curl -v -s https://mimir.dev.organization.local/prometheus/api/v1/query_range \
-d 'start=2024-08-29T11:11:16.000Z' ...
Indeed, using data-urlencode the response is correct.
Describe the bug
I want to replace our Prometheus server instances with mimir, but the query on the
/query_range
endpoint gives an error on the start parameter:{"status":"error","errorType":"bad_data","error":"invalid parameter \"start\": cannot parse \"\" to a valid timestamp"}
To Reproduce
I use curl to call the prometheus endpoint, this request is working:
When I do the same call against our mimir endpoint, it returns the error:
Expected behavior
The same output as with the prometheus endpoint.
Environment