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

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

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

          [OBS-3969] PHP error "Uncaught DivisionByZeroError: Division by zero" in Billing with CIDR at 0
          bot Observium Bot made changes -
          Status Original: Resolved [ 5 ] New: Closed [ 6 ]
          landy Mike Stupalov made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]
          landy Mike Stupalov made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          landy Mike Stupalov made changes -
          Labels Original: billing web New: billing php8 web
          landy Mike Stupalov made changes -
          Status Original: Pending Response [ 10000 ] New: Open [ 1 ]
          bot Observium Bot made changes -
          Component/s New: Default [ 10900 ]
          bot Observium Bot made changes -
          Assignee Original: Adam Armstrong [ adama ] New: Mike Stupalov [ landy ]
          bot Observium Bot made changes -
          Status Original: Open [ 1 ] New: Pending Response [ 10000 ]
          johann Johann Mallet created issue -

          People

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

            Dates

              Created:
              Updated:
              Resolved: