I ran into a strange issue. When I opened the LibreNMS web interface, all the graphs under “Top 20 interfaces polled within 15 minutes” had disappeared.
I ran ./validate.php to check what was going on, and it told me to run lnms migrate. I did that, the migration finished without errors, and now validate.php says the schema is up to date.
But even after that, I keep getting the same warning about this column:
[OK] Composer Version: 2.9.2
[OK] Dependencies up-to-date.
[OK] Database Connected
[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
[FAIL] We have detected that your database schema may be wrong
Database: incorrect column (device_stats/ping_last_timestamp)
[FIX]:
Run the following SQL statements to fix it
SQL Statements:
ALTER TABLE device_stats CHANGE ping_last_timestampping_last_timestamp timestamp NOT NULL ;
Attempt to fix this issue (y or n)?:y
Attempted to apply fix.
[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
I also checked the table:
SHOW CREATE TABLE device_stats\G
It shows:
ping_last_timestamp timestamp NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
Running the suggested ALTER command doesn’t change anything. The warning always comes back.
The poller is working normally and it updates the timestamp without errors. Everything else seems fine.
Is this a false warning on the dev branch, or is something actually wrong?
Facing the same issue after the latest update graphs created for monitoring the traffic of my network now the traffic is empty in my graph. how to fix this.
Seeing the same. Following the fixes seem to do nothing. All graphs stopped. and it just repeats that the schema is wrong. Have done a daily.sh as well.
Clearing caches OK
Updating to latest codebase OK
Updating Composer packages OK
Updating SQL-Schema FAIL
INFO Running migrations.
2025_05_28_092148_create_device_stats ................................................................................................ 5.68ms FAIL
In Connection.php line 824:
SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'ping_last_timestamp' (Connection: mysql, SQL: create table `device_stats` (`id` bigint unsigned
not null auto_increment primary key, `created_at` timestamp null, `updated_at` timestamp null, `device_id` int unsigned not null, `ping_last_timestamp` timestamp not null, `ping_r
tt_last` float(53) unsigned null, `ping_rtt_prev` float(53) unsigned null, `ping_rtt_avg` float(53) unsigned null, `ping_rtt_diff_avg_last` float(53) as (ping_rtt_last - ping_rtt_
avg), `ping_rtt_diff_prev_last` float(53) as (ping_rtt_last - ping_rtt_prev), `ping_loss_last` float(53) unsigned null, `ping_loss_prev` float(53) unsigned null, `ping_loss_avg` f
loat(53) unsigned null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')
In Connection.php line 570:
SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'ping_last_timestamp'
Updating submodules OK
Cleaning up DB OK
Fetching notifications OK
Caching PeeringDB data OK
But did you run ./validate.php on the CLI (ssh) and followed the steps?
For example, the first time I ran ./validate.php, it suggested the ./lnms migrate
[OK] Composer Version: 2.9.2
[OK] Dependencies up-to-date.
[OK] Database Connected
[FAIL] Your database is out of date!
[FIX]:
./lnms migrate
Attempt to fix this issue (y or n)?:y
Attempted to apply fix.
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[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
After that, the graphs were being filled again, but, every time I validate, the incorrect column (device_stats/ping_last_timestamp) error always appears (I already checked the DB, and it’s OK):
[OK] Composer Version: 2.9.2
[OK] Dependencies up-to-date.
[OK] Database Connected
[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
[FAIL] We have detected that your database schema may be wrong
Database: incorrect column (device_stats/ping_last_timestamp)
[FIX]:
Run the following SQL statements to fix it
SQL Statements:
ALTER TABLE device_stats CHANGE ping_last_timestampping_last_timestamp timestamp NOT NULL ;
Attempt to fix this issue (y or n)?:y
Attempted to apply fix.
[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
The graphs have a gap (the time between when the ./daily was executed and the ./lnms migrate):
Partially fixed by manually running ./validate.php on console:
(Graphs and RRD are now updated and no errors in poller log)
Validate fix
$ ./validate.php
...
[OK] Composer Version: 2.9.1
[OK] Dependencies up-to-date.
[OK] Database Connected
[FAIL] Your database is out of date!
[FIX]:
./lnms migrate
Attempt to fix this issue (y or n)?:y
Attempted to apply fix.
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[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
But it still gives this error on validation that is not fixed:
(not sure what the impact is..)
Validate 2nd run
$ ./validate.php
...
[OK] Composer Version: 2.9.1
[OK] Dependencies up-to-date.
[OK] Database Connected
[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
[FAIL] We have detected that your database schema may be wrong
Database: incorrect column (device_stats/ping_last_timestamp)
[FIX]:
Run the following SQL statements to fix it
SQL Statements:
ALTER TABLE `device_stats` CHANGE `ping_last_timestamp` `ping_last_timestamp` timestamp NOT NULL ;
Attempt to fix this issue (y or n)?:y
Attempted to apply fix.
[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
Running suggested DB fix does not update any records:
[OK] Composer Version: 2.9.2
[OK] Dependencies up-to-date.
[OK] Database Connected
[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
[FAIL] We have detected that your database schema may be wrong
Database: incorrect column (device_stats/ping_last_timestamp)
[FIX]:
Run the following SQL statements to fix it
SQL Statements:
ALTER TABLE device_stats CHANGE ping_last_timestampping_last_timestamp timestamp NOT NULL ;
Attempt to fix this issue (y or n)?:y
Attempted to apply fix.
[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 functional
[OK] rrd_dir is writable
[OK] rrdtool version ok
Running ./validate.php on the CLI fixes the RRD/poller issue, and the graphs start updating again.
The only thing that stays is the schema warning for:
device_stats/ping_last_timestamp
When I run the suggested ALTER manually, I also get:
Query OK, 0 rows affected
I think that happens because the column is already timestamp NOT NULL, so MariaDB doesn’t actually change anything. It just keeps the default value (0000-00-00 00:00:00), and because of that the validator keeps reporting it on every run.
Poller is updating that field fine on my side, so I think this might be a validator false positive on the dev branch rather than a real schema issue.
Same issue here. Do we simply follow the ./validate.php auto fixes? or will this make it worse?
[FAIL] Your database is out of date! [FIX]: ./lnms migrate Attempt to fix this issue (y or n)?:y Attempted to apply fix.
Now:
[FAIL] We have detected that your database schema may be wrong Database: incorrect column (device_stats/ping_last_timestamp) [FIX]: Run the following SQL statements to fix it SQL Statements: ALTER TABLE device_stats CHANGE ping_last_timestamp ping_last_timestamp timestamp NOT NULL ; Attempt to fix this issue (y or n)?:
I’m seeing this exact issue as well. Same error about the database being out of date. The graphs stopped getting data at exactly midnight. Applying the fixes suggested by validate.php did not help.
I’ve seen the same issue too. After running lnms migrate from the validate script, it prompts the same Database: incorrect column (device_stats/ping_last_timestamp) issue. I told the validate script to attempt the fix, and the pollers now seem to be working correctly, even though the validate script still flags the same issue.
Jus wanted to chime in and confirm this impacted us too. Please advise. Same results as others and manually applying the queries from ./validate.php did not help. Thanks!