Notifications Error

On one of my Ubuntu machines running the latest version of Librenms, and no issues on the validate process.
However, under the user logged on, there are 4 new Notifications pending. When I click on the Notifications link to see the messages, instead of seeing the notifications I get an new screen with an error message:

" Whoops, looks like something went wrong. Check your librenms.log."

And in the librenms.log, I see the following:

[2025-02-05T20:51:10][ERROR] SQLSTATE[42S22]: Column not found: 1054 Unknown column 'notifications.notifiable_type' in 'where clause' (Connection: mysql, SQL: select count(*) as aggregate from `notifications` where `notifications`.`notifiable_type` = App\Models\User and `notifications`.`notifiable_id` = 1 and `notifications`.`notifiable_id` is not null) {"userId":1,"exception":"[object] (Illuminate\\Database\\QueryException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'notifications.notifiable_type' in 'where clause' (Connection: mysql, SQL: select count(*) as aggregate from `notifications` where `notifications`.`notifiable_type` = App\\Models\\User and `notifications`.`notifiable_id` = 1 and `notifications`.`notifiable_id` is not null) at /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php:829)
[previous exception] [object] (PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'notifications.notifiable_type' in 'where clause' at /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php:423)"}

Any ideas on how to fix this issue? I have another machine with the exact same setup and it does not have the same problem.

Thanks.

Can you post your version and schema information from ./validate.php on the command line?

I’m on this today:

Component | Version
--------- | -------
LibreNMS  | 21.5.1-2989-ge6c200b4a (2025-02-05T16:12:30+08:00)
DB Schema | 2025_01_30_000121_add_ifindex_index_to_ports_table (314)

and I can’t find any reference to that notifiable_type column in my database, any of the database migrations, or any of the code base!

Maybe you updated the code base manually without applying the schema changes.

Run validate.php as has been mentioned but you can also just do php artisan migrate

Here’s what I have…

librenms@LibreNMS:~$ ./validate.php
Cannot load Zend OPcache - it was already loaded
Cannot load Zend OPcache - it was already loaded
Cannot load Zend OPcache - it was already loaded
===========================================
Component | Version
--------- | -------
LibreNMS  | 25.1.0-91-g9c9948843 (2025-02-06T13:42:13+00:00)
DB Schema | 2025_01_30_000121_add_ifindex_index_to_ports_table (314)
PHP       | 8.3.11
Python    | 3.12.7
Database  | MariaDB 11.4.3-MariaDB-1
RRDTool   | 1.7.2
SNMP      | 5.9.4.pre2
===========================================

[OK]    Composer Version: 2.8.5
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[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
Cannot load Zend OPcache - it was already loaded
Cannot load Zend OPcache - it was already loaded
Cannot load Zend OPcache - it was already loaded
Cannot load Zend OPcache - it was already loaded
Cannot load Zend OPcache - it was already loaded
Cannot load Zend OPcache - it was already loaded
Cannot load Zend OPcache - it was already loaded
Cannot load Zend OPcache - it was already loaded
Cannot load Zend OPcache - it was already loaded
Cannot load Zend OPcache - it was already loaded
[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
librenms@LibreNMS:~$

Just to be clear, I have not done any manual updates… The system just runs on its own, much like the other similar system which does not have this error.

I just tried the php artisan migrate and the result was nothing to migrate

Any other ideas?

Interesting… when I ssh’ed into the system (ubuntu VM), there was a message saying a restart was pending… so, I rebooted the system.

Once the system came back up again, the Librenms Notifications are now working properly…

So, not sure what pending changes necessitated a system reboot, but all is well now.

Thank you for the assist…