[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[status] [PATCH] Emit an error for traces without a master trace



This fixes a crash with debian.co.il, which was redirecting to another site.

Traceback (most recent call last):
  File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/srv/mirror-team.debian.org/status/./generate", line 52, in job_consumer_proc
    i.prepare(dbh)
  File "/srv/mirror-team.debian.org/status/dmt/HierarchyGenerator.py", line 271, in prepare
    row['traces'].remove('master')
ValueError: list.remove(x): x not in list
---
 dmt/HierarchyGenerator.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/dmt/HierarchyGenerator.py b/dmt/HierarchyGenerator.py
index 53cfc03..e412c2b 100755
--- a/dmt/HierarchyGenerator.py
+++ b/dmt/HierarchyGenerator.py
@@ -268,7 +268,14 @@ class Generator():
             row['traceset_changes'] = get_traceset_changes(cur2, row['site_id'], traces_last_change_cutoff)
 
             if row['traces'] is not None:
-                row['traces'].remove('master')
+                try:
+                    row['traces'].remove('master')
+                except ValueError:
+                    msg = 'Traceset missing master item'
+                    if row['error']:
+                        row['error'] = row['error'] + "; " + msg
+                    else:
+                        row['error'] = msg
             else:
                 row['traces'] = []
 
-- 
2.39.0


Reply to: