gravo icon indicating copy to clipboard operation
gravo copied to clipboard

Conversion of PanelID into int fails

Open SirkoVZ opened this issue 4 years ago • 4 comments

After creating a new dashboard and when choosing Gravo datasource an error occurs

json decode failed: json: cannot unmarshal number 23763571993 into Go struct field QueryRequest.panelId of type int
Object
status:400
statusText:"Bad Request"
data:Object
error:"Bad Request"
response:"json decode failed: json: cannot unmarshal number 23763571993 into Go struct field QueryRequest.panelId of type int
"
message:"json decode failed: json: cannot unmarshal number 23763571993 into Go struct field QueryRequest.panelId of type int
"
config:Object
url:"api/datasources/proxy/1/query"
data:Object
app:"dashboard"
requestId:"Q120"
timezone:"browser"
panelId:23763571993
dashboardId:1
range:Object
timeInfo:""
interval:"10s"
intervalMs:10000
targets:Array[1]
maxDataPoints:1950
scopedVars:Object
cacheTimeout:undefined
startTime:1612271048623
rangeRaw:Object
adhocFilters:Array[0]
method:"POST"
withCredentials:undefined
headers:Object
retry:0
hideFromInspector:false
message:"json decode failed: json: cannot unmarshal number 23763571993 into Go struct field QueryRequest.panelId of type int
"

It is possible to manually change the ID to e.g. 763571993. But, the ID should probably not be int...

SirkoVZ avatar Feb 02 '21 13:02 SirkoVZ

Da wäre wohl uint64 der bessere Datentyp.

andig avatar Feb 02 '21 13:02 andig

Hello, i have the same probleme, can you explain me, how can i solve the issue?

thomytp avatar May 01 '21 10:05 thomytp

This has been fixed in https://github.com/andig/gravo/commit/582082ff89ff40ef566179d29f8f07b5eb72aa4d#diff-f9b840921c2612fa00bdabf4c7e05c5c161d037975bfd0c1d96b23085c211d1f. Are you running the latest version?

andig avatar May 01 '21 10:05 andig

i install the json source via https://github.com/andig/gravo/ -> https://github.com/simPod/GrafanaJsonDatasource -> grafana-cli plugins install simpod-json-datasource. In your fix https://github.com/grafana/simple-json-datasource#query-api there was a different URL: https://github.com/grafana/simple-json-datasource#query-api -> sudo grafana-cli plugins install grafana-simple-json-datasource.

which is the correct one? I have tested both, but it does not work.

I use gravo over Docker: docker run -p 8000:8000 andig/gravo -api http://myserver/middleware.php I think this is a last one..

thomytp avatar May 01 '21 13:05 thomytp