Slim Application Error - DIVISION BY ZERO

Before posting something, READ the changelog, WATCH the videos, howto and provide following:
Your install is: Bare metal, ESXi, what CPU model, RAM, HD, what EVE version you have, output of the uname -a and any other info that might help us faster.

Moderator: mike

Post Reply
chlebowsking
Posts: 3
Joined: Mon Jun 12, 2017 1:41 pm

Slim Application Error - DIVISION BY ZERO

Post by chlebowsking » Mon Jun 12, 2017 10:32 pm

Hi,

I am struggling little bit with the status of the system. I am not able to check it at all .
I am getting the following :

Slim Application Error

The application could not run because of the following error:
Details
Type: ErrorException
Code: 2
Message: Division by zero
File: /opt/unetlab/html/includes/api_status.php
Line: 113
Trace

#0 /opt/unetlab/html/includes/api_status.php(113): Slim\Slim::handleErrors(2, 'Division by zer...', '/opt/unetlab/ht...', 113, Array)
#1 /opt/unetlab/html/api.php(236): apiGetSwapUsage()
#2 [internal function]: {closure}()
#3 /opt/unetlab/html/includes/Slim/Route.php(468): call_user_func_array(Object(Closure), Array)
#4 /opt/unetlab/html/includes/Slim/Slim.php(1357): Slim\Route->dispatch()
#5 /opt/unetlab/html/includes/Slim/Middleware/Flash.php(85): Slim\Slim->call()
#6 /opt/unetlab/html/includes/Slim/Middleware/MethodOverride.php(92): Slim\Middleware\Flash->call()
#7 /opt/unetlab/html/includes/Slim/Middleware/PrettyExceptions.php(67): Slim\Middleware\MethodOverride->call()
#8 /opt/unetlab/html/includes/Slim/Slim.php(1302): Slim\Middleware\PrettyExceptions->call()
#9 /opt/unetlab/html/api.php(1339): Slim\Slim->run()
#10 {main}


Any ideas?

ecze
Posts: 533
Joined: Wed Mar 15, 2017 1:54 pm

Re: Slim Application Error - DIVISION BY ZERO

Post by ecze » Mon Jun 12, 2017 10:39 pm

You did a custom installation ?
This error occurs due to lack of swap partition....

in /opt/unetlab/html/include/api_node.php

replace line 113:
from:

return 100 - round($used / $total * 100) ;

to:

return ( $total != 0 ) ? 100 - round($used / $total * 100) : 0 ;

E.

chlebowsking
Posts: 3
Joined: Mon Jun 12, 2017 1:41 pm

Re: Slim Application Error - DIVISION BY ZERO

Post by chlebowsking » Tue Jun 13, 2017 1:47 pm

Fixed!!!!!
Thanks a lot!
:P :P :P :P

Post Reply