Skip to content

grafana-wtf log fails #192

Open
Open
@amotl

Description

@amotl

When I tried grafana-wtf log, it failed.

$ grafana-wtf log --number=50
Traceback (most recent call last):
  File "/home/tom/.local/bin/grafana-wtf", line 5, in <module>
    from grafana_wtf.commands import run
  File "/home/tom/.local/lib/python3.13/site-packages/grafana_wtf/commands.py", line 12, in <module>
    from grafana_wtf.core import GrafanaWtf
  File "/home/tom/.local/lib/python3.13/site-packages/grafana_wtf/core.py", line 264
    +                continue
IndentationError: expected an indented block after 'if' statement on line 263
[gc@fedora:~]$ 
[gc@fedora:~]$ grafana-wtf log --number=50
2025-05-30 10:57:56,910 [grafana_wtf.commands                ] INFO    : Grafana location: https://grafana.company.com/
2025-05-30 10:57:56,922 [grafana_wtf.core                    ] INFO    : Response cache will expire after 3600 seconds
2025-05-30 10:57:56,926 [grafana_wtf.core                    ] INFO    : Response cache database: /home/tom/.cache/grafana-wtf.sqlite
2025-05-30 10:57:56,946 [grafana_wtf.commands                ] INFO    : Grafana version: 12.0.1
2025-05-30 10:57:56,947 [grafana_wtf.core                    ] INFO    : Acquiring data for multiple Grafana dashboards
2025-05-30 10:57:56,947 [grafana_wtf.core                    ] INFO    : Scanning dashboards
2025-05-30 10:57:56,950 [grafana_wtf.core                    ] INFO    : Found 95 dashboard(s)
0it [00:00, ?it/s]
2025-05-30 10:57:56,957 [grafana_wtf.core                    ] INFO    : Fetching dashboards one by one                                                                                                 | 0/95 [00:00<?, ?it/s]
 76%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉                                             | 72/95 [01:23<00:26,  1.16s/it]
2025-05-30 10:59:20,555 [grafana_wtf.core                    ] INFO    : Aggregating edit history for multiple Grafana dashboards████████████████▉                                             | 72/95 [01:23<00:15,  1.51it/s]
Traceback (most recent call last):
  File "/home/tom/.local/bin/grafana-wtf", line 8, in <module>
    sys.exit(run())
             ~~~^^
  File "/home/tom/.local/lib/python3.13/site-packages/grafana_wtf/commands.py", line 282, in run
    entries = engine.log(dashboard_uid=options.dashboard_uid)
  File "/home/tom/.local/lib/python3.13/site-packages/grafana_wtf/core.py", line 437, in log
    version=dashboard_revision["version"],
            ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
TypeError: string indices must be integers, not 'str'

Originally posted by @GarbageYard in #191

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions