fritzinfluxdb icon indicating copy to clipboard operation
fritzinfluxdb copied to clipboard

error writing to influxdb v1 - lan_totalbytesreceived - value out of range

Open rguenther-dz opened this issue 11 months ago • 10 comments

The value lan_totalbytesreceived has an overflow

After a few days running the docker version of fritzinfluxdb i get the following errors. - lan_totalbytesreceived -> value out of range

Container log:

INFO: Starting fritzinfluxdb v1.2.4 (2024-10-15)
INFO: Successfully parsed config
INFO: Connection to InfluxDB v1.11.8 established and database present
INFO: Successfully established FritzBox TR-069 session
INFO: Successfully established FritzBox Lua session
INFO: Successfully connected to FritzBox 'XXXXXXX' (XXX) Model: FRITZ!Box 7530 AX (Ethernet) - FW: 8.2
INFO: Starting main loop
INFO: Service 'DSL Info (Fritz!OS 7.29 - latest)' not applicable for this FritzBox Model Link type 'Ethernet'
INFO: Service 'Cable Info (Fritz!OS 7.29 - latest)' not applicable for this FritzBox Model Link type 'Ethernet'
INFO: Service 'Cable Channel Info (Fritz!OS 7.58 - latest)' not applicable for this FritzBox Model Link type 'Ethernet'

ERROR: Failed to write to InfluxDB 'influxdb': 400: {"error":"partial write: unable to parse 'fritzbox_value,box=XXX lan_totalbytesreceived=18446744064130749557i 1743015002000000': unable to parse integer 18446744064130749557: strconv.ParseInt: parsing \"18446744064130749557\": value out of range dropped=0"}
ERROR: Failed to write to InfluxDB 'influxdb': 400: {"error":"partial write: unable to parse 'fritzbox_value,box=XXX lan_totalbytesreceived=18446744064130749557i 1743015002000000': unable to parse integer 18446744064130749557: strconv.ParseInt: parsing \"18446744064130749557\": value out of range dropped=0"}
ERROR: Failed to write to InfluxDB 'influxdb': 400: {"error":"partial write: unable to parse 'fritzbox_value,box=XXX lan_totalbytesreceived=18446744064130749557i 1743015002000000': unable to parse integer 18446744064130749557: strconv.ParseInt: parsing \"18446744064130749557\": value out of range dropped=0"}
ERROR: Failed to write to InfluxDB 'influxdb': 400: {"error":"partial write: unable to parse 'fritzbox_value,box=XXX lan_totalbytesreceived=18446744064130749557i 1743015002000000': unable to parse integer 18446744064130749557: strconv.ParseInt: parsing \"18446744064130749557\": value out of range\nunable to parse 'fritzbox_value,box=dgn lan_totalbytesreceived=18446744064130795461i 1743015013000000': unable to parse integer 18446744064130795461: strconv.ParseInt: parsing \"18446744064130795461\": value out of range dropped=0"}
ERROR: Failed to write to InfluxDB 'influxdb': 400: {"error":"partial write: unable to parse 'fritzbox_value,box=XXX lan_totalbytesreceived=18446744064130749557i 1743015002000000': unable to parse integer 18446744064130749557: strconv.ParseInt: parsing \"18446744064130749557\": value out of range\nunable to parse 'fritzbox_value,box=dgn lan_totalbytesreceived=18446744064130795461i 1743015013000000': unable to parse integer 18446744064130795461: strconv.ParseInt: parsing \"18446744064130795461\": value out of range dropped=0"}
ERROR: Failed to write to InfluxDB 'influxdb': 400: {"error":"partial write: unable to parse 'fritzbox_value,box=XXX lan_totalbytesreceived=18446744064130749557i 1743015002000000': unable to parse integer 18446744064130749557: strconv.ParseInt: parsing \"18446744064130749557\": value out of range\nunable to parse 'fritzbox_value,box=dgn lan_totalbytesreceived=18446744064130795461i 1743015013000000': unable to parse integer 18446744064130795461: strconv.ParseInt: parsing \"18446744064130795461\": value out of range\nunable to parse 'fritzbox_value,box=dgn lan_totalbytesreceived=18446744064130854638i 1743015024000000': unable to parse integer 18446744064130854638: strconv.ParseInt: parsing \"18446744064130854638\": value out of range dropped=0"}

Configuration:

  • Image: bbricardo/fritzinfluxdb:latest
  • Fritzbox: FRITZ!Box 7530 AX (Ethernet)
  • Fritzbox Firmware: 8.2
  • Internet connection: via WAN Port
  • InfluxDB: v1.11.8

rguenther-dz avatar Mar 27 '25 09:03 rguenther-dz

Hi @rguenther-dz,

it seems you hit the max Influx value for integer values: https://docs.influxdata.com/flux/v0/data-types/basic/uint/

bb-Ricardo avatar Mar 27 '25 10:03 bb-Ricardo

Hi @bb-Ricardo, thanks for the fast response.

yes, the error message says it´s an overflow. But it looks like the root cause is inside fritzinfluxdb.

Restarting fritzinfluxdb resets the error for e.g 5 days. During this time, the fritzbox is untouched. Internet traffic is very low around 40,000,000,000 bytes, compared to the value of lan_totalbytesreceived during this time. This looks like, that the value lan_totalbytesreceived is not directly received from the fritzbox. It is calculated by fritzinfluxdb in some way.

The picture shows the historic values of lan_totalbytesreceived stored in influxdb during this time. On 03/26 19:54 the error occurs. On 03/27 10:36 fritzinfluxdb docker container is restarted.

Image

rguenther-dz avatar Mar 27 '25 20:03 rguenther-dz

Hi,

You can try running it in debug mode. Then you should see which values are collected and sent to influx.

bb-Ricardo avatar Mar 27 '25 20:03 bb-Ricardo

ok. now running in debug mode .. The values correlate to what we see in the grafana panel.

Now waiting maybe some days to catch the next error... This looks not easy.

2025-03-27 23:21:25,339 - DEBUG: Request FritzBox TR-069 service 'LANEthernetInterfaceConfig:1' returned successfully: GetStatistics 2025-03-27 23:21:25,339 - DEBUG: FritzBox TR-069 result: NewBytesSent = 59492973417 2025-03-27 23:21:25,339 - DEBUG: FritzBox TR-069 result: NewBytesReceived = 62522116132 ... 2025-03-27 23:21:25,340 - DEBUG: 2025-03-27 22:21:25+00:00: lan_totalbytesreceived=62522116132 ({'box': 'dgn'})

rguenther-dz avatar Mar 27 '25 22:03 rguenther-dz

we have the next event.. the incorrect values are also present in the debug output of the TR-069 info.

Image

and we see this is not an overflow, its an underflow.

Image

the value of totalbytesreceived should always increase, but at random points we see a decrease of the value. At 2025-04-12 18:00 we have an underflow with wrap around.

Restarting fritzinfluxdb without touching the fritzbox resets the error.

rguenther-dz avatar Apr 13 '25 13:04 rguenther-dz

Hi,

Did you get the error message again? Did you see any error messages which correlate with the jumps in the diagram?

bb-Ricardo avatar Apr 13 '25 21:04 bb-Ricardo

During the underflow i get the error message. The error messages are concatenated like in the first post, until the string gets too long and the fritzinfluxdb docker container dies.

For error messages that correlate with the jumps, i need to recheck. Because of the amount of data, i don't have the full logs and can only go back a view hours...

rguenther-dz avatar Apr 14 '25 05:04 rguenther-dz

Unfortunately just descring the problem makes it quite difficult to grasp the where the actual problem comes from. If the value is passed on (1:1) from the Fritzbox output to influxdb then I'm currently struggling to understand how to solve it in fritzinfluxdb. Or is the value not the issue and just the error logging which seems broken.

bb-Ricardo avatar Apr 14 '25 08:04 bb-Ricardo

Good evening, I have the same issue with InfluxDB v2. I just enabled the debug log and right now it is running again. :/ Can I let the container run with the debug enabled until the value out of range issue appears again or is it not helpful for you?

``

MisterHighping avatar Jun 24 '25 16:06 MisterHighping

Hi, you can try it with debug output to see when it appears. I also believe, restarting the FritzBox should solve the issue until the counter reaches the upper limit.

bb-Ricardo avatar Jun 24 '25 17:06 bb-Ricardo