WARNING: Use of uninitialized value $spages ?

moxfan

Active Member
Aug 28, 2013
104
7
38
Hi,

I've just installed PMG-5 in an openVZ container (PVE 3.4, the container template is debian stretch from openvz.org) and all seems to be working fine.

But, I am getting copious amounts of this error in the log files in /var/log/ .
Code:
WARNING: Use of uninitialized value $spages in int at /usr/share/perl5/PVE/ProcFSTools.pm line 212.
Checking that line:
Code:
root@pmg1:~# sed -n '212p' /usr/share/perl5/PVE/ProcFSTools.pm
    $res->{memshared} = int($spages) * 4096;
Will it be safe using PMG-5 regardless of those errors?

Thanks.

Note: Please don't keep advising me that I should be upgrading the PVE and using LXC. ;)
 
Last edited:
Note: Please don't keep advising me that I should be upgrading the PVE and using LXC. ;)

Seems you already knows the answer. OpenVZ on Proxmox VE is end of support.
 
I had this same error yesterday installing PMG v5 on a Linode Debian 9 virtual server. I got around it in the end by doing the following at around line 211.

#my $spages = PVE::Tools::file_read_firstline("/sys/kernel/mm/ksm/pages_sharing");
#$res->{memshared} = int($spages) * 4096;
$res->{memshared} = $res->{memtotal}+$res->{swaptotal};


Which seemed to get me further, though I can't guarantee it's a valid tweak. There is no /sys/kernel/mm/ksm directory present on these systems.