RAM Server Info wrong and related logged errors

I have installed from the last version of nextcloud 9x and updated to the other day’s 10.0 stable. My environment is as such:

(Basically this is a regular VPS install, only the production server is onsite…)

Hardware Node CentOS 6.8 using up to date OpenVZ stable kernel.
Installed NextCloud entirely from source in its own OpenVZ container running CentOS 6.8 minimal install.

I keep getting errors in the log that read:
Error PHP Undefined index: MemAvailable at /var/www/html/nextcloud/apps/serverinfo/lib/SystemStatistics.php#85

This is something new that came with version 10. I can likely provide all the info you need to tell me what is going wrong and I am guessing it is not really entirely NextCloud’s fault. In the Server Info section that reads out CPU, RAM and other metrics, the RAM is wrong. This container has a giant 4GB of RAM allotted to it, but if I look at the meter I notice it is not displaying correctly. And instead reads:

Total: 12.0 GB - Current usage: 4.0 GB

Both are incorrect. NextCloud surely is not using 4.0GB of RAM! And while this server has 32GB of RAM total I am pretty sure more is reserved from other containers/VM’s that could not make the upper ceiling of 12GB as a maximum available. In OpenVZ, there are ways to steal RAM from other containers, but that stuff is disabled. All containers have 4GB assigned each - let’s see times three containers and the HW node being assigned 4GB as well, that would mean 16GB of RAM could possibly be tied up, no more, no less.

I think the error I am seeing from looking at that file is being induced by the nature of the OpenVZ kernel, but cannot really find any good data on how that part of the OpenVZ container and kernel poll the RAM.

Is anyone else seeing this in a Centos 6.8 OpenVZ container install - or any other install scenarios or is this bug isolated to me? I want to send thanks to the developers working hard on the NextCloud project - something I will be wanting to contribute to as well when things free up for me some.

Thanks in advance for any insight into this issue.

  • Douglas

I’m seeing this on a Ubuntu 14.04 server as well

I am sorry, is no one else seeing similar issues or is the community really this small for NextCloud?

For the “incorrect” RAM size, see:

This thread.

Thanks for the tag, but they have no solution in that thread and don’t at all list their actual install scenario like the OS install/install method. Just as someone copied in the bottom, I know what variable is causing that error generation but don’t have a fix for either that or the RAM values. Both incorrect recording of RAM and other metrics are handled in that file we know that much. I was hoping for a fix.

As we figured out in the other post, the calculation is base on this line of code:

what does cat /proc/meminfo in your virtual machine give you?

As I mentioned in the other thread - don’t believe it’s broken as they look to have included swap space intentionally; let me explain…

In their code they are doing a shell_exec with the command ‘awk -F" " ‘{ print $1 $2 }’ /proc/meminfo’ - if you run that command you’ll see that it produces a set of common system statistics seperated in a new line like this:

MemAvailable: 1000M
cpu_usage: 20%
somehting_else: 5

In their code they take that list and assign it to a string variable, then elsewhere they turn that string into a proper array by splitting on the colon character. Elsewhere they enumerate over the array and turn each pair i.e. MemAvailable | 1000M into it’s own variable i.e. $MemAvailable = 1000M.

So you now have a variable for each and every statistic produced from the shell command. Now they need to assign those variables to whatever variable is being pulled through to the interface - in this case mem_free, so:

‘mem_free’ => (int)$data[‘MemAvailable’] + (int)$data[‘SwapFree’],

So what they are doing there is they are getting the MemAvailible variable, casting it as an integer and then adding on SwapFree, which has also been cast as an integer; the cast is necessary because shell_exec would have just returned a string type.

In summary - they’ve absolutely done it deliberately and therefore is not a bug. If it bothers you, you can change:

‘mem_free’ => (int)$data[‘MemAvailable’] + (int)$data[‘SwapFree’],

to

‘mem_free’ => (int)$data[‘MemAvailable’],

[root@nextcloud /]# cat /proc/meminfo
MemTotal: 4194304 kB
MemFree: 3603448 kB
Cached: 349192 kB
Buffers: 0 kB
Active: 235240 kB
Inactive: 289464 kB
Active(anon): 154064 kB
Inactive(anon): 154252 kB
Active(file): 81176 kB
Inactive(file): 135212 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 8388608 kB
SwapFree: 8388608 kB
Dirty: 1036 kB
Writeback: 0 kB
AnonPages: 308316 kB
Shmem: 132804 kB
Slab: 66112 kB
SReclaimable: 41248 kB
SUnreclaim: 24864 kB

Yes I understand what you said and what is going on, my question was who would not regard this as a bug? It is desirable to readout both physical and swap RAM together but do so in such a manner it makes the labeling on the chart not even agree with what the PHP renders.

We have not discussed the fact that by just “looking” at the “Server Performance” page creates non-stop errors every time it polls the data. That IS a bug - and it all relates to what I as well as others have posted. Surely recording an error in the log twice every second when the chart data is polled is not by design/intensional.

So maybe I need to change gears.:

Would someone be able to help with the non-stop logging (at error level) one or two times a second when I view “Server Performance”

So it’s nothing specific to your system. If you want the swap space shown differently, join the other discussion, make a feature request on github.

I think I should post a bug report for the system constantly every time I just view the graphs that it does not generate and log errors each time it polls.

Then -->

Make a feature request for the data not to display incorrectly in the graphs. That is a legit bug too for the only way mixing physical and swap space together in a single chart which is what appears to be the intent, that it both displays on the graph the zero swap I am using and change the labeling of the chart as is its incorrect as well regardless of what is done or not done.

I am working a project right now, but will attempt to make these requests before tomorrow morning. Thanks.

  • Douglas

I would like that red window to leave.

@zeugmatis just to be clear, what error message are you reading? And are they at the top of “Admin>Security and Setup Warnings”?
'
I was able to work through all of those errors, but will say my install for whatever reason thinks really long and hard for a minute or more before displaying:

“All checks passed.”

I also see this error with a fresh install of NC10 on Ubuntu 14.04 / Apache. It shows up every time I visit the ‘Server info’ page. The Memory usage also shows that it is using all the memory on a 1024MB ram server. Command line on ubuntu shows ~350 however.
My config & memcache is set correctly I believe with this one line:
‘memcache.local’ => ‘\OC\Memcache\APCu’,

@cloud

This is the same behavior I have been commenting on as well. Since you are using Ubuntu and I am running CentOS, the likelihood this is a comprehensive bug on multiple platforms is highly suspect. (IE a code error.)

I am swamped here, but if the developers don’t find and fix this for us (at minimum the oodles of error records whenever one visits a “broken” server info page") I will look into debugging it. That’s the best I can offer and it is likely off a week or two.

1 Like

Feel free to let me know any steps I can repeat or look into my server configurations to help debug & note for github as well.

This discussion is a duplicate of:

with a correponding issue on github:

Closing here to avoid duplicate issues.

1 Like