chronograf icon indicating copy to clipboard operation
chronograf copied to clipboard

Empty fields list in graphs and alerts query builder

Open jturello-ulink opened this issue 9 years ago • 5 comments

Hi,

I have an empty list of fields value when using the query builder with measurements having only one field named "value", either in the graph or alert section.

It works on telegraf database for example, which has multiple fields keys and named usage_xxxx.

There is the field detail on my db (same for all my measurements):

SHOW FIELD KEYS ON energie from "1h".mesure_co2
name: mesure_co2
fieldKey        fieldType
--------        ---------
value           float 

The database, measurements and tags lists are ok.

I'm using chronograf v1.1.1-1 amd64, tested on linux mint 18.1 and ubuntu server 14.04.

jturello-ulink avatar Jan 05 '17 17:01 jturello-ulink

Hi @jturello-ulink thanks for writing in! Looks interesting. We'll try to reproduce.

Would you be able to send us the server logs? I'm curious if that will shed any light on the issue.

goller avatar Jan 05 '17 17:01 goller

Sure, on the server side I receive this request when I get to the field selection part:

[httpd] 109.190.203.85 - - [06/Jan/2017:09:14:23 +0000] "POST /query?db=energie&epoch=ms&q=SHOW+FIELD+KEYS+FROM+%22mesure_co2%22&rp= HTTP/1.1" 200 46 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36" 8351ea45-d3f0-11e6-8e7d-000000000000 6076

Which returns an empty json:

{"results":[{}]}

I just found out that some measurements, on the same database ("energie"), were working. They have the same single field named "value", but the major difference is that they use the default RP, unlike the measurement above ("mesure_co2"). This one is using 3 RPs different than the default RP ("raw","10m","1h").

I tried to call the HTTP request above with filling the "rp" parameter, but it still respond with an empty json.

It seems that using measurement not using a default RP triggers this bug.

jturello-ulink avatar Jan 06 '17 09:01 jturello-ulink

Yikes! Yup, I'm able to reproduce on any query that does not have the default retention policy.

goller avatar Jan 06 '17 19:01 goller

Looks like this may be related to #338

nhaugo avatar Jan 06 '17 19:01 nhaugo

Running theory is this is broken for all queries, so lets start by looking at the core query building function.

Check #338 for additional repro steps

nhaugo avatar Jan 10 '17 17:01 nhaugo