Project

General

Profile

Actions

Bug #7562

closed

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

Added by Radko Krkoš about 2 years ago. Updated 10 months 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 #1

Updated by Jan Mach about 2 years ago

  • Assignee set to Jan Mach
Actions #2

Updated by Jan Mach about 2 years ago

To replicate try upper threshold in near future, for example 15 minutes.

Actions #3

Updated by Radko Krkoš over 1 year ago

  • Assignee changed from Jan Mach to Jakub Maloštik
  • Target version changed from Backlog to 2.11
Actions #4

Updated by Rajmund Hruška about 1 year ago

Jakub Maloštik is this one finished already or still in progress? I can see one commit - 1b22d07c.

Actions #5

Updated by Jakub Maloštik about 1 year ago

Rajmund Hruška wrote in #note-4:

Jakub Maloštik is this one finished already or still in progress? I can see one commit - 1b22d07c.

The commit only fixed the error meassage, I wasn't able to figure out what the cause of the problem was. However commits for the issue #6413 will close this issue, since they remove the code causing this error completely.

Actions #6

Updated by Jakub Maloštik about 1 year ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100
Actions #7

Updated by Rajmund Hruška about 1 year ago

  • Status changed from Resolved to In Review
Actions #8

Updated by Rajmund Hruška 10 months ago

  • Status changed from In Review to Closed
Actions

Also available in: Atom PDF