[GH-ISSUE #27] Error displaying https://webapp/tasks #26

Closed
opened 2026-03-02 23:36:05 +03:00 by kerem · 2 comments
Owner

Originally created by @Shadebzh on GitHub (Nov 23, 2021).
Original GitHub issue: https://github.com/alb-uss/SECMON/issues/27

CENTOS 8 / Python 3.6 (and 3.9) installed

Apache Httpd error log:

[Tue Nov 23 09:15:09.203769 2021] [wsgi:error] ################## NEW GUI ERROR AT 23/11/2021, 09:15:09 ##################
[Tue Nov 23 09:15:09.204160 2021] [wsgi:error] ######## URL : https://secmon.domain.com/tasks ##########
[Tue Nov 23 09:15:09.205417 2021] [wsgi:error] Traceback with variables (most recent call last):
[Tue Nov 23 09:15:09.205460 2021] [wsgi:error] File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request
[Tue Nov 23 09:15:09.205505 2021] [wsgi:error] rv = self.dispatch_request()
[Tue Nov 23 09:15:09.205551 2021] [wsgi:error] e = AttributeError("type object 'datetime.datetime' has no attribute 'fromisoformat'",)
[Tue Nov 23 09:15:09.205583 2021] [wsgi:error] rv = None
[Tue Nov 23 09:15:09.205621 2021] [wsgi:error] self = <Flask 'secmon_web'>
[Tue Nov 23 09:15:09.205653 2021] [wsgi:error] File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request
[Tue Nov 23 09:15:09.205690 2021] [wsgi:error] return self.view_functionsrule.endpoint
[Tue Nov 23 09:15:09.205760 2021] [wsgi:error] rule = <Rule '/tasks' (OPTIONS, HEAD, GET) -> tasks>
[Tue Nov 23 09:15:09.206069 2021] [wsgi:error] req = <Request 'https://secmon.domain.com/tasks' [GET]>
[Tue Nov 23 09:15:09.206119 2021] [wsgi:error] self = <Flask 'secmon_web'>
[Tue Nov 23 09:15:09.206151 2021] [wsgi:error] File "/usr/local/lib/python3.6/site-packages/flask_simplelogin/init.py", line 117, in simple_decorator
[Tue Nov 23 09:15:09.206192 2021] [wsgi:error] return dispatch(function, args, **kwargs)
[Tue Nov 23 09:15:09.206235 2021] [wsgi:error] kwargs = {}
[Tue Nov 23 09:15:09.206271 2021] [wsgi:error] args = ()
[Tue Nov 23 09:15:09.206308 2021] [wsgi:error] function = <function tasks at 0x7f85f618e8c8>
[Tue Nov 23 09:15:09.206342 2021] [wsgi:error] dispatch = <function login_required..dispatch at 0x7f85f618e9d8>
[Tue Nov 23 09:15:09.206374 2021] [wsgi:error] File "/usr/local/lib/python3.6/site-packages/flask_simplelogin/init.py", line 98, in dispatch
[Tue Nov 23 09:15:09.206413 2021] [wsgi:error] return check(must) or fun(args, **kwargs)
[Tue Nov 23 09:15:09.206454 2021] [wsgi:error] kwargs = {}
[Tue Nov 23 09:15:09.206485 2021] [wsgi:error] args = ()
[Tue Nov 23 09:15:09.206518 2021] [wsgi:error] fun = <function tasks at 0x7f85f618e8c8>
[Tue Nov 23 09:15:09.206548 2021] [wsgi:error] username = None
[Tue Nov 23 09:15:09.206578 2021] [wsgi:error] must = None
[Tue Nov 23 09:15:09.206610 2021] [wsgi:error] dispatch_basic_auth = <function login_required..dispatch_basic_auth at 0x7f85f618ea60>
[Tue Nov 23 09:15:09.206643 2021] [wsgi:error] check = <function login_required..check at 0x7f85f618e950>
[Tue Nov 23 09:15:09.206695 2021] [wsgi:error] basic = False
[Tue Nov 23 09:15:09.206744 2021] [wsgi:error] File "/var/www/secmon/secmon_web.py", line 620, in tasks
[Tue Nov 23 09:15:09.206786 2021] [wsgi:error] tasks = getTasks()
[Tue Nov 23 09:15:09.206820 2021] [wsgi:error] File "/var/www/secmon/secmon_lib.py", line 285, in getTasks
[Tue Nov 23 09:15:09.206864 2021] [wsgi:error] formatted_date = datetime.fromisoformat(timestamp)
[Tue Nov 23 09:15:09.206948 2021] [wsgi:error] timestamp = '2021-11-23T09:11:49.582856'
[Tue Nov 23 09:15:09.206981 2021] [wsgi:error] line = '2021-11-23T09:11:49.582856 source_script="secmon_web" server="192.168.1.254" task_id="40956" task_status="loaded" message="Adding the following product : cpe:2.3microsoft:windows_server_2012:-:
:
:::::*...." \n'
[Tue Nov 23 09:15:09.207014 2021] [wsgi:error] tid = []
[Tue Nov 23 09:15:09.207047 2021] [wsgi:error] count = 0
[Tue Nov 23 09:15:09.207080 2021] [wsgi:error] logfile = '/var/www/secmon/logs.txt'
[Tue Nov 23 09:15:09.207110 2021] [wsgi:error] dir_path = '/var/www/secmon/'
[Tue Nov 23 09:15:09.207140 2021] [wsgi:error] script_path = '/var/www/secmon/secmon_lib.py'
[Tue Nov 23 09:15:09.207172 2021] [wsgi:error] builtins.AttributeError: type object 'datetime.datetime' has no attribute 'fromisoformat'
[Tue Nov 23 09:15:09.207205 2021] [wsgi:error] None
[Tue Nov 23 09:15:09.207228 2021] [wsgi:error] ################## PLEASE REPORT THIS ON GITHUB ##################

Thank you ! Raph.

Originally created by @Shadebzh on GitHub (Nov 23, 2021). Original GitHub issue: https://github.com/alb-uss/SECMON/issues/27 CENTOS 8 / Python 3.6 (and 3.9) installed Apache Httpd error log: [Tue Nov 23 09:15:09.203769 2021] [wsgi:error] ################## NEW GUI ERROR AT 23/11/2021, 09:15:09 ################## [Tue Nov 23 09:15:09.204160 2021] [wsgi:error] ######## URL : https://secmon.domain.com/tasks ########## [Tue Nov 23 09:15:09.205417 2021] [wsgi:error] Traceback with variables (most recent call last): [Tue Nov 23 09:15:09.205460 2021] [wsgi:error] File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request [Tue Nov 23 09:15:09.205505 2021] [wsgi:error] rv = self.dispatch_request() [Tue Nov 23 09:15:09.205551 2021] [wsgi:error] e = AttributeError("type object 'datetime.datetime' has no attribute 'fromisoformat'",) [Tue Nov 23 09:15:09.205583 2021] [wsgi:error] rv = None [Tue Nov 23 09:15:09.205621 2021] [wsgi:error] self = <Flask 'secmon_web'> [Tue Nov 23 09:15:09.205653 2021] [wsgi:error] File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request [Tue Nov 23 09:15:09.205690 2021] [wsgi:error] return self.view_functions[rule.endpoint](**req.view_args) [Tue Nov 23 09:15:09.205760 2021] [wsgi:error] rule = <Rule '/tasks' (OPTIONS, HEAD, GET) -> tasks> [Tue Nov 23 09:15:09.206069 2021] [wsgi:error] req = <Request 'https://secmon.domain.com/tasks' [GET]> [Tue Nov 23 09:15:09.206119 2021] [wsgi:error] self = <Flask 'secmon_web'> [Tue Nov 23 09:15:09.206151 2021] [wsgi:error] File "/usr/local/lib/python3.6/site-packages/flask_simplelogin/__init__.py", line 117, in simple_decorator [Tue Nov 23 09:15:09.206192 2021] [wsgi:error] return dispatch(function, *args, **kwargs) [Tue Nov 23 09:15:09.206235 2021] [wsgi:error] kwargs = {} [Tue Nov 23 09:15:09.206271 2021] [wsgi:error] args = () [Tue Nov 23 09:15:09.206308 2021] [wsgi:error] function = <function tasks at 0x7f85f618e8c8> [Tue Nov 23 09:15:09.206342 2021] [wsgi:error] dispatch = <function login_required.<locals>.dispatch at 0x7f85f618e9d8> [Tue Nov 23 09:15:09.206374 2021] [wsgi:error] File "/usr/local/lib/python3.6/site-packages/flask_simplelogin/__init__.py", line 98, in dispatch [Tue Nov 23 09:15:09.206413 2021] [wsgi:error] return check(must) or fun(*args, **kwargs) [Tue Nov 23 09:15:09.206454 2021] [wsgi:error] kwargs = {} [Tue Nov 23 09:15:09.206485 2021] [wsgi:error] args = () [Tue Nov 23 09:15:09.206518 2021] [wsgi:error] fun = <function tasks at 0x7f85f618e8c8> [Tue Nov 23 09:15:09.206548 2021] [wsgi:error] username = None [Tue Nov 23 09:15:09.206578 2021] [wsgi:error] must = None [Tue Nov 23 09:15:09.206610 2021] [wsgi:error] dispatch_basic_auth = <function login_required.<locals>.dispatch_basic_auth at 0x7f85f618ea60> [Tue Nov 23 09:15:09.206643 2021] [wsgi:error] check = <function login_required.<locals>.check at 0x7f85f618e950> [Tue Nov 23 09:15:09.206695 2021] [wsgi:error] basic = False [Tue Nov 23 09:15:09.206744 2021] [wsgi:error] File "/var/www/secmon/secmon_web.py", line 620, in tasks [Tue Nov 23 09:15:09.206786 2021] [wsgi:error] tasks = getTasks() [Tue Nov 23 09:15:09.206820 2021] [wsgi:error] File "/var/www/secmon/secmon_lib.py", line 285, in getTasks [Tue Nov 23 09:15:09.206864 2021] [wsgi:error] formatted_date = datetime.fromisoformat(timestamp) [Tue Nov 23 09:15:09.206948 2021] [wsgi:error] timestamp = '2021-11-23T09:11:49.582856' [Tue Nov 23 09:15:09.206981 2021] [wsgi:error] line = '2021-11-23T09:11:49.582856 source_script="secmon_web" server="192.168.1.254" task_id="40956" task_status="loaded" message="Adding the following product : cpe:2.3:o:microsoft:windows_server_2012:-:*:*:*:*:*:*:*...." \\n' [Tue Nov 23 09:15:09.207014 2021] [wsgi:error] tid = [] [Tue Nov 23 09:15:09.207047 2021] [wsgi:error] count = 0 [Tue Nov 23 09:15:09.207080 2021] [wsgi:error] logfile = '/var/www/secmon/logs.txt' [Tue Nov 23 09:15:09.207110 2021] [wsgi:error] dir_path = '/var/www/secmon/' [Tue Nov 23 09:15:09.207140 2021] [wsgi:error] script_path = '/var/www/secmon/secmon_lib.py' [Tue Nov 23 09:15:09.207172 2021] [wsgi:error] builtins.AttributeError: type object 'datetime.datetime' has no attribute 'fromisoformat' [Tue Nov 23 09:15:09.207205 2021] [wsgi:error] None [Tue Nov 23 09:15:09.207228 2021] [wsgi:error] ################## PLEASE REPORT THIS ON GITHUB ################## Thank you ! Raph.
kerem closed this issue 2026-03-02 23:36:05 +03:00
Author
Owner

@Radvaroc53 commented on GitHub (Nov 25, 2021):

Hi ! I got same issue, do snapshot before, and install this :

pip3 install backports.weakref
pip3 install backports-datetime-fromisoformat
dnf -y install python3-mod_wsgi

And add this in setup_lib.py

from datetime import datetime, timedelta, date, time
from backports.datetime_fromisoformat import MonkeyPatch
MonkeyPatch.patch_fromisoformat()

========================================

Or uninstall Python 3.6 and try to use Python 3.8

<!-- gh-comment-id:979010389 --> @Radvaroc53 commented on GitHub (Nov 25, 2021): Hi ! I got same issue, do snapshot before, and install this : ``` pip3 install backports.weakref pip3 install backports-datetime-fromisoformat dnf -y install python3-mod_wsgi ``` And add this in setup_lib.py ``` Python from datetime import datetime, timedelta, date, time from backports.datetime_fromisoformat import MonkeyPatch MonkeyPatch.patch_fromisoformat() ``` ======================================== Or uninstall Python 3.6 and try to use Python 3.8
Author
Owner

@Shadebzh commented on GitHub (Nov 25, 2021):

Thank you, it's working !

<!-- gh-comment-id:979359341 --> @Shadebzh commented on GitHub (Nov 25, 2021): Thank you, it's working !
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SECMON#26
No description provided.