Strange Swap Problem

What type of hardware are you using: VPS bought online
What YunoHost version are you running: 12.1.32
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 added a SWAP Partition

Describe your issue

Been researching this for days and can’t find a solution. I appreciate any help you can give.

So, I ran into RAM and storage issues, as one does on a low-cost VPS. (Started on 1gb/10gb). I upgraded my plan and had to reconfigure Yunohost for a bigger HDD. I now have 2gb/80gb. At the time, I thought I’d get clever and cut out 2gb as a handy little SWAP partition. Now I have the strangest thing. Debian through SHH using the swapon --show command shows:

“/dev/vda2 partition 1.9G 437.1M -2”

Clear as day, the swap is showing and is even in use. This is after a reboot too, so obviously I did the fstab thing correctly. Ran lsblk too, and is says:

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
vda 254:0 0 80G 0 disk
├─vda1 254:1 0 78.1G 0 part /
└─vda2 254:2 0 1.9G 0 part [SWAP]

However, Yunohost has other ideas. The diagnosis page is barking:

“The system has only 35 MiB (1.8%) RAM available! (out of 1.9 GiB)”

and

“The system has no swap at all. You should consider adding at least 512 MiB of swap to avoid situations where the system runs out of memory.”

One thing I did note is, Yunohost only shows /dev/vda1. Is it possible the SWAP issue is actually a HDD mounting issue? If so, how do I tell Yunohost that there’s a second HDD/Partition? Shouldn’t Yunohost already know that? I mean, Debian does. And how on Earth do I tell Yunohost that it has SWAP to play with?

Thank you for your time.
Damien.

Share relevant logs or error messages

https://paste.yunohost.org/raw/enihixavax

Also, it should be noted that running the “top” command on ssh only shows an aggregate memory usage of roughly 15%. Math isn’t my strong point, but last time I checked 15% of 1.9gb doesn’t work out to over 1.85gb.

If you mean “Yunohost only shows /dev/vda1 in that part of the diagnosis page”, it’s normal behaviour. My instances report RAM and Swap usage accurately, and the swap partition/disk is not shown here.

In my case, the free memory reported by Yunohost is equal to total-used as reported by top.

Yes, only the 1st (primary) partition shows up in yunohost diagnosis. The experimental hard drives section in the web admin only shows the single 80gb virtual disk, no partitions.

I just noticed on that diagnosis that the system resource section was from 3 days ago, while all other sections refreshed just now. Then I found a bunch of python errors under “Diagnosis failed for category ‘systemresources’” in the detailed report. I hardly know what I’m looking at here. Any ideas?

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 201, in analyzed_kern_log
date = datetime.datetime.strptime(date_str, “%Y %b %d %H:%M:%S”)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/_strptime.py”, line 568, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/_strptime.py”, line 349, in _strptime
raise ValueError(“time data %r does not match format %r” %
ValueError: time data ‘2025 2025-10-28T05:29:47.482944+10:00 calsynctwo kernel:’ does not match format ‘%Y %b %d %H:%M:%S’

OK, the oddness continues. So this morning I’m trying to fix my heascale/adguard set up and just ran a diagnosis again to check services etc.. Guess what? The System Resources now shows the correct values, including decent RAM usage and 1.9gb of SWAP. So, it magically fixed itself and all those python errors just went away by themselves? I am somewhat mystified.

The underlying problem was fixed, will be available in the next release.

Meanwhile, this diagnosis only parses 10k last lines in kern.log, so the offending line likely fell out of context window hence you’re not getting an error anymore.

Still, glad you powered through these obstacles!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.