m0nhawk/grafana_api

Error with grafana_api.search.search_dashboards

dali20022 opened this issue · 1 comments

Traceback (most recent call last):
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 1741, in
main()
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 1735, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 1135, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/Users/ali/Dropbox/WORK/Workspace/grafana-dash/list-dash.py", line 6, in
grafana_api.search.search_dashboards(dashboard_ids=9)
File "/Users/ali/Dropbox/WORK/Workspace/venv/lib/python3.7/site-packages/grafana_api/api/search.py", line 57, in search_dashboards
r = self.api.GET(list_dashboard_path)
File "/Users/ali/Dropbox/WORK/Workspace/venv/lib/python3.7/site-packages/grafana_api/grafana_api.py", line 99, in __request_runnner
"Client Error {0}: {1}".format(r.status_code, r.json()['message'])
File "/Users/ali/Dropbox/WORK/Workspace/venv/lib/python3.7/site-packages/requests/models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/init.py", line 348, in loads
return _default_decoder.decode(s)
File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

From the error it seems that the output is empty and it can't be decoded:

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I was unable to reproduce the issue with latest version.

Feel free to comment with more details, otherwise I'm going to close this issue.