• Support
  • The error for Debian aaPanel

Greetings! I installed the panel for my Debian VPS. I saw the error report about"ZeroDivisionError: float division by zero" when I first open the panel. I tried to fix it via the fix button on home, but it looks like not working. The question is still but I don't know what to do it.

Traceback (most recent call last):
File "/www/server/panel/BTPanel/init.py", line 1628, in publicObject
return run_exec().run(toObject, defs, get)
File "/www/server/panel/BTPanel/init.py", line 1576, in run
result = getattr(toObject,get.action)(get)
File "class/system.py", line 592, in GetNetWork
networkInfo['network'][net_key]['up'] = round(float(networkIo[0] - up) / 1024 / (ntime - otime),2)
ZeroDivisionError: float division by zero

That's Error Report.
Waiting for your reply and thanks!

    Suzerain
    Hello, can you provide detailed information: what system version, what architecture, what is the version of aapanel, which installation command was used

      Suzerain
      Hi, what else did you do? I have installed and tested it here and it has not reproduced. Try to execute the installation command directly to overwrite the installation once to see if there is still a problem?

        a month later

        Suzerain ZeroDivisionError: float division by zero

        The super class of ZeroDivisionError is ArithmeticError. This exception raised when the second argument of a division or modulo operation is zero. In Mathematics, when a number is divided by a zero, the result is an infinite number. It is impossible to write an Infinite number physically. Python interpreter throws “ZeroDivisionError: division by zero” error if the result is infinite number. While implementing any program logic and there is division operation make sure always handle ArithmeticError or ZeroDivisionError so that program will not terminate.

        try:
            z = x / y
        except ZeroDivisionError:
            z = 0

        Or check before you do the division:

        if y == 0:
            z = 0
        else:
            z = x / y

        The latter can be reduced to:

        z = 0 if y == 0 else (x / y)

          5 days later

          Suzerain
          Hi, can you give us your aapanel information? The server makes a snapshot backup first, if possible, please send it to kern@aapanel.com.
          It is recommended to fill in the following
          Post link:
          SSH IP address, account password and port:
          aapanel login link address and account password:

          10 months later

          Hi, ZeroDivisionError: float division by zero showing such an error. How to decide?

            Connect with us: 📨 Telegram 💬 Discord Email: support@aapanel.com