Project

General

Profile

Actions

Bug #6232

closed

Hawat fails with 500 on invalid network address

Added by Radko Krkoš almost 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Development - Core
Target version:
Start date:
02/20/2020
Due date:
% Done:

100%

Estimated time:
To be discussed:
No

Description

Hawat events search returns 500 if an IP address range entered in prefix format has host bits set, for example 1.2.3.0/23.
Here is the full error:

Message type: ERROR
Location:     /var/mentat/venv/lib/python3.7/site-packages/flask/app.py:1891
Module:       app
Function:     log_exception
Time:         2020-02-20 15:31:41,054

Message:

Exception on /events/search [GET]
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_principal.py", line 199, in _decorated
    rv = f(*args, **kw)
  File "/var/mentat/venv/lib/python3.7/site-packages/flask_login/utils.py", line 261, 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/hawat/base.py", line 1612, in dispatch_request
    items = items,
UnboundLocalError: local variable 'items' referenced before assignment

Actions #1

Updated by Jan Mach almost 5 years ago

  • Status changed from New to Resolved
  • Assignee changed from Jan Mach to Radko Krkoš
  • Target version changed from Backlog to 2.7
  • % Done changed from 0 to 100

Thank you for reporting, there was a logical bug in code flow. It should be fixed now:

https://mentat-alt.cesnet.cz/mentat/events/search?dt_from=&dt_to=&source_addrs=1.2.3.0%2F23&source_ports=&submit=Search

Please confirm and close this issue.

Actions #2

Updated by Radko Krkoš almost 5 years ago

  • Status changed from Resolved to Closed

Fixed on mentat-alt.

Actions

Also available in: Atom PDF