Project

General

Profile

Actions

Bug #7562

closed

Internal server error in timeline if there are no events in a timeslot

Added by Radko Krkoš over 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Category:
Development - Core
Target version:
Start date:
02/28/2022
Due date:
% Done:

100%

Estimated time:
To be discussed:
No

Description

The following error appeared:

Message type: CRITICAL
Location:     /var/mentat/venv/lib/python3.7/site-packages/vial/app.py:414
Module:       app
Function:     eh_internal_server_error
Time:         2022-02-28 06:14:30,459

Message:

INTERNAL SERVER ERROR

Request: /timeline/search?dt_from=2022-02-21+00%3A00%3A00&dt_to=2022-02-28+07%3A00%3A00&source_addrs=&source_ports=&limit=100&submit=Search
Traceback:
Traceback (most recent call last):
  File "/var/mentat/venv/lib/python3.7/site-packages/mentat/stats/idea.py", line 484, in aggregate_dbstats_events
    idx = bucket_dict[res.bucket]
KeyError: datetime.datetime(2022, 2, 23, 0, 30)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/mentat/venv/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/var/mentat/venv/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/var/mentat/venv/lib/python3.7/site-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/var/mentat/venv/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/var/mentat/venv/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/var/mentat/venv/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/var/mentat/venv/lib/python3.7/site-packages/flask_login/utils.py", line 272, in decorated_view
    return func(*args, **kwargs)
  File "/var/mentat/venv/lib/python3.7/site-packages/flask/views.py", line 89, in view
    return self.dispatch_request(*args, **kwargs)
  File "/var/mentat/venv/lib/python3.7/site-packages/vial/view/__init__.py", line 1061, in dispatch_request
    self.do_after_search()
  File "/var/mentat/venv/lib/python3.7/site-packages/hawat/blueprints/timeline/__init__.py", line 269, in do_after_search
    self.response_context['statistics']
  File "/var/mentat/venv/lib/python3.7/site-packages/mentat/stats/idea.py", line 495, in aggregate_dbstats_events
    str(res.set)
AttributeError: 'Record' object has no attribute 'set'

The cause of the first exception is that one of the timeslots does not cover any events, that could be easily mitigated by get(). The second exception should be investigated however, it may uncover some deeper problem.

Actions

Also available in: Atom PDF