Error in log: Error discovering services module

Yes. I later found out that upgrading php didn’t actually cause librenms to fail, It’s actually a weathermap issue.

Current validate:

[[email protected] ~]$ ./validate.php

Component Version
LibreNMS 22.8.0-1-g465fa3986
DB Schema 2022_07_19_081224_plugins_unique_index (244)
PHP 8.1.9
Python 3.6.8
Database MariaDB 10.8.4-MariaDB
RRDTool 1.7.0
SNMP 5.8


[OK] Composer Version: 2.4.0
[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 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

1 Like

I can NOT confirm that the errors are gone with upgrading PHP:

Next Illuminate\Database\QueryException: SQLSTATE[HY093]: Invalid parameter number (SQL: select * from `devices` where `devices`.`device_id` not in (select `device_id` from `service_templates_device` where `service_template_id` = 1) and `devices`.`device_id` not in (select `device_id` from `device_group_device` where `device_group_id` = ?)) in /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php:712
Stack trace:
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(672): Illuminate\Database\Connection->runQueryCallback()
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(376): Illuminate\Database\Connection->run()
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2414): Illuminate\Database\Connection->select()
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2402): Illuminate\Database\Query\Builder->runSelect()
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2936): Illuminate\Database\Query\Builder->Illuminate\Database\Query\{closure}()
#5 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2403): Illuminate\Database\Query\Builder->onceWithColumns()
#6 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(625): Illuminate\Database\Query\Builder->get()
#7 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(609): Illuminate\Database\Eloquent\Builder->getModels()
#8 /opt/librenms/app/Http/Controllers/ServiceTemplateController.php(324): Illuminate\Database\Eloquent\Builder->get()
#9 /opt/librenms/app/Http/Controllers/ServiceTemplateController.php(305): App\Http\Controllers\ServiceTemplateController->apply()
#10 /opt/librenms/includes/discovery/ App\Http\Controllers\ServiceTemplateController->applyAll()
#11 /opt/librenms/includes/discovery/ include('...')
#12 /opt/librenms/discovery.php(118): discover_device()
#13 {main}

Still the same error. And still wondering why no one seems to be able to fix this.

1 Like

Side note: After removing everything within “Services Templates” (/services/templates) the mentioned error disappears. If I add a service template again, the error reoccurs reproducable.

I would say the services templates feature is unusable at the moment.


Headsup to prevent This topic will close 3 months after the last reply.

1 Like

I will try this myself to see if it happens to me as well. Thank you for suggesting this!

1 Like

I can confirm that this works for me as well. Thank you!

1 Like

You’re welcome :slight_smile:

But… my post wasn’t meant as a solution. It was meant as a hint for the developers to identify the source of the bug and finally get it fixed.

Next week this bug celebrates its “one year birthday” … not sure if funny.

1 Like

Oh I know…I just appreciate that you found the workaround and helped me clear out 80,000 excess entries in my event log.


Same problem here… lets keep it alive!

1 Like

I use service templates a lot and I’m getting the same error. Had to disable service discovery to get rid of the error :frowning_face: