Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL error in Librenms.log ( Numeric value out of range: 1264 Out of range value for column 'availability_perc' at row 1) #15887

Open
geethreeforce opened this issue Mar 8, 2024 · 0 comments

Comments

@geethreeforce
Copy link

The problem

Description:
We've encountered a SQL exception when LibreNMS attempts to update the availability_perc column in the availability table. The error indicates that the value being updated (-3247.42) is out of range for the column. This issue prevents the successful update of availability percentages in certain cases, leading to potential inaccuracies in availability tracking and reporting.

Error:
SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'availability_perc' at row 1 (Connection: mysql, SQL: update availability set availability_perc = -3247.42 where availability_id = 332)

Potential Cause:
The error suggests that the data type or precision and scale of the availability_perc column does not support the range of values being inserted or updated, especially negative values or values with high precision.

Suggested Action:
It may be necessary to review and possibly adjust the data type, precision, and scale of the availability_perc column in the database schema to accommodate a wider range of values. Additionally, examining the logic that generates these values to ensure they are within expected bounds might be beneficial.

Output of ./validate.php

bash-4.4$ cd /opt/librenms/
bash-4.4$ ./validate.php
===========================================
Component | Version
--------- | -------
LibreNMS  | 24.2.0-20-gd7c31e0ae (2024-03-07T19:27:26+01:00)
DB Schema | 2024_02_07_151845_custom_map_additions (290)
PHP       | 8.2.7
Python    | 3.6.8
Database  | MariaDB 10.3.39-MariaDB
RRDTool   | 1.7.0
SNMP      | 5.8
===========================================

[OK]    Composer Version: 2.7.1
[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]    Database and column collations are correct
[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]    rrdtool version ok
[OK]    Connected to rrdcached

What was the last working version of LibreNMS?

24.2.0-20-gd7c31e0ae

Anything in the logs that might be useful for us?

#31 {main}
SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'availability_perc' at row 1 (Connection: mysql, SQL: update `availability` set `availability_perc` = -3247.42 where `availability_id` = 332) {"exception":"[object] (Illuminate\\Database\\QueryException(code: 22003): SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'availability_perc' at row 1 (Connection: mysql, SQL: update `availability` set `availability_perc` = -3247.42 where `availability_id` = 332) at /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php:829)
[previous exception] [object] (PDOException(code: 22003): SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'availability_perc' at row 1 at /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php:612)"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants