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

Getting Python Error But Nothing Meaningful #25

Closed
mhobotpplnet opened this issue Apr 27, 2018 · 4 comments
Closed

Getting Python Error But Nothing Meaningful #25

mhobotpplnet opened this issue Apr 27, 2018 · 4 comments

Comments

@mhobotpplnet
Copy link

mhobotpplnet commented Apr 27, 2018

Am trying to do simple backup and followed instructions as specified.
I can do an ls , vi and everything with the dashboards, but I can not for some odd reason do a backup

I get this error regardless of system path I specify

[/]> backup /remote/localhost/ /Users/myusername/tmp
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/climb/core.py", line 56, in run
    result = self.execute(*shlex.split(command))
  File "/usr/local/lib/python3.6/site-packages/climb/core.py", line 79, in execute
    return self._commands.execute(command, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/climb/commands.py", line 26, in execute
    return method(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/grafcli/commands.py", line 213, in backup
    self.file_export(doc_path, file_path)
  File "/usr/local/lib/python3.6/site-packages/grafcli/commands.py", line 244, in file_export
    document = self._resources.get(path)
  File "/usr/local/lib/python3.6/site-packages/grafcli/resources/resources.py", line 46, in get
    return manager.get(*parts)
  File "/usr/local/lib/python3.6/site-packages/grafcli/resources/common.py", line 33, in get
    dashboard = self._storage.get(dashboard_name)
  File "/usr/local/lib/python3.6/site-packages/grafcli/storage/api.py", line 45, in get
    return Dashboard(source['dashboard'], dashboard_id)
  File "/usr/local/lib/python3.6/site-packages/grafcli/documents.py", line 95, in __init__
    self._load(source)
  File "/usr/local/lib/python3.6/site-packages/grafcli/documents.py", line 101, in _load
    for row in source['rows']:

Worth to mention this is Grafana 5.0 -- so that might be the issue.

@mhobotpplnet
Copy link
Author

Also tried with the new branch element -5

Got bit diff error regardless of where or how I try to backup

Traceback (most recent call last):
  File "/usr/local/bin/grafcli", line 4, in <module>
    __import__('pkg_resources').run_script('grafcli===0.6.0-1-ge910b68', 'grafcli')
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 750, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1534, in run_script
    exec(script_code, namespace, namespace)
  File "/usr/local/lib/python3.6/site-packages/grafcli-0.6.0_1_ge910b68-py3.6.egg/EGG-INFO/scripts/grafcli", line 27, in <module>
  File "/usr/local/lib/python3.6/site-packages/grafcli-0.6.0_1_ge910b68-py3.6.egg/EGG-INFO/scripts/grafcli", line 13, in main
  File "/usr/local/lib/python3.6/site-packages/climb/core.py", line 79, in execute
    return self._commands.execute(command, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/climb/commands.py", line 26, in execute
    return method(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/grafcli-0.6.0_1_ge910b68-py3.6.egg/grafcli/commands.py", line 213, in backup
  File "/usr/local/lib/python3.6/site-packages/grafcli-0.6.0_1_ge910b68-py3.6.egg/grafcli/commands.py", line 244, in file_export
  File "/usr/local/lib/python3.6/site-packages/grafcli-0.6.0_1_ge910b68-py3.6.egg/grafcli/resources/resources.py", line 46, in get
  File "/usr/local/lib/python3.6/site-packages/grafcli-0.6.0_1_ge910b68-py3.6.egg/grafcli/resources/common.py", line 33, in get
  File "/usr/local/lib/python3.6/site-packages/grafcli-0.6.0_1_ge910b68-py3.6.egg/grafcli/storage/api.py", line 45, in get
  File "/usr/local/lib/python3.6/site-packages/grafcli-0.6.0_1_ge910b68-py3.6.egg/grafcli/documents.py", line 95, in __init__
  File "/usr/local/lib/python3.6/site-packages/grafcli-0.6.0_1_ge910b68-py3.6.egg/grafcli/documents.py", line 101, in _load
KeyError: 'rows'

@bartwo
Copy link

bartwo commented Jun 11, 2018

Traceback (most recent call last):
  File "/home/bwouters/.local/bin/grafcli", line 27, in <module>
    sys.exit(main())
  File "/home/bwouters/.local/bin/grafcli", line 13, in main
    result = cli.execute(*sys.argv[1:])
  File "/home/bwouters/.local/lib/python3.6/site-packages/climb/core.py", line 79, in execute
    return self._commands.execute(command, **kwargs)
  File "/home/bwouters/.local/lib/python3.6/site-packages/climb/commands.py", line 26, in execute
    return method(*args, **kwargs)
  File "/home/bwouters/.local/lib/python3.6/site-packages/grafcli/commands.py", line 244, in file_export
    document = self._resources.get(path)
  File "/home/bwouters/.local/lib/python3.6/site-packages/grafcli/resources/resources.py", line 46, in get
    return manager.get(*parts)
  File "/home/bwouters/.local/lib/python3.6/site-packages/grafcli/resources/common.py", line 33, in get
    dashboard = self._storage.get(dashboard_name)
  File "/home/bwouters/.local/lib/python3.6/site-packages/grafcli/storage/api.py", line 45, in get
    return Dashboard(source['dashboard'], dashboard_id)
  File "/home/bwouters/.local/lib/python3.6/site-packages/grafcli/documents.py", line 95, in __init__
    self._load(source)
  File "/home/bwouters/.local/lib/python3.6/site-packages/grafcli/documents.py", line 101, in _load
    for row in source['rows']:
KeyError: 'rows'

Also have this issue by the looks of it

@nkovacne
Copy link

I made a workaround to avoid the failure, not sure if it breaks something, though. The grafcli command ends correctly.

# diff /usr/lib/python3.4/site-packages/grafcli/documents.py /root/documents.py 
101,103c101,102
<         if 'rows' in source:
<             for row in source['rows']:
<                 self._add_row(row)
---
>         for row in source['rows']:
>             self._add_row(row)

@m110
Copy link
Owner

m110 commented Mar 20, 2019

Will be resolved within #24

@m110 m110 closed this as completed Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants