Project

General

Profile

Actions

Bug #7590

closed

/api/events/search sometimes crashes with TypeError: Expected 22 arguments, got 23

Added by Rajmund Hruška over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Category:
Development - Database
Target version:
Start date:
06/06/2022
Due date:
% Done:

100%

Estimated time:
To be discussed:
No

Description

There is some weird error which is not replicable with the same URI.


INTERNAL SERVER ERROR

Request: /api/events/search?submit=Search&source_addrs=88.102.216.31&limit=100&dt_from=2022-05-23%2008:28:01
Traceback:
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 909, in dispatch_request
    items = self.search(form_data)
  File "/var/mentat/venv/lib/python3.7/site-packages/hawat/base.py", line 372, in search
    self._check_search_query_quota()
  File "/var/mentat/venv/lib/python3.7/site-packages/hawat/base.py", line 350, in _check_search_query_quota
    int(flask_login.current_user.get_id())
  File "/var/mentat/venv/lib/python3.7/site-packages/mentat/services/eventstorage.py", line 1711, in queries_status
    records = self.cursor.fetchall()
  File "/var/mentat/venv/lib/python3.7/site-packages/psycopg2/extras.py", line 349, in fetchall
    return list(map(nt._make, ts))
  File "/usr/lib/python3.7/collections/__init__.py", line 407, in _make
    raise TypeError(f'Expected {num_fields} arguments, got {len(result)}')
TypeError: Expected 22 arguments, got 23

Right after we have received this error, I tried running the same query but I got different error message.

INTERNAL SERVER ERROR

Request: /api/events/search?submit=Search&source_addrs=88.102.216.31&limit=100&dt_from=2022-05-23%2008:28:01
Traceback:
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 909, in dispatch_request
    items = self.search(form_data)
  File "/var/mentat/venv/lib/python3.7/site-packages/hawat/base.py", line 372, in search
    self._check_search_query_quota()
  File "/var/mentat/venv/lib/python3.7/site-packages/hawat/base.py", line 350, in _check_search_query_quota
    int(flask_login.current_user.get_id())
  File "/var/mentat/venv/lib/python3.7/site-packages/mentat/services/eventstorage.py", line 1711, in queries_status
    records = self.cursor.fetchall()
  File "/var/mentat/venv/lib/python3.7/site-packages/psycopg2/extras.py", line 345, in fetchall
    ts = super(NamedTupleCursor, self).fetchall()
psycopg2.ProgrammingError: no results to fetch

Related issues

Is duplicate of Mentat - Bug #7565: Timeline falls flat on certain queryClosed03/02/2022

Actions
Blocked by Mentat - Bug #6191: Implement thread safety in eventstorage service moduleClosedPavel Kácha01/14/2020

Actions
Actions

Also available in: Atom PDF