Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Conversion of PanelID into int fails #14

Open
SirkoVZ opened this issue Feb 2, 2021 · 4 comments
Open

Conversion of PanelID into int fails #14

SirkoVZ opened this issue Feb 2, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@SirkoVZ
Copy link
Contributor

SirkoVZ commented Feb 2, 2021

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...

@andig
Copy link
Owner

andig commented Feb 2, 2021

Da wäre wohl uint64 der bessere Datentyp.

@thomytp
Copy link

thomytp commented May 1, 2021

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

@andig
Copy link
Owner

andig commented May 1, 2021

This has been fixed in 582082f#diff-f9b840921c2612fa00bdabf4c7e05c5c161d037975bfd0c1d96b23085c211d1f. Are you running the latest version?

@andig andig added the bug Something isn't working label May 1, 2021
@thomytp
Copy link

thomytp commented May 1, 2021

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..

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants