YunoHost / issues

General issue tracker for the YunoHost project
71 stars 8 forks source link

Can not view logs via YNH admin #2421

Closed MadMan247 closed 1 month ago

MadMan247 commented 1 month ago

Describe the bug

Navigating to the logs section of yunohost results in a 500 error, and logs are unable to be viewed through the webadmin. I got a similar error navigating to services, but it has only happened once and is not reproducible.

Context

To reproduce

Navigate to log area of yunohost admin.

Logs

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/moulinette/interfaces/api.py", line 450, in process
    ret = self.actionsmap.process(arguments, timeout=30, route=_route)
  File "/usr/lib/python3/dist-packages/moulinette/actionsmap.py", line 574, in process
    return func(**arguments)
  File "/usr/lib/python3/dist-packages/yunohost/log.py", line 138, in log_list
    logs = [
  File "/usr/lib/python3/dist-packages/yunohost/log.py", line 141, in <listcomp>
    if x.endswith(METADATA_FILE_EXT) and os.path.getctime(x) > one_year_ago
  File "/usr/lib/python3.9/genericpath.py", line 65, in getctime
    return os.stat(filename).st_ctime
FileNotFoundError: [Errno 2] No such file or directory: '20240424-000231-regen_conf-7_categories.yml'

image

kay0u commented 1 month ago

Should be fixed in the next release

MadMan247 commented 1 month ago

hello, please reopen. The issue persists.

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/moulinette/interfaces/api.py", line 450, in process
    ret = self.actionsmap.process(arguments, timeout=30, route=_route)
  File "/usr/lib/python3/dist-packages/moulinette/actionsmap.py", line 574, in process
    return func(**arguments)
  File "/usr/lib/python3/dist-packages/yunohost/log.py", line 135, in log_list
    _update_log_parent_symlinks()
  File "/usr/lib/python3/dist-packages/yunohost/log.py", line 90, in _update_log_parent_symlinks
    logs = glob.iglob("*" + METADATA_FILE_EXT, root_dir=OPERATIONS_PATH)
TypeError: iglob() got an unexpected keyword argument 'root_dir'

image

adlmr commented 1 month ago

I have the same issue. According to Python documentation : https://docs.python.org/3.12/library/glob.html root_dir was added in version 3.10. But my yunohost 11.2.22 (stable) is running Python 3.9.2

kay0u commented 1 month ago

Should be fixed now