jakubplichta / grafana-dashboard-builder

Generate Grafana dashboards with YAML
Apache License 2.0
147 stars 42 forks source link

Component '['default-dashboard']' does not have 'name' attribute, skipping #99

Closed benmathews closed 6 years ago

benmathews commented 7 years ago

Using the defaults, I'm getting the following error

$ grafana-dashboard-builder -p . --exporter grafana
2017-04-04 16:03:53,111 DEBUG Creating new connection with username=admin host=http://se-k8s-master.vivintsky.com/grafana/
2017-04-04 16:03:53,113 INFO Loading component type <class 'grafana_dashboards.components.projects.Project'>
2017-04-04 16:03:53,113 INFO Loading component type <class 'grafana_dashboards.components.links.LinksItemBase'>
2017-04-04 16:03:53,113 INFO Loading component type <class 'grafana_dashboards.components.panels.PanelsItemBase'>
2017-04-04 16:03:53,113 INFO Loading component type <class 'grafana_dashboards.components.rows.RowsItemBase'>
2017-04-04 16:03:53,113 INFO Loading component type <class 'grafana_dashboards.components.templates.TemplatesItemBase'>
2017-04-04 16:03:53,114 INFO Loading component type <class 'grafana_dashboards.components.dashboards.Dashboard'>
2017-04-04 16:03:53,114 INFO Loading component type <class 'grafana_dashboards.components.links.Links'>
2017-04-04 16:03:53,114 INFO Loading component type <class 'grafana_dashboards.components.panels.Panels'>
2017-04-04 16:03:53,114 INFO Loading component type <class 'grafana_dashboards.components.rows.Rows'>
2017-04-04 16:03:53,114 INFO Loading component type <class 'grafana_dashboards.components.templates.Templates'>
2017-04-04 16:03:53,114 INFO Loading component type <class 'grafana_dashboards.components.links.DashboardLink'>
2017-04-04 16:03:53,114 INFO Loading component type <class 'grafana_dashboards.components.links.AbsoluteLink'>
2017-04-04 16:03:53,114 INFO Loading component type <class 'grafana_dashboards.components.panels.Graph'>
2017-04-04 16:03:53,114 INFO Loading component type <class 'grafana_dashboards.components.panels.SingleStat'>
2017-04-04 16:03:53,115 INFO Loading component type <class 'grafana_dashboards.components.panels.Table'>
2017-04-04 16:03:53,115 INFO Loading component type <class 'grafana_dashboards.components.panels.Text'>
2017-04-04 16:03:53,115 INFO Loading component type <class 'grafana_dashboards.components.rows.Row'>
2017-04-04 16:03:53,115 INFO Loading component type <class 'grafana_dashboards.components.templates.Query'>
2017-04-04 16:03:53,115 INFO Loading component type <class 'grafana_dashboards.components.templates.EnumeratedTemplateBase'>
2017-04-04 16:03:53,115 INFO Loading component type <class 'grafana_dashboards.components.templates.CustomTemplate'>
2017-04-04 16:03:53,115 INFO Loading component type <class 'grafana_dashboards.components.templates.IntervalTemplate'>
2017-04-04 16:03:53,178 DEBUG Adding component 'project' with name 'Example project'
2017-04-04 16:03:53,179 INFO Component '['default-dashboard']' does not have 'name' attribute, skipping
2017-04-04 16:03:53,179 DEBUG Adding component 'dashboard' with name 'overview'
2017-04-04 16:03:53,179 DEBUG Adding component 'dashboard' with name '{component}-connections'
2017-04-04 16:03:53,179 DEBUG Adding component 'dashboard' with name '{component}-{env}-{nodes}-system-details'
2017-04-04 16:03:53,179 DEBUG Adding component 'rows' with name 'first-row'
2017-04-04 16:03:53,179 DEBUG Adding component 'rows' with name 'second-row'
2017-04-04 16:03:53,179 DEBUG Adding component 'rows' with name '{param}-row'
2017-04-04 16:03:53,180 DEBUG Adding component 'panels' with name 'connections'
2017-04-04 16:03:53,180 DEBUG Adding component 'panels' with name 'memory'
2017-04-04 16:03:53,180 DEBUG Adding component 'templates' with name 'template'
2017-04-04 16:03:53,180 DEBUG Adding component 'dashboard' with name 'some dashboard'
2017-04-04 16:03:53,180 DEBUG Adding component 'templates' with name 'another-template'
2017-04-04 16:03:53,180 DEBUG Adding component 'panels' with name 'singlestat-{title}'
Traceback (most recent call last):
  File "/usr/local/bin/grafana-dashboard-builder", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/grafana_dashboards/cli.py", line 98, in main
    projects = DefinitionParser().load_projects(paths)
  File "/usr/local/lib/python2.7/dist-packages/grafana_dashboards/parser.py", line 33, in load_projects
    registry.add(component)
  File "/usr/local/lib/python2.7/dist-packages/grafana_dashboards/components/base.py", line 72, in add
    'This contains %s attributes' % len(component.keys()))
AttributeError: 'str' object has no attribute 'keys'
jakubplichta commented 7 years ago

hi @benmathews , can you please attach source (anonymized) yaml so I can try to debug it? thanks!

benmathews commented 7 years ago

This was just straight from the repo. I didn't change anything.

jakubplichta commented 7 years ago

I see, will fix it soon

yanowitz commented 6 years ago

I too am having this issue.

jakubplichta commented 6 years ago

the problem is that you are including sample config.yaml into dashboard templates.. I'll add run example to readme