Uploaded image for project: 'Observium'
  1. Observium
  2. OBS-3969

PHP error "Uncaught DivisionByZeroError: Division by zero" in Billing with CIDR at 0

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • None
    • Professional Edition
    • Default
    • PHP8.0

    Description

      The web interface for Billing ("Traffic Accouting") not working when we have customer(s) with billing method "CDR" but without assigned bandwith by seconds.

       

      AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught DivisionByZeroError: Division by zero in /opt/observium/21.12.11808/html/pages/bill/infoboxes.inc.php:58\nStack trace:\n#0 /opt/observium/21.12.11808/html/pages/bill.inc.php(139): include()\n#1 /opt/observium/21.12.11808/html/index.php(271): include('...')\n#2 {main}\n  thrown in /opt/observium/21.12.11808/html/pages/bill/infoboxes.inc.php on line 58'

       

      In old version (~6 months) with PHP7.3, the "0bps" worked with a "INF%" value in bar.
      Now I running 21.12.11808 with PHP8.0.

      This can be one usecase when we just want to graph without computing the 95% or calculate overusage. For example,  when an agreement is made with peer on a ratio (1:2) spread over several ports. Because "ratio" method (and overusage out of ratio) is not currently implemented, originaly I have configured with no CDR configured.

       

      I have temporary bypass the problem with assign "1" directly in database.
      Note : The webinterface not force/don't check for value and assign "0" in database if it's left blank.

      Attachments

        Activity

          People

            landy Mike Stupalov
            johann Johann Mallet
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: