zalando-zmon / zmon-cli

ZMON Command Line Interface
http://zmon.readthedocs.org/en/latest/developer/zmon-cli.html
Other
9 stars 9 forks source link

Exception when updating a grafana dashboard using Zmon Update #56

Open mohabusama opened 7 years ago

mohabusama commented 7 years ago

When using Zmon Update, I get an exception at the end of the update command, However the dashboard seems to be updated anyway.

$> zmon graf update <yaml file>                                                                                                  

Updating dashboard XXXXXX ...
 EXCEPTION OCCURRED: 'id'
Traceback (most recent call last):
  File "/usr/local/bin/zmon", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/site-packages/zmon_cli/main.py", line 9, in main
    cli()
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/decorators.py", line 27, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/zmon_cli/cmds/grafana.py", line 47, in grafana_update
    ok(client.grafana_dashboard_url(dashboard))
  File "/usr/local/lib/python3.6/site-packages/zmon_cli/client.py", line 252, in grafana_dashboard_url
    return self.endpoint(GRAFANA_DASHBOARD_URL, dashboard['id'], base_url=self.base_url)
KeyError: 'id'

reported by @kabdelrahman on https://github.com/zalando/zmon/issues/35