Billing error update from 7.4 to 8.1

Hi community
i gave probles ufter update php

If you go into billing, all ports are gone

if you log in through the device, an error occurs
Whoops, looks like something went wrong. Check your librenms.log.

====================================

Component Version
LibreNMS 22.7.0-47-ge9211d93c
DB Schema 2022_07_03_1947_add_app_data (244)
PHP 8.1.8
Python 3.8.10
Database MariaDB 10.3.34-MariaDB-0ubuntu0.20.04.1
RRDTool 1.7.2
SNMP 5.8
====================================

[OK] Composer Version: 2.3.10
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database Schema is current
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK]
[OK] Database schema correct
[OK] MySQl and PHP time match
[OK] Active pollers found
[OK] Dispatcher Service not detected
[OK] Locks are functional
[OK] Python poller wrapper is polling
[OK] Redis is unavailable
[OK] rrd_dir is writable
[OK] rrdtool version ok

librenms.log

[2022-08-07T11:16:37.425053+03:00] production.ERROR: Division by zero {"userId":1,"exception":"[object] (DivisionByZeroError(code: 0): Division by zero at /opt/librenms/includes/html/pages/bill.inc.php:183)>
[2022-08-07T11:16:40.638585+03:00] production.ERROR: Division by zero {"userId":1,"exception":"[object] (DivisionByZeroError(code: 0): Division by zero at /opt/librenms/includes/html/pages/bill.inc.php:183)>
[2022-08-07T11:16:51.644823+03:00] production.ERROR: Division by zero {"userId":1,"exception":"[object] (DivisionByZeroError(code: 0): Division by zero at /opt/librenms/includes/html/table/bills.inc.php:109>
[2022-08-07T11:16:57.159244+03:00] production.ERROR: Division by zero {"userId":1,"exception":"[object] (DivisionByZeroError(code: 0): Division by zero at /opt/librenms/includes/html/pages/bill/transfer.inc>
[2022-08-07T11:17:13.004269+03:00] production.ERROR: Division by zero {"userId":1,"exception":"[object] (DivisionByZeroError(code: 0): Division by zero at /opt/librenms/includes/html/pages/bill/transfer.inc>
[2022-08-07T11:17:16.282972+03:00] production.ERROR: Division by zero {"userId":1,"exception":"[object] (DivisionByZeroError(code: 0): Division by zero at /opt/librenms/includes/html/pages/bill.inc.php:183)>
[2022-08-07T11:17:17.672243+03:00] production.ERROR: Division by zero {"userId":1,"exception":"[object] (DivisionByZeroError(code: 0): Division by zero at /opt/librenms/includes/html/pages/bill.inc.php:183)>
[2022-08-07T11:17:47.326541+03:00] production.ERROR: Division by zero {"userId":1,"exception":"[object] (DivisionByZeroError(code: 0): Division by zero at /opt/librenms/includes/html/table/bills.inc.php:109>
[2022-08-07T11:17:52.706010+03:00] production.ERROR: Division by zero {"userId":1,"exception":"[object] (DivisionByZeroError(code: 0): Division by zero at /opt/librenms/includes/html/pages/bill.inc.php:183)>
/opt/librenms/discovery.php new 2022-08-07 11:20:01 - 0 devices discovered in 0.002 secs

While it shouldn’t error out ofc, this is due to you having a bad bill setup, ie setting quote or cdr to 0

Same problem here but with the API:

curl -H ‘X-Auth-Token: x’ “http://nms.x.net/api/v0/bills/436/graphs/bits
{
“message”: “Server Error: Set APP_DEBUG=true to see details.”
}

librenms.log:

022-11-01T19:18:17.532683+01:00] production.ERROR: Division by zero {“userId”:1,“exception”:“[object] (DivisionByZeroError(code: 0): Division by zero at /opt/librenms/includes/billing.php:195)”}

CDR is set to 10:

This is a new created billing for testing.

LibreNMS version: [
22.10.0-49-gf4860ac - Tue Nov 01 2022 16:51:01 GMT+0100]