Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parse error at char 88: missing unit character in duration #1

Closed
pete-leese opened this issue Jan 28, 2019 · 16 comments · Fixed by #2
Closed

parse error at char 88: missing unit character in duration #1

pete-leese opened this issue Jan 28, 2019 · 16 comments · Fixed by #2

Comments

@pete-leese
Copy link

Hi,

When I set the Restarts toggle, I receive lots of these errors:

parse error at char 88: missing unit character in duration

Could you please help me out? :)

@FUSAKLA
Copy link
Owner

FUSAKLA commented Jan 29, 2019

Hi! That's unfortunate.
Can I ask what version of Grafana are you using?

If you use Grafana version lower than 5.3.0 it could be caused by the fact that Grafana added support for the $__interval variable in this version (CHANGELOG.MD).

@pete-leese
Copy link
Author

I’m running the latest nightly build of 5.5

@FUSAKLA
Copy link
Owner

FUSAKLA commented Jan 29, 2019

Hm, I see

Prometheus: Query for annotation always uses 60s step regardless of dashboard range, fixes #14795

https://github.com/grafana/grafana/blob/master/CHANGELOG.md#bug-fixes

This might be related.. Once I find the time I'll try the nightly build and see what we can do.
Meanwhile can you try to catch the request what is sent by Grafana? I suspect expansion of the $__interval variable.

@FUSAKLA
Copy link
Owner

FUSAKLA commented Jan 29, 2019

I tried with grafana/grafana:latest docker image and there it worked also.
What version of prometheus do you use as a datasource?

@pete-leese
Copy link
Author

I am using prometheus 2.70.

Worth noting;

I'm also using thanos
I'm not using docker for alert manager

@FUSAKLA
Copy link
Owner

FUSAKLA commented Jan 30, 2019

So this happens with datasource set to Prometheus directly or to the Thanos query?

But mainly could you please try catching the query in the web console of your browser?
I'm not able to reproduce the issue unfortunately.

@pete-leese
Copy link
Author

"api/datasources/proxy/5/api/v1/query_range?query=changes(process_start_time_seconds%7B%20instance%3D~%22ukasprom01%5C%5C.allocate-cloud%5C%5C.co%5C%5C.uk%22%7D%5B%24__interval%5D)%20%3E%200&start=1548897820&end=1548941040&step=20"

angular.js:12759 GET https://xxxxxxxxxxxxxxxx/api/datasources/proxy/5/api/v1/query_r…2%7D%5B%24__interval%5D)%20%3E%200&start=1548897820&end=1548941040&step=20 400
event_editor.ts:27 AnnotationSrv.query error
{data: {…}, status: 400, headers: ƒ, config: {…}, statusText: "", …}
config:
headers: {X-Grafana-Org-Id: 1, Accept: "application/json, text/plain, /"}
jsonpCallbackParam: "callback"
method: "GET"
paramSerializer: ƒ (e)
requestId: NaN
retry: 0
transformRequest: [ƒ]
transformResponse: [ƒ]
url: "api/datasources/proxy/5/api/v1/query_range?query=changes(process_start_time_seconds%7B%20instance%3D~%22ukasprom01%5C%5C.allocate-cloud%5C%5C.co%5C%5C.uk%22%7D%5B%24__interval%5D)%20%3E%200&start=1548897820&end=1548941040&step=20"
proto: Object
data:
error: "parse error at char 88: missing unit character in duration"
errorType: "bad_data"
message: "parse error at char 88: missing unit character in duration"
status: "error"
proto: Object
headers: ƒ (n)
message: "parse error at char 88: missing unit character in duration"
status: 400
statusText: ""
xhrStatus: "complete"
proto: Object

@FUSAKLA
Copy link
Owner

FUSAKLA commented Jan 31, 2019

Ok, so Grafana does not expand the $__instance variable.
As a temporary workaround you can replace the $__interval with 2m or range selector of your choice.

I finally managed to reproduce it with the 6.0.0-beta1 version and reported the issue on grafana
grafana/grafana#15168

@FUSAKLA
Copy link
Owner

FUSAKLA commented Jan 31, 2019

Ok, so it looks like I built this on a bug :)

I'll fix this asap

@pete-leese
Copy link
Author

good job @FUSAKLA - seems to be working perfect now :)

@FUSAKLA
Copy link
Owner

FUSAKLA commented Jan 31, 2019

Glad to hear, sorry for the inconvenience :)

I uploaded new revision to grafana.com so should be fixt even there.
Thanks for reporting!

@CRCinAU
Copy link

CRCinAU commented Jul 26, 2019

I get this exact issue on grafana-6.2.5-1.x86_64 from the official repos...

If I configure an alert, the same error occurs.

If I replace the $__interval with a value (say 30s), then the alert works properly.

@FUSAKLA
Copy link
Owner

FUSAKLA commented Jul 29, 2019

Hi @CRCinAU, sorry for the late reply.

Could you post what exact error do you get? Or prtscr or something?
If I try adding an alert I get on Grafana 6.2.4 warning
image

This is possible that grafana really does not support.
I don't use Grafana alerting so never hit thought about this actually.

Maybe worth to add a feature request to Grafana to add support of templating variables in alerts?

@benhannel
Copy link

I'm using $__rate_interval in a query with an alert on it. The graph renders fine, and the values in the graph suggest the alert shouldn't be firing, but the alert fires with this error:

Execution Error: tsdb.HandleRequest() error bad_data: 1:135: parse error: missing unit character in duration

This happens for all alert queries where I try to use $__rate_interval.

@m0e33
Copy link

m0e33 commented Aug 9, 2021

Are there any news on this? I'm getting the same error with grafana/grafana:latest.

@FUSAKLA
Copy link
Owner

FUSAKLA commented Sep 9, 2022

Hi, sorry about the late reply, I somehow missed the notifications 😖

Ok so I'm tempted to drop usage of the $__interval at all to avoid any issues with it and instead add a variable to choose the range selector 🤔

Would that be an acceptable fix for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants