Strange traceback in diagnosis

What type of hardware are you using: Old laptop or computer
What YunoHost version are you running: 12.1.39
How are you able to access your server: The webadmin
Are you in a special context or did you perform specific tweaking on your YunoHost instance ?: I was looking up why nftables status is “unknown”

Describe your issue

I encounter a traceback error in diagnosis, i dont have a log of it. but i saw another posts about some similar the similar lines

DNS records diagnosis failed with traceback error (some occurences)
Strange Swap Problem - #5 by Damo (very last messages)

Mine look like that, and i’m not sure what i’m dealing with here:

Share relevant logs or error messages

Diagnosis failed for category 'systemresources':
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/yunohost/diagnosis.py", line 193, in diagnosis_run
code, report = diagnoser.diagnose(force=force)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/yunohost/diagnosis.py", line 443, in diagnose
items = list(self.run())
^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/yunohost/diagnosers/50-systemresources.py", line 173, in run
kills_count = self.recent_kills_by_oom_reaper()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/yunohost/diagnosers/50-systemresources.py", line 208, in recent_kills_by_oom_reaper
processes = list(analyzed_kern_log())
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/yunohost/diagnosers/50-systemresources.py", line 202, in analyzed_kern_log
diff = now - date
~~~~^~~~~~
TypeError: can't subtract offset-naive and offset-aware datetimes

Can you check date of your server and timezone?

here’s output i get

~$ timedatectl
Local time: lun. 2026-01-19 20:52:54 CET
Universal time: lun. 2026-01-19 19:52:54 UTC
RTC time: lun. 2026-01-19 19:52:54
Time zone: Europe/Paris (CET, +0100)
System clock synchronized: yes
NTP service: n/a
RTC in local TZ: no

and it is right according where the server is

Do you feel lucky today? (If that scares you that’s ok, what I’m asking below is messing with core YunoHost installation)

If so, can you sudo nano -w /usr/lib/python3/dist-packages/yunohost/diagnosers/50-systemresources.py, find the line now = datetime.datetime.now() and replace it with now = datetime.datetime.now(datetime.timezone.utc) ?

I’d test it locally but I don’t have a reproduction (requires certain line in kernel log) and I think I introduced this bug while fixing a previous issue in this area.

EDIT: also, you have to restart yunohost-api service afterwards

well!
I am lucky today then! It totally fixed that strange traceback.

Thanks a lot for looking that up :sparkling_heart:

1 Like

Proposed this fix upstream: Fixup date arithmetic in system diagnoser by orhtej2 · Pull Request #2261 · YunoHost/yunohost · GitHub