Project

General

Profile

Actions

Bug #22274

closed

arv-cluster-activity type crash on len(None)

Added by Brett Smith 20 days ago. Updated 17 days ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
Crunch
Story points:
-
Release:
Release relationship:
Auto

Description

I think lower parts of the code might be assuming that an optional parameter has a value. It maybe just needs a default set or something.

$ arv-cluster-activity --start 2024-10-01 --end 2024-11-01 --cost-report-file costs.csv --html-report-file costs.html
WARNING:root:PROMETHEUS_HOST not found, not collecting activity from Prometheus
INFO:root:Exporting workflow runs 0 - 66
INFO:root:Getting container hours time series
INFO:root:Getting data usage time series
Traceback (most recent call last):
  File "/home/brett/Scratch/activity/bin/arv-cluster-activity", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/brett/Scratch/activity/lib/python3.12/site-packages/arvados_cluster_activity/main.py", line 193, in main
    f.write(reporter.html_report(since, to, args.exclude, args.include_workflow_steps))
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/brett/Scratch/activity/lib/python3.12/site-packages/arvados_cluster_activity/report.py", line 180, in html_report
    if len(self.graphs.get(managed_graph, [])) > 0:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: object of type 'NoneType' has no len()
Actions

Also available in: Atom PDF