easyengine icon indicating copy to clipboard operation
easyengine copied to clipboard

Runtime error when running ee system status

Open coreyallen opened this issue 12 years ago • 5 comments

When running ee system status I just had the following error: Runtime error (func=(main), adr=9): Divide by zero

screenshot http://d.pr/i/2hKl/q5TFcL0j

coreyallen avatar May 04 '14 03:05 coreyallen

I just noticed this issue as well. System is freshly updated..

Ubuntu 14.04 LTS easyengine version: 1.3.7

EranSch avatar May 04 '14 12:05 EranSch

I too get this error ever since the function was introduced. I'll bet that it has to do with the fact that a swap file is not being used on the system.

SWAP_USAGE=$(echo "$SWAP_USED*100/$SWAP_TOTAL" | bc -l | cut -d'.' -f1)

w33zy avatar May 04 '14 14:05 w33zy

That's exactly what it is.

In my case, EasyEngine is running on an OpenVZ VPS and therefore has no swap partition. As the script assumes swap exists, the error occurs when it attempts to calculate the available percentage... 0*100/0. Not really a big deal but went ahead and made a pull request anyway.

https://github.com/rtCamp/easyengine/pull/225 : Don't caclulate swap if none exists

screen shot 2014-05-04 at 3 10 32 pm

EranSch avatar May 04 '14 19:05 EranSch

Are there any special benefits to having a swap file?

coreyallen avatar May 04 '14 19:05 coreyallen

@coreyallen,

A swap file or partition is a place for the operating system to offload data from RAM during instances when it needs more memory. This can good or bad depending on how well the system is configured for the particular situation. A well configured system could really maximize its resources by leveraging swap. Alternatively, a poorly configured system may waste valuable time transferring data back and forth between RAM and disk... overloading it further.

Evidently, it's not uncommon for OpenVZ VPS providers to disable swap on their VMs as it causes increased I/O consumption. I would imagine that they justify this by offering burst-able RAM, wherein your system gets a temporary increase in RAM during times of high load.

TL;DR Probably. If you know what you're doing :smiley:

EranSch avatar May 04 '14 19:05 EranSch